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

added degrees units #390

merged 5 commits into from
Feb 3, 2023

Conversation

larsbuntemeyer
Copy link
Contributor

@larsbuntemeyer larsbuntemeyer commented Jan 22, 2023

I would like to add the degrees unit if a grid_mapping is present. This is recommended by CF conventions:

grafik

This is mainly to adapt the cf format. The original degrees unit would be printed as deg:

u = units.Unit("degrees")
f"{u:cf}"
'deg'

however, this PR changes this to:

'degrees'

I don't think this would cause a conflict? Thanks for cosidering this!

@@ -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.

@dcherian dcherian requested a review from jthielen January 30, 2023 22:17
@dcherian dcherian enabled auto-merge (squash) February 3, 2023 19:19
@dcherian dcherian merged commit 0f79d98 into xarray-contrib:main Feb 3, 2023
@larsbuntemeyer larsbuntemeyer deleted the degrees branch February 3, 2023 20:52
dcherian added a commit to dcherian/cf-xarray that referenced this pull request Feb 8, 2023
* upstream/main:
  Support grid_topology, mesh_topology CF roles. (xarray-contrib#420)
  added degrees units (xarray-contrib#390)
dcherian added a commit to Descanonge/cf-xarray that referenced this pull request Feb 22, 2023
* main: (33 commits)
  Update README.rst
  Update README.rst
  v0.8.0 release (xarray-contrib#424)
  Add sgrid axes parsing (xarray-contrib#421)
  Add rich repr (xarray-contrib#409)
  add `cf.grid_mapping_names` (xarray-contrib#391)
  Update CF standard name table v80 (xarray-contrib#423)
  Support grid_topology, mesh_topology CF roles. (xarray-contrib#420)
  added degrees units (xarray-contrib#390)
  Test and support 3.11 (xarray-contrib#417)
  Update link to COSIMA tutorial (xarray-contrib#419)
  Bump mamba-org/provision-with-micromamba from 14 to 15 (xarray-contrib#418)
  Update whats-new.rst (xarray-contrib#414)
  [skip-ci] Include data folder (xarray-contrib#416)
  Update changelog URL
  updated whats new for release (xarray-contrib#413)
  Using regex package for match (xarray-contrib#408)
  Try pytest-pretty (xarray-contrib#410)
  Update CITATION.cff (xarray-contrib#399)
  Fix upstream-dev CI (xarray-contrib#406)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants