-
Notifications
You must be signed in to change notification settings - Fork 90
Description
What would you like to see added to PyNWB?
I just got this question from @urut
We're exporting things with matnwb and running through pynwb validator and it gives error below. question is, what is meant by 'int' here -- int32? single?
The answer is int32, but I think this brings up a good point, and this is a common hurdle users producing NWB files outside of PyNWB.
IMO, specifying type precision this way has two problems:
- It's unclear. I get that single precision is often the default, so
intcan be shorthand forint32, but that isn't always the case: MATLAB does not have a default integer precision (int64(5)works butint(5)does not) and the default precision for floats is double (64). Of course when you are creating a variable you must choose a precision, but when used in a schema to me it's more natural to interpret this anintof any precision in this case. - It is inflexible. I would also prefer the "any precision" interpretation because it would allow the user to decide what precision they need. Enforcing a higher precision than necessary is wasteful and honestly I don't really see an upside.
Is your feature request related to a problem?
No response
What solution would you like?
My most preferred solution would be to map "int" to "int8", "uint" to "uint8", and "float" to "float8". I'm pretty sure this would not invalidate any currently valid NWB files and would not break any tools.
If there is some reason why keeping single-precision is important, then my next favorite solution would be to change the schema to make the data requirement explicit, changing all instances of "int" to "int32".
If that is too big of a lift, then another solution that would at least move us in the right direction would be to enhance the messages produced by the validator to be explicit about the precision requirement.
Do you have any interest in helping implement the feature?
Yes.
Code of Conduct
- I agree to follow this project's Code of Conduct
- Have you checked the Contributing document?
- Have you ensured this change was not already requested?
