-
Notifications
You must be signed in to change notification settings - Fork 24
introduce new H5 types to replace current type-tuples #122
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
Conversation
…ndling, full COMPOUND support (incl. nested, complex compounds and compounds with references)
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (87.66%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #122 +/- ##
==========================================
+ Coverage 74.13% 74.66% +0.53%
==========================================
Files 11 12 +1
Lines 2606 2712 +106
Branches 408 407 -1
==========================================
+ Hits 1932 2025 +93
- Misses 566 576 +10
- Partials 108 111 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
FYI: My other h5netcdf branch https://github.com/kmuehlbauer/h5netcdf/tree/pyfive works nicely with this branch locally. |
|
@bnlawrence @bmaranville @valeriupredoi and other's I'd like to hear your opinions on the enhancements in this PR. This PR should tackle the shortcomings of #120 and resolve #119. The created classes do not have a corresponding h5py class. They are merely a shim between HDF5 and the pyfive outward facing layers. I did this in the first place to be able to see how and where the tuple-types are handled. As those classes are no outward facing API and are only internal implementation detail, it could suffice for now. If need be, we can declare with underscore and/or move this away from One possible path of refactoring would be to completely implement these types as pyfive counterpart of A quick introduction on the PR:
I've added other alignments and code deduplication as I saw fit. One remark about the added typing, my IDE automatically adds these kinds of typing and I left it. How should this be tackled? I'm inclined to remove the typing, or make it available for all touched code. What's your opinion on that? |
|
Trying to test in Python 3.14, too. |
Works well 😃 |
|
I've had a look at this, and like moving away from tuples! My only concern is one I had even before this enhancement, and one that you've got in your list of things, and that's that we are overusing the attribute name dtype. Effectively we have two types of dtypes and we have to work out which one we are dealing with in any context almost by inspection. The name doesn't help us. That makes reading and understanding the pull request hard, but that hardness is not the fault of the pull request itself, even looking the code requires a lot in our mental stacks. E.g. Lines 255 to 259 in 45e1a98
The comment at least tells us what the local _dtype is for but down at lines Lines 289 to 292 in 45e1a98
We are not really sure what new_dtype actually is any more. In most of the pyfive code, dtype is our dtype (was tuple, now an H5T object, which like I say, I like), except like the last snippet where we need the actual type for numpy, and when we expose the dtype to users where again, it's a numpy thing. Given that your touching every usage of our internal tuple dtype, could we change the name in some way so we don't have this confusion? It feels like this is our best chance to do it and given your list of bullets above, it seems like you do think it, so I reckon it's worth the little refactor to do it now. (In terms of the IDE adding types, I'd be tempted to remove it for now, if we're going to go there - with linter changes - we can do it all at the same time.) |
|
I am inclined not to worry too much about our |
|
Thanks @bnlawrence for looking at this. I agree with all your reasoning.
So I would suggest to call the types I'll also remove the typing for now. |
|
@bnlawrence I've worked along your suggestion on renaming/refactoring. Just from looking at it, it was the right decision. |
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.
This is great. I'd be happy to merge this!
|
Thanks again @bnlawrence for considering and review suggestions. Looking forward to see this released. |
|
great many thanks @kmuehlbauer and @bnlawrence 🍻 |
|
@kmuehlbauer I noticed the checksum test for the fletch32 filter is flaky - it had just failed the checksum test before I was silly enough to rerun it, then the rerun passed - do you expect any flakiness? 🍺 EDIT: Python 3.14 test failed only, passed at rerun |
|
Hmm, I don't expect it to be flaky. This would need a bit closer inspection. I haven't seen this locally. |
thanks, Kai! No need to inspect - I reran the tests some 25-30 times, no fail - must have been been something wrong with the storage of that particular run. As we are 🍺 |
Description
The h5types-as-a-tuple approach didn't work out in #119. I got confused trying to implement for the needs of #119. Thanks @lm41 for the hacking session together over the weekend. It wouldn't have been possible without you ❤️.
So, this adds a comprehensive set of H5Type and derived classes. This makes life much easier and code more readable. Although this adds a bit of overhead compared with the basic tuple system, it should not substantially affect performance.
Closes #119, overrides #120
Before you get started
Checklist