Skip to content

Update to unit parser to forgive all errors

This PR updates the parse_unit method to forgive any and all problems in the unit naming, by creating a new NamedUnit on-the-fly whenever a problem is created. This should allow mathematical operations on any and all frame data (including from NDS2), but does not allow conversions from these custom units into other units. The new units are also not registered, so that they cannot be compared to other physical units.

This also extends the format subclass to try and mangle the given name into a form it recognises, and defines a bunch of new LIGO-specific unit formats (e.g. ptcls) so that a custom NamedUnit is created only as a last resort.

Fixes #523 (closed).

cc: @areeda

Merge request reports