If non-scalar units attributes are invalid, then a Violation should be returned, e.g.,
if not isinstance(units, str):
return Violation(node.name, f'Invalid units type {type(units)}')
if units.startswith('NX_') or units in invalid:
return Violation(node.name, f'Invalid units {units}')
Non-scalar units do not appear to be supported by scippnexus, but are inserted by the File Writer for hs00 histogram streams. It's not clear if this is required/expected/desired behavior (see, e.g., https://jira.esss.lu.se/browse/ECDC-3712)
If a group has a
units
attribute which is not a scalar string, the following will produce an error due to the use of thestr
startswith
method: https://github.com/scipp/chexus/blob/245fd376d5e2f741a6fb2585e32e21a1b1a47fa1/src/chexus/validators.py#L99-L100If non-scalar
units
attributes are invalid, then aViolation
should be returned, e.g.,Non-scalar
units
do not appear to be supported byscippnexus
, but are inserted by theFile Writer
forhs00
histogram streams. It's not clear if this is required/expected/desired behavior (see, e.g., https://jira.esss.lu.se/browse/ECDC-3712)