Skip to content
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

Do not know how to serialize a BigInt #1536

Closed
just-hello opened this issue Dec 26, 2023 · 2 comments · Fixed by #1581
Closed

Do not know how to serialize a BigInt #1536

just-hello opened this issue Dec 26, 2023 · 2 comments · Fixed by #1581
Labels
bug Something isn't working

Comments

@just-hello
Copy link

Describe the bug

When I use the H5Web extension on vscode and open the .h5 file, this display appears:
image
Here is the file I want to open:
zsim.zip

@just-hello just-hello added the bug Something isn't working label Dec 26, 2023
@axelboc
Copy link
Contributor

axelboc commented Jan 3, 2024

Hi @just-hello, thanks for the report!

The dataset you're trying to visualise has a very complicated compound dtype made of nested compound and array fields:
image

None of H5Web's visualizations currently support such a complex structure. The Raw visualization therefore acts as a fallback that reads the dataset and tries to display it as a JSON string. The error you're seeing comes from the Raw visualization's attempt at converting the JS object provided by h5wasm (which includes BigInt numbers) into a JSON string.

This same error was previously reported in silx-kit/vscode-h5web#30, but in that case, the dataset was simple enough that it was supposed to be supported by the Matrix visualization. It seems that the fix in #1503 was therefore not generic enough. I think I have found a better solution—I will investigate.

Note, however, that even if the Raw visualization manages to convert the dataset to a JSON string, it will likely be too big to display and your only option will be to download it as a JSON file via the toolbar (cf. screenshot below). Will this behaviour be satisfactory to you?

image

@just-hello
Copy link
Author

Thank you for the explanation. A download option for JSON data would be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants