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

Fix pint regression #40

Merged
merged 5 commits into from
May 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/openscm_units/_unit_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,12 @@ def add_standards(self):
"Tt = 1000000000000 * t"
) # since Tt is used for "tex" in the defaults

self.define("ppt = [concentrations]")
self.define("ppb = 1000 * ppt")
self.define("ppm = 1000 * ppb")
self.define("ppm = [concentrations]")
self.define("ppb = ppm / 1000")
self.define("ppt = ppb / 1000")
# Have to rebuild cache to get right units for ppm as it is defined in
# pint
self._build_cache()
znichollscr marked this conversation as resolved.
Show resolved Hide resolved

def enable_contexts(self, *names_or_contexts, **kwargs):
"""
Expand Down