Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Units outside of registry #1104

Open
ksunden opened this issue Oct 14, 2022 · 0 comments
Open

Units outside of registry #1104

ksunden opened this issue Oct 14, 2022 · 0 comments

Comments

@ksunden
Copy link
Member

ksunden commented Oct 14, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant