You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This problem has been around for a while and can be avoided by saving with HDF5 instead, but I'm opening this issue to document the limitation and see if anyone has ideas about whether other solutions could be possible.
NetCDF doesn't support any logical or boolean variable types so an error gets thrown when there's one in the code.parameters:
TypeError: illegal primitive data type, must be one of dict_keys(['S1', 'i1', 'u1', 'i2', 'u2', 'i4', 'u4', 'i8', 'u8', 'f4', 'f8']), got bool
It would be possible for OMAS to convert these to integers {0,1} before saving to the file, but there wouldn't be any way to know if an integer stored in NetCDF should be converted to a logical variable when read in, since code.parameters doesn't have any defined structure.
The text was updated successfully, but these errors were encountered:
Perhaps for those variables you could convert the booleans to integers, and then mark the conversion with an attribute (something like .setncattr('is_boolean', 'true')). Then of course, you'll have to take care of that when reading the file back into OMAS.
This problem has been around for a while and can be avoided by saving with HDF5 instead, but I'm opening this issue to document the limitation and see if anyone has ideas about whether other solutions could be possible.
NetCDF doesn't support any logical or boolean variable types so an error gets thrown when there's one in the
code.parameters
:It would be possible for OMAS to convert these to integers {0,1} before saving to the file, but there wouldn't be any way to know if an integer stored in NetCDF should be converted to a logical variable when read in, since
code.parameters
doesn't have any defined structure.The text was updated successfully, but these errors were encountered: