Skip to content

Units outside of registry #1104

@ksunden

Description

@ksunden

An error encountered on the fs table by @DLafayetteII raises an interesting question:

How do we wish to handle units that are not in the unit registry?

Currently we error out at time of creation of the channel/variable

We could:

  • status quo
  • Drop units for non-standard units (with warning, but not error)
  • accept non-standard units, but disallow conversions when they are not in the registry

The particular case that was encountered is a tad bit more tricky than standard "not in registry", which can ordinarily be checked with unit in wt.units.ureg.
This particular unit was "%", which pint treats as an operator, thus it raises a SyntaxError subclass when checked if it is in the registry.

See also wright-group/bluesky-in-a-box#47 for a workaround in that application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions