Skip to content

Commit 099d59d

Browse files
committed
#886: Clarify behaviour in docstring.
1 parent d8b5977 commit 099d59d

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

mip_convert/mip_convert/requested_variables.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ def produce_mip_requested_variable(
139139
# cell_measures attribute via cmor.set_variable_attribute).
140140
cmor_variable = create_cmor_variable(time_slice)
141141
if not cell_measures_applied:
142-
if saver.varid is None:
143-
saver._getVarId(cmor_variable)
142+
saver._getVarId(cmor_variable)
144143
# Apply cell_measures if a <mip_era>_cell_measures.json file exists.
145144
saver.cmor.apply_cell_measures(
146145
user_config.mip_era,

mip_convert/mip_convert/save/cmor/cmor_wrapper.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@ def set_frequency(self, frequency, **kwargs):
120120

121121
def apply_cell_measures(self, mip_era, mip_table_dir, realm, variable, frequency, region, variable_id):
122122
"""
123-
Add cell measures read from json file in with mip tables
123+
Set the cell_measures attribute on a CMOR variable using a lookup in
124+
``{mip_era}_cell_measures.json`` from the MIP tables directory. Returns
125+
silently if the file does not exist.
126+
127+
The lookup key has the form ``{realm}.{root_label}.{branding}.{frequency}.{region}``
128+
(variable name split on ``_``), so entries in the JSON must follow the
129+
convention used for CMIP7.
124130
"""
125131
self._debug_on_args('apply_cell_measures', [mip_era, mip_table_dir, realm, variable, frequency, region, variable_id], {})
126132

0 commit comments

Comments
 (0)