GEOPY-2756: H5 flags to optimize performances#900
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates how new .geoh5 files are created to use specific HDF5 library version bounds (libver) as part of a performance-optimization effort, and adds a regression test to validate the new creation settings.
Changes:
- Set
libver=("v110", "v114")when creating new on-disk workspaces viah5py.File(...). - Update
test_empty_workspaceto use a context manager and assert the created file’slibverbounds.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
geoh5py/workspace/workspace.py |
Adds explicit HDF5 libver bounds when creating new on-disk .geoh5 files. |
tests/workspace_test.py |
Adjusts workspace creation test and asserts the new libver behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/GA_4.8 #900 +/- ##
===============================================
Coverage 91.23% 91.24%
===============================================
Files 113 113
Lines 10508 10507 -1
Branches 1944 1943 -1
===============================================
Hits 9587 9587
Misses 486 486
+ Partials 435 434 -1
🚀 New features to boost your workflow:
|
sebhmg
left a comment
There was a problem hiding this comment.
see feedback from copilot: same options must be passed when creating as BytesIO
|
See response |
sebhmg
left a comment
There was a problem hiding this comment.
see more parameters to pass when creating h5 on BytesIO
| """ | ||
| if isinstance(self.h5file, BytesIO): | ||
| self._geoh5 = h5py.File(self.h5file, "a") | ||
| self._geoh5 = h5py.File(self.h5file, "a", libver=("v110", "v114")) |
There was a problem hiding this comment.
would need the other options too.
| self._geoh5 = h5py.File(self.h5file, "a", libver=("v110", "v114")) | |
| self._geoh5 = h5py.File( | |
| self.h5file, | |
| "a", | |
| fs_strategy="page", | |
| page_buf_size=DEFAULT_PAGE_BUF_SIZE, | |
| libver=("v110", "v114"), | |
| ) |
or just merge both case together:
| self._geoh5 = h5py.File(self.h5file, "a", libver=("v110", "v114")) | |
| if isinstance(self.h5file, (BytesIO, Path)): | |
| self._geoh5 = h5py.File( | |
| self.h5file, | |
| "a" if isinstance(self.h5file, BytesIO) else "x", | |
| fs_strategy="page", | |
| page_buf_size=DEFAULT_PAGE_BUF_SIZE, | |
| libver=("v110", "v114"), | |
| ) |
self._geoh5 = h5py.File(self.h5file, "a", libver=("v110", "v114"))
GEOPY-2756 - H5 flags to optimize performances