Skip to content

Commit

Permalink
ENH: Add dBZ as a unit in the registry
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrover1 committed Jan 2, 2024
1 parent 76d0c2b commit 8d47816
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/metpy/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def setup_registry(reg):
'= degreeN')
reg.define('degrees_east = degree = degrees_E = degreesE = degree_east = degree_E '
'= degreeE')
reg.define('dBZ = 1 ; logbase: 10; logfactor: 10')

# Alias geopotential meters (gpm) to just meters
reg.define('@alias meter = gpm')
Expand Down
1 change: 1 addition & 0 deletions tests/units/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def test_added_degrees_units():
assert units('degrees_north').to_base_units().units == units.radian
assert units('degrees_east') == units('degrees')
assert units('degrees_east').to_base_units().units == units.radian
assert units("dBZ") == units("dB")

Check failure on line 179 in tests/units/test_units.py

View workflow job for this annotation

GitHub Actions / Flake8

[ruff] reported by reviewdog 🐶 Q000 [*] Double quotes found but single quotes preferred Raw Output: tests/units/test_units.py:179:18: Q000 [*] Double quotes found but single quotes preferred

Check failure on line 179 in tests/units/test_units.py

View workflow job for this annotation

GitHub Actions / Flake8

[ruff] reported by reviewdog 🐶 Q000 [*] Double quotes found but single quotes preferred Raw Output: tests/units/test_units.py:179:34: Q000 [*] Double quotes found but single quotes preferred


def test_is_quantity():
Expand Down

0 comments on commit 8d47816

Please sign in to comment.