Skip to content

Commit

Permalink
Fix deprecation warning with pint 0.24
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelHu authored Jun 11, 2024
1 parent a50a73b commit 9b98d67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/legendhpges/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@
default_units_registry = pint.get_application_registry()
"""Default Pint physical units registry."""

default_units_registry.default_format = "~P"
if hasattr(default_units_registry, "formatter"): # pint >= 0.24
default_units_registry.formatter.default_format = "~P"
else: # pint <= 0.23
default_units_registry.default_format = "~P"

0 comments on commit 9b98d67

Please sign in to comment.