-
Notifications
You must be signed in to change notification settings - Fork 19
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
64-bit integers not shown correctly in h5web display #1679
Comments
Indeed, big integers (int/uint64) numbers are not currently supported. They get converted to primitive JS numbers (float64) to avoid errors, which is why you're seeing inaccurate values. We would definitely like to improve support for big integers, though, so we'll use this issue to report any progress. Thanks! |
ScopeThe scope of this issue is to make bigints (as in primitive JS The scope does not include maintaining bigint precision in any of the WebGL-based visualizations like Heatmap, Line, RGB, and the NeXus visualizations, or showing exact bigint values in the tooltips of these visualizations. ChallengesTyping
This means that if, in some parts of the codebase, we end up with the union type This mostly comes down to the Provider supportNot all providers will be able to provide all (u)int-64 values as primitive or typed bigints, at least not in the short term. For instance, h5grove currently sends compound dataset values as JSON, so bigints end up as primitive numbers (i.e. This is a similar problem to booleans, which some providers send as primitive booleans while others send as numbers (0/1). If we can't distinguish the two cases, we have no choice but to type values as Working solutionI have a working solution that consists in introducing a new It then becomes possible to add conditions in
Obviously this is just the tip of the iceberg; the full solution required making changes to 46 files. The problem is that it feels like I'm fighting with our own types a bit. It also gets super confusing in terms of naming throughout the codebase, since for it to work, Generic solutionThe piece of the puzzle I unlocked by working on I'm thinking that we can expand the For instance, h5grove would be able to announce that it would return a I really like this solution because:
Now let's see if I can make it work. |
Describe the bug
64-bit signed and unsigned integers are not always displayed correctly in the h5web display window.
To Reproduce
int64_scalar
datasetDisplay
view on the right panel-9223372036854776000
Expected behaviour
The value returned by
h5dump -d int64_scalar sample.h5
is:-9223372036854775808
Similar happens with uint64:
uint64_scalar datatype as shown on h5web window:
18446744073709552000
while h5dump reports:
18446744073709551615
Context
The text was updated successfully, but these errors were encountered: