Respect selected episodes when combining datasets - #350
Open
Doribelove wants to merge 1 commit into
Open
Conversation
Forward dataset episode indices to storage copying while retaining the full-copy default. Preserve selection order and initialize empty output storage through the writer. Cover dataset views and storage appends on all three formats, and document the behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
combine_datasetscopies every episode from each input's backing storage, even when the input is a filtered or splitMinariDataset. Splitting a four-episode dataset into two two-episode views and combining them therefore produces eight episodes. Combining a filtered view also restores the excluded episodes.This change passes each dataset's
episode_indicestoMinariStorage.update_from_storage. The new optional argument preserves the existing full-copy behavior when omitted and copies supplied indices in order. Supplied iterables are materialized because storage backends can traverse indices more than once. Episode buffers are passed to the storage writer as an iterable, including when empty, so combining empty views also initializes a readable HDF5 destination.The tests cover filtered, split, reordered and empty views on HDF5, Arrow and Parquet; persisted episode/step totals; episode payloads and reassigned IDs; and appending selections, including one-shot iterators, to existing storage. The API docstring and basic usage documentation describe the selection behavior.
Type of change
Validation
Base:
50c652274c43ee3085116861d6ab9f6e160c9ab4.tests/utils/test_dataset_combine.py. All failures were episode-count assertions.tests/utils/test_dataset_combine.pyandtests/dataset/test_minari_storage.py.tests/data_collector,tests/dataset/test_minari_dataset.py,tests/utils/test_dataset_creation.py,tests/utils/test_get_normalized_score.py,tests/test_serialization.pyandtests/test_hosting.py. This run emitted 59 warnings.pre-commit run --all-files: all applicable hooks passed except the existing pyright error attests/utils/test_dataset_creation.py:424(NDArraypassed toEpisodeBuffer.observations). The unmodified base reports the same one error and two warnings.git diff --checkpassed.Environment: Ubuntu 22.04.5 x86_64, Python 3.12.14, NumPy 2.5.3, Gymnasium 1.3.0, h5py 3.16.0, PyArrow 25.0.1 and pytest 9.1.1; editable install with
.[all,testing].This is local data-handling validation. A full
pytest -vrun withHF_HUB_OFFLINE=1stops during collection of the download and CLI tests, which query Hugging Face dataset metadata; the unmodified base stops at the same two modules. The three optional integration modules are skipped. Remote dataset, documentation execution and third-party integration suites have not been validated. No training or performance result is claimed.Checklist
pre-commit run --all-files(existing pyright failure described above).pytest -vand no errors are present.pytest -vrun have been resolved.AI assistance: the implementation, tests and this description were prepared with Codex. The reported validation commands were executed locally.