Fix HDF5 dataset creation in current directory - #7278
Conversation
Greptile SummaryFixes HDF5 dataset creation when the requested path is a basename in the current working directory.
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness, security, or quality issues identified. The new condition avoids calling Important Files Changed
Reviews (1): Last reviewed commit: "Fix HDF5 creation in current directory" | Re-trigger Greptile |
There was a problem hiding this comment.
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
.hdf5extension handling remain unchanged. Basename-only paths now succeed instead of failing duringos.makedirs(""), which is a compatible bug fix requiring no migration. - Implementation: The dirname truthiness guard directly addresses the demonstrated empty-path failure before
h5py.Fileis 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.
There was a problem hiding this comment.
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.
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 wheneveros.path.isdir()returned false. For a basename such asdataset.hdf5, the parent path is the empty string, soos.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
.hdf5extension handling is unchanged.Type of change
Validation
dataset.hdf5by basename.isaaclabchangelog fragment.Checklist