Skip to content

Commit

Permalink
Add "delta_" prefix to aliases too
Browse files Browse the repository at this point in the history
  • Loading branch information
Jellby committed May 16, 2019
1 parent 1f05b48 commit 0f9acf7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pint/default_en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ rads = 1e-2 * gray
roentgen = 2.58e-4 * coulomb / kilogram

# Temperature
degC = kelvin; offset: 273.15 = °C = degree_Celsius = celsius
degR = 5 / 9 * kelvin; offset: 0 = °R = degree_Rankine = rankine
degF = 5 / 9 * kelvin; offset: 255.372222 = °F = degree_Fahrenheit = fahrenheit
degree_Celsius = kelvin; offset: 273.15 = °C = degC = celsius
degree_Rankine = 5 / 9 * kelvin; offset: 0 = °R = degR = rankine
degree_Fahrenheit = 5 / 9 * kelvin; offset: 255.372222 = °F = degF = fahrenheit

# Time
minute = 60 * second = min
Expand Down
3 changes: 2 additions & 1 deletion pint/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ def _define(self, definition):
else:
d_symbol = None

d_aliases = tuple('Δ' + alias for alias in definition.aliases)
d_aliases = tuple('Δ' + alias for alias in definition.aliases) + \
tuple('delta_' + alias for alias in definition.aliases)

d_reference = UnitsContainer(dict((ref, value)
for ref, value in definition.reference.items()))
Expand Down

0 comments on commit 0f9acf7

Please sign in to comment.