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

Would it be possible to be able to save @enum values? #1149

Open
AhmedSalih3d opened this issue Apr 12, 2024 · 1 comment
Open

Would it be possible to be able to save @enum values? #1149

AhmedSalih3d opened this issue Apr 12, 2024 · 1 comment

Comments

@AhmedSalih3d
Copy link

Hello!

I have a use case in which @enums are awesome, integer identifiers for different variables to give the code more context / meaning.

I noticed that this does not work out of the box:

julia> @enum xxx::Int8 x = 1

julia> x
x::xxx = 1

julia> file["test"] = UInt8(x)
0x01

julia> file["test"] = x
ERROR: MethodError: no method matching hdf5_type_id(::Type{xxx}, ::Val{false})

Converting it to the correct type of course works as expected. I think it should be possible for the code to correctly parse a vector of enums and save it?

Kind regards

@mkitti
Copy link
Member

mkitti commented Jun 25, 2024

We might be able to use HDF5 enum types for this:
https://docs.hdfgroup.org/hdf5/v1_12/group___e_n_u_m.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants