Skip to content

Comments

Add filter dataset saving for env#143

Merged
yuecideng merged 1 commit intomainfrom
yueci/filter-dataset-save
Feb 19, 2026
Merged

Add filter dataset saving for env#143
yuecideng merged 1 commit intomainfrom
yueci/filter-dataset-save

Conversation

@yuecideng
Copy link
Contributor

@yuecideng yuecideng commented Feb 19, 2026

Description

Add argument to enviroment launcher to support dataset saving disable, which is used mainly for debugging purpose.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

Copilot AI review requested due to automatic review settings February 19, 2026 09:31
@yuecideng yuecideng added dataset gym robot learning env and its related features labels Feb 19, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_saving to the env launcher CLI and propagate it into the built EmbodiedEnvCfg.
  • Introduce filter_dataset_saving in EmbodiedEnvCfg and skip DatasetManager initialization 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.

Comment on lines 617 to 621
def close(self) -> None:
"""Close the environment and release resources."""
# Finalize dataset if present
if self.cfg.dataset:
self.dataset_manager.finalize()
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +211 to 213
if self.cfg.dataset and not self.cfg.filter_dataset_saving:
self.dataset_manager = DatasetManager(self.cfg.dataset, self)

Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
@yuecideng yuecideng merged commit 28384c1 into main Feb 19, 2026
10 checks passed
@yuecideng yuecideng deleted the yueci/filter-dataset-save branch February 19, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dataset gym robot learning env and its related features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant