-
Notifications
You must be signed in to change notification settings - Fork 21
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
Merge signed and unsigned integer types #1736
Conversation
@@ -121,6 +120,7 @@ export type Endianness = (typeof H5T_TO_ENDIANNESS)[H5T_ORDER]; | |||
export type CharSet = (typeof H5T_TO_CHAR_SET)[H5T_CSET]; | |||
export type StrPad = (typeof H5T_TO_STR_PAD)[H5T_STR]; | |||
|
|||
export type NumericType = IntegerType | FloatType; |
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.
We still keep a NumericType
as that's still useful throughout the codebase.
I am not awfully convinced by this. Personally, I have always valued descriptive values over flags. Also
Is that really true ? As far as I can see, unsigned and signed integers are separate datatypes: https://support.hdfgroup.org/documentation/hdf5/latest/group___p_d_t_s_t_d.html So unless this lays ground for another future refactoring, I need a little more to go along 😄 |
I was referring to the |
So the idea is to bring Another argument is that the (I'd like to split |
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.
Ok then 👍
The goal is to split
NumericType
into two dtypes:IntegerType
andFloatType
, and to replaceDTypeClass.Unsigned
with asigned
boolean inIntegerType
.I had first planned to introduce this change as part of adding support for big integers (cf. #1679 (comment)). At the time I wanted to introduce a new
DType
calledBigIntegerType
and it didn't really make sense to have this dtype together withNumericType
... I'm now going back on this solution for reasons I'll explain soon, but I find that theNumericType
refactoring still makes sense.IntegerType
/FloatType
brings us closer to the HDF5 types, and representing the sign as a boolean avoids relying on theDTypeClass
enum's value too much in the metadata viewer (i.e. "Integer (unsigned)").