-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solve some h5py deprecation warnings #2874
Solve some h5py deprecation warnings #2874
Conversation
making this a draft for now. I'll check in the test logs if I've missed any occurrences. |
There is still one deprecation warning
But I couldn't locate the problematic |
Is it the handler in the OpenPMD frontend? It doesn't explicitly seem to use the mode anywhere that I see. |
Also lines 97 and 146 of |
I still can't find it... but because the data_structures.py file imports h5py as
right ! they also weren't matched by my regex because the mode argument is passed as a variable rather than a plain string, well played ! I just fixed those, but I would really like to know where exactly it the remaining outcast ! |
Oh! None of those fixed the warning??? |
I mean I just fixed them right now because I didn't catch them before you pointed them out ! |
there's still one in the log, but I really can't find it's origin
@munkm I've been trying to locate but if you're referring to this line self._handle = HDF5FileHandler(filename) that's not it: this calls |
d797531
to
d97d9c1
Compare
You already fixed the instances I was talking about with h5 in OpenPMD . 🙂 There are a couple of other instances where h5py is imported as h5 -- I bet the culprit is one of those. They all use h5.File() without The files I see that do that import are:
|
nice catch, I'm on it |
done ! This allowed me to find the one call that didn't have a "mode" argument at all (hence wasn't future proof). Thanks a lot for your assistance with this ! |
Wooo!!! ... With our powers combined! 😉 |
I've added a workflow to catch those on future pull requests ! |
Welp. I had to update a file opening mode (previously implicit) from However I have serious doubts that this is the intended behaviour here since the affected method is named yt/yt/data_objects/static_output.py Line 1020 in 2438fd1
and I don't get where/how |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems good to me, and I think adding more stuff to the rules will be fine over time
PR Summary
h5py
deprecated theirdataset.value
attribute and now recommend usingdataset[()]
instead.The change was already performed in most of the code, this PR adresses the remaining occurrences.
PR Checklist
black --check yt/
isort . --check --diff
flake8 yt/
flynt yt/ --fail-on-change --dry-run -e yt/extern