Skip to content

Fix HDF5 dataset creation in current directory - #7278

Open
sylvesterkaczmarek wants to merge 3 commits into
isaac-sim:developfrom
sylvesterkaczmarek:fix/hdf5-create-current-directory
Open

Fix HDF5 dataset creation in current directory#7278
sylvesterkaczmarek wants to merge 3 commits into
isaac-sim:developfrom
sylvesterkaczmarek:fix/hdf5-create-current-directory

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Description

Fixes HDF5DatasetFileHandler.create() when the requested dataset file is in the current working directory.

The handler derives the parent directory with os.path.dirname(file_path) and previously attempted to create it whenever os.path.isdir() returned false. For a basename such as dataset.hdf5, the parent path is the empty string, so os.makedirs("") raises instead of creating the dataset.

The handler now creates a parent directory only when the path actually contains one. Existing behavior for nested output paths and automatic .hdf5 extension handling is unchanged.

Type of change

  • Bug fix

Validation

  • Added a unit regression test that changes into a temporary directory and creates dataset.hdf5 by basename.
  • The test verifies that the file is created successfully in the current directory.
  • Runtime change is one condition only.
  • Added the required isaaclab changelog fragment.

Checklist

  • I have read and understood the contribution guidelines
  • I have added a regression test
  • I have added the required changelog fragment
  • No new dependencies

@sylvesterkaczmarek
sylvesterkaczmarek requested a review from a team August 21, 2026 15:53
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Aug 21, 2026
@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes HDF5 dataset creation when the requested path is a basename in the current working directory.

  • Skips parent-directory creation when os.path.dirname() returns an empty string.
  • Adds a regression test covering current-directory output.
  • Adds the corresponding changelog fragment.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or quality issues identified.

The new condition avoids calling os.makedirs with an empty path while leaving nested directory creation unchanged, and the regression test exercises the corrected basename workflow.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/utils/datasets/hdf5_dataset_file_handler.py Correctly guards directory creation for parentless paths while preserving nested-path and extension behavior.
source/isaaclab/test/utils/test_hdf5_dataset_file_handler.py Adds focused regression coverage proving that basename creation succeeds in the current working directory.
source/isaaclab/changelog.d/sylvesterkaczmarek-hdf5-current-directory.patch.rst Accurately documents the user-visible bug fix.

Reviews (1): Last reviewed commit: "Fix HDF5 creation in current directory" | Re-trigger Greptile

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isaac Lab Review Bot

The PR correctly guards parent-directory creation when os.path.dirname() returns an empty string, allowing HDF5DatasetFileHandler.create() to create a basename-only HDF5 file in the current working directory. The focused regression test and package changelog fragment match the change.

  • Design and architecture: The fix remains within the existing file-handler boundary and preserves responsibility for extension handling and nested-directory creation in create(). No caller or architectural changes are introduced.
  • API: The public method signature and established behavior for nested paths and automatic .hdf5 extension handling remain unchanged. Basename-only paths now succeed instead of failing during os.makedirs(""), which is a compatible bug fix requiring no migration.
  • Implementation: The dirname truthiness guard directly addresses the demonstrated empty-path failure before h5py.File is opened. The regression test uses an isolated temporary working directory, closes the handler, and verifies the resulting file. The changelog fragment follows the package release-note process.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AI review disclosure: This review was produced with assistance from multiple AI systems.

Thank you for putting this PR together.

Assessment: Parent-directory guard fixes basename-only creation while preserving nested paths and extension handling.

Findings: Invalid .patch.rst changelog filename.

Requested changes: Rename the changelog fragment to .rst.

Changelog filename: Rename the current <slug>.patch.rst fragment to <slug>.rst for this patch-level change. IsaacLab accepts <slug>.rst (patch), <slug>.minor.rst, and <slug>.major.rst; it does not accept a .patch.rst suffix.

Test scope: Single regression plus existing handler tests are sufficient.

Documentation / AI skills: No additional documentation update is required: no public signature or usage contract changed. No AI-skill update is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants