Skip to content

added degrees units #390

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

Merged
merged 5 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions cf_xarray/tests/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def test_added_degrees_units():
assert ureg("degrees_east") == ureg("degrees")
assert ureg("degrees_east").to_base_units().units == ureg.radian

assert ureg("degrees").to_base_units().units == ureg.radian
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keewis or @jthielen will this mess updegrees as a (not-so-great) temperature unit.



def test_gpm_unit():
"""Test that the gpm unit does alias to meters."""
Expand Down
2 changes: 2 additions & 0 deletions cf_xarray/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def repl(m):
units.define(
"degrees_east = degree = degrees_east = degrees_E = degreesE = degree_east = degree_E = degreeE"
)
# degrees for grid_longitude / grid_latitude for grid_mappings
units.define("degrees = degree = degrees")
units.define("[speed] = [length] / [time]")
# ----- end block copied from xclim

Expand Down