Skip to content

Commit

Permalink
Adapt test_fix_coords to new version of cf-units (#2707)
Browse files Browse the repository at this point in the history
* Adapt test_fix_coords to new version of cf-units

* Minor update to CircleCI installation test triggers to run all tests

Co-authored-by: Bouwe Andela <b.andela@esciencecenter.nl>
  • Loading branch information
Klaus Zimmermann and bouweandela authored Jul 6, 2022
1 parent 3500a9f commit e01d7b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .circleci/install_triggers
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
^\.circleci/
^environment\.yml$
^esmvaltool/install/
^package/
^pyproject.toml$
^setup\.py$
^setup\.cfg$
^MANIFEST.in$
8 changes: 7 additions & 1 deletion tests/unit/cmorizers/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,13 @@ def test_fix_coords():
assert cube.coord("time").has_bounds()
assert cube.coord("time").bounds[0][1] == 30.
assert cube.coord("time").units == 'days since 1950-1-1 00:00:00'
assert cube.coord("time").units.calendar == "gregorian"
# Up to but not including CF Conventions version 1.9, `gregorian` and
# `standard` where synonyms. From then, `gregorian` has been deprecated in
# favor of `standard`. This lead to `cf-units` using `standard`, even when
# the calendar passed to the `Unit` constructor is `gregorian`. To support
# both cf-units <= 3.1.0 and later versions, we list both variants in the
# following assertion.
assert cube.coord("time").units.calendar in ("standard", "gregorian")
assert cube.coord("longitude").points[0] == 178.5
assert cube.coord("longitude").points[1] == 179.5
assert cube.coord("longitude").has_bounds()
Expand Down

0 comments on commit e01d7b7

Please sign in to comment.