Conversation
|
I am not sure this is correct, since neither |
|
My reasoning was that currently, there is no way in nexus that a field can accept any kind of data. I would expect that NX_CHAR_OR_NUMBER should be precisely that. |
Technically, we could include booleans also in NX_INT, then they would be contained in NX_NUMBER |
nexusformat/definitions#1246 (comment) introduced I see that it would be nice to be able to define a field can accept any kind of data. However, with the way the types are currently implemented, I don't think it is really possible. I think the best solution would actually be to be able to write unions of types, like type="NX_NUMBER|NX_CHAR" instead of inventing workarounds like The question is, what we do we do for now in pynxtools? Do we go with the literal interpretation of |
|
We can keep it as it is, I'll close this. It was just for the conversion parameters and a bool flag there, but I can also use NXcollection there. |
|
@lukaspie Interestingly enough, bool is a subclass of int: I am thus wondering why I got a warning in the first place, I will check that. |
|
This is a bit inconsistent: |
|
From https://joergdietrich.github.io/python-numpy-bool-types.html:
|
If bool is a subclass of int in Python, I think it's fine if we allow it, |
lukaspie
left a comment
There was a problem hiding this comment.
LGTM, but linting needs to be fixed
18e552d to
105cd0d
Compare
Nexus states "Any valid character string or NeXus number representation", and thus I think it makes sense to also allow bool here.