Skip to content

Commit 488e514

Browse files
authored
Merge pull request #36 from znicholls/fix-area-label-handling
Fix up area label generation
2 parents 242867b + dd05a0c commit 488e514

3 files changed

Lines changed: 28 additions & 25 deletions

File tree

changelog/36.breaking.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Updated generation of area labels. The labels are now set based on keywords only, all searching for `where` or `area: mean` has been removed.
2+
Most notably, this means the cell methods `area: time: mean (over land and sea ice)` will now get the area label `lsi` whereas previously it was assigned `u`.

src/cmip_branded_variable_mapper/area_label.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@
1010

1111
AREA_LABEL_CELL_METHODS_MAPPER = CellMethodsSubStringMapperOrdered.from_unordered(
1212
{
13-
"area: mean (over land and sea ice)": "lsi",
14-
"where air": "air",
15-
"where cloud": "cl",
16-
"where convective_cloud": "ccl",
17-
"where crops": "crp",
18-
"where floating_ice_shelf": "fis",
19-
"where grounded_ice_sheet": "gis",
20-
"where ice_free_sea": "ifs",
21-
"where ice_sheet": "is",
22-
"where land": "lnd",
23-
"where land_ice": "li",
24-
"where natural_grasses": "ng",
25-
"where pastures": "pst",
26-
"where sea": "sea",
27-
"where sea_ice": "si",
28-
"where sea_ice_melt_pond": "simp",
29-
"where sea_ice_ridges": "sir",
30-
"where sector": "multi",
31-
"where shrubs": "shb",
32-
"where snow": "sn",
33-
"where stratiform_cloud": "scl",
34-
"where trees": "tree",
35-
"where unfrozen_soil": "ufs",
36-
"where vegetation": "veg",
37-
"where wetland": "wl",
13+
"over land and sea ice": "lsi",
14+
"air": "air",
15+
"cloud": "cl",
16+
"convective_cloud": "ccl",
17+
"crops": "crp",
18+
"floating_ice_shelf": "fis",
19+
"grounded_ice_sheet": "gis",
20+
"ice_free_sea": "ifs",
21+
"ice_sheet": "is",
22+
"land": "lnd",
23+
"land_ice": "li",
24+
"natural_grasses": "ng",
25+
"pastures": "pst",
26+
"sea": "sea",
27+
"sea_ice": "si",
28+
"sea_ice_melt_pond": "simp",
29+
"sea_ice_ridges": "sir",
30+
"sector": "multi",
31+
"shrubs": "shb",
32+
"snow": "sn",
33+
"stratiform_cloud": "scl",
34+
"trees": "tree",
35+
"unfrozen_soil": "ufs",
36+
"vegetation": "veg",
37+
"wetland": "wl",
3838
}
3939
)
4040
"""

tests/unit/test_map_to_cmip_branded_variable.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ def test_horizontal_labels(dimensions, exp_horizontal_label):
189189
"cell_methods, exp_area_label",
190190
(
191191
("area: mean (over land and sea ice) time: point", "lsi"),
192+
("area: time: mean (over land and sea ice)", "lsi"),
192193
("area: mean where cloud time: point", "cl"),
193194
),
194195
)

0 commit comments

Comments
 (0)