Skip to content

Commit 33b408f

Browse files
authored
Default grid_label to g999 for CMIP7 (#451)
1 parent abfe2d9 commit 33b408f

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/access_moppy/driver.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __init__(
112112
experiment_id: str,
113113
source_id: str,
114114
variant_label: str,
115-
grid_label: str,
115+
grid_label: str | None = None,
116116
cmip_version: str = "CMIP6",
117117
activity_id: str | None = None,
118118
output_path: str | Path | None = ".",
@@ -139,7 +139,8 @@ def __init__(
139139
experiment_id: CMIP experiment ID, e.g. ``"historical"``.
140140
source_id: CMIP source ID, e.g. ``"ACCESS-ESM1-5"``.
141141
variant_label: CMIP variant label, e.g. ``"r1i1p1f1"``.
142-
grid_label: CMIP grid label, e.g. ``"gn"``.
142+
grid_label: CMIP grid label, e.g. ``"gn"``. Defaults to
143+
``"g999"`` for CMIP7 and ``"gn"`` for CMIP6/CMIP6Plus.
143144
cmip_version: Vocabulary family to use: ``"CMIP6"``,
144145
``"CMIP6Plus"``, or ``"CMIP7"``.
145146
activity_id: Optional CMIP activity ID, e.g. ``"CMIP"``.
@@ -192,6 +193,10 @@ def __init__(
192193
resource-backed variable is used.
193194
"""
194195

196+
# Apply version-specific defaults
197+
if grid_label is None:
198+
grid_label = "g999" if cmip_version == "CMIP7" else "gn"
199+
195200
# Validate CMIP version
196201
if cmip_version not in ("CMIP6", "CMIP6Plus", "CMIP7"):
197202
raise ValueError(

tests/integration/test_full_cmorisation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ def test_cmorisation_variable(
375375
experiment_id=experiment_id,
376376
source_id=source_id,
377377
variant_label="r1i1p1f1",
378-
grid_label="gn",
379378
cmip_version=cmip_version,
380379
activity_id="CMIP",
381380
parent_info=parent_info,
@@ -690,7 +689,6 @@ def test_quick_integration_sample(self, parent_experiment_config):
690689
experiment_id="historical",
691690
source_id="ACCESS-ESM1-6",
692691
variant_label="r1i1p1f1",
693-
grid_label="gn",
694692
activity_id="CMIP",
695693
parent_info=parent_experiment_config,
696694
output_path=output_dir,

0 commit comments

Comments
 (0)