Skip to content

Commit 522d4a1

Browse files
gipertclaude
andcommitted
fix(units): declare ~P as dspeed's unit format default
dspeed assumes short-form unit names (e.g. 'ns' rather than 'nanosecond') in output attrs and elsewhere. Today this works because lgdo.units sets formatter.default_format = "~P" on the application registry when lh5 imports it. Make the dependency explicit so dspeed does not silently break if that transitive import side effect goes away or if a consumer uses dspeed.units without triggering lh5. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 89e01c1 commit 522d4a1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/dspeed/units.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
import pint
22

33
unit_registry = pint.get_application_registry()
4+
# match the short-form default used across the legend-exp ecosystem
5+
# (lgdo.units does the same on import)
6+
unit_registry.formatter.default_format = "~P"

0 commit comments

Comments
 (0)