Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new environment-launcher flag to disable dataset saving at runtime (intended for debugging), and wires it through the environment config so DatasetManager creation/saving can be skipped.
Changes:
- Add
--filter_dataset_savingto the env launcher CLI and propagate it into the builtEmbodiedEnvCfg. - Introduce
filter_dataset_savinginEmbodiedEnvCfgand skipDatasetManagerinitialization when enabled. - Update episode reset logic to gate saving on the presence of
dataset_manager.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
embodichain/lab/gym/utils/gym_utils.py |
Adds CLI flag and passes it into the env config built from args. |
embodichain/lab/gym/envs/embodied_env.py |
Adds config field and uses it to skip dataset manager creation and saving paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def close(self) -> None: | ||
| """Close the environment and release resources.""" | ||
| # Finalize dataset if present | ||
| if self.cfg.dataset: | ||
| self.dataset_manager.finalize() |
There was a problem hiding this comment.
close() finalizes the dataset based on self.cfg.dataset, but with the new filter_dataset_saving flag it’s possible for self.cfg.dataset to be set while self.dataset_manager was never created (remains None). In that case self.dataset_manager.finalize() will raise an AttributeError. Gate finalization on self.dataset_manager is not None (or equivalent) instead of self.cfg.dataset so disabling dataset saving doesn’t break cleanup.
| if self.cfg.dataset and not self.cfg.filter_dataset_saving: | ||
| self.dataset_manager = DatasetManager(self.cfg.dataset, self) | ||
|
|
There was a problem hiding this comment.
The new filter_dataset_saving behavior changes whether DatasetManager is constructed and whether episodes are saved. There are existing pytest-based env tests (e.g., tests/gym/envs/test_embodied_env.py), but none assert that setting this flag prevents dataset manager creation/saving or that close() works when cfg.dataset is configured but saving is filtered. Add a focused unit/integration test that configures a dataset, sets filter_dataset_saving=True, and asserts dataset_manager stays None (and no finalize/save calls occur).
Description
Add argument to enviroment launcher to support dataset saving disable, which is used mainly for debugging purpose.
Type of change
Checklist
black .command to format the code base.