silx.io.url: h5pyd compatibility#4484
Merged
t20100 merged 5 commits intosilx-kit:mainfrom Feb 25, 2026
Merged
Conversation
t20100
reviewed
Feb 24, 2026
Member
t20100
left a comment
There was a problem hiding this comment.
Thanks for the PR and the test!
src/silx/io/utils.py
Outdated
Comment on lines
+611
to
+614
| if hasattr(h5pyd, "get_config"): | ||
| cfg = h5pyd.get_config() | ||
| else: | ||
| cfg = h5pyd.Config() |
Member
There was a problem hiding this comment.
Since we are planing a major release, I would propose to only keep h5pyd.get_config here and add a silx[h5pyd] extra requirements requiring h5pyd>=0.20.0.
If support of older version is needed, it would be best to check h5pyd version rather than using hasattr: this will help clean-up this when removing support of h5pyd<0.20.0.
Contributor
Author
There was a problem hiding this comment.
That is a clean solution. I dropped support for old h5pyd as I currently don't need it.
Checking a version and parsing a version string is too tricky.
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.
h5pyd changed their Config (HDFGroup/h5pyd@880721b) and the current version of silx with h5pyd>=0.20.0 no longer works and fails with an error:
This PR checks for availability of the new method and falls back to the old version. Therefore it should be compatible with older h5pyd versions as well.