8000 Add config type annotations to rearrange_sim. by 0mdc · Pull Request #2135 · facebookresearch/habitat-lab · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add config type annotations to rearrange_sim. #2135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 22, 2025
Merged

Add config type annotations to rearrange_sim. #2135

merged 5 commits into from
Jan 22, 2025

Conversation

0mdc
Copy link
Contributor
@0mdc 0mdc commented Jan 16, 2025

Motivation and Context

This changeset annotates the rearrange_sim config types to provide type annotations for configs.

How Has This Been Tested

CI

Types of changes

  • [Refactoring] Large changes to the code that improve its functionality or performance

Checklist

  • My code follows the code style of this project.
  • I have updated the documentation if required.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes if required.

@0mdc 0mdc requested a review from aclegg3 January 16, 2025 16:57
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jan 16, 2025
@@ -1667,7 +1668,7 @@ class AgentConfig(HabitatBaseConfig):
max_climb: float = 0.2
max_slope: float = 45.0
grasp_managers: int = 1
sim_sensors: Dict[str, SimulatorSensorConfig] = field(default_factory=dict)
Copy link
Contributor Author
@0mdc 0mdc Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aclegg3

This field has a bad smell.

When refactoring sensors, we should revisit how users define their sensors. If you look just above, you'll notice that framework-level subclasses were created for application-level code.

We should aim to use composition rather than inheritance to define sensors.


@contextmanager
def read_write(config: "Container") -> Generator[Node, None, None]:
def read_write(config: Any) -> Generator[Node, None, None]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably avoid using this altogether.

Changing configs mid-execution contributes to the complexity explosion we're experiencing, and drives us away from a data-driven paradigm.


def overwrite_config(
config_from: DictConfig,
config_from: Any,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

Copy link
Contributor Author
@0mdc 0mdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments for reviewers.

Copy link
Contributor
@aclegg3 aclegg3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the changes look good here. Some cleanup for tests left based on import layering. Apparently we import DictConfig from default.py, haha.

Copy link
Contributor
@aclegg3 aclegg3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@0mdc 0mdc marked this pull request as ready for review January 22, 2025 22:21
@0mdc 0mdc merged commit 9340ef6 into main Jan 22, 2025
4 checks passed
@0mdc 0mdc deleted the 0mdc/config_typing branch January 22, 2025 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0