Skip to content

Commit eb96e61

Browse files
authored
Fix nominal resolution logical issue (#344)
* fix _get_nominal_resolution() * Refactor _get_nominal_resolution method indentation * fix test and pre-commit issue * fix issue while invoke get_required_global_attributes
1 parent 8d6323d commit eb96e61

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/access_moppy/vocabulary_processors.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,9 @@ def get_required_global_attributes(self) -> Dict[str, Any]:
896896
"institution_id": ",".join(self.source["institution_id"]),
897897
"license": self._get_license(),
898898
"mip_era": self.mip_era,
899-
"nominal_resolution": self._get_nominal_resolution(),
899+
"nominal_resolution": self._get_nominal_resolution(
900+
target_realm=getattr(self, "target_realm", None)
901+
),
900902
"physics_index": variant["physics_index"],
901903
"product": self.cmip_table["Header"].get("product"),
902904
"realization_index": variant["realization_index"],
@@ -944,6 +946,8 @@ def _get_institution(self) -> str:
944946
def _get_nominal_resolution(
945947
self, target_realm: Optional[str] = None
946948
) -> Optional[str]:
949+
if target_realm:
950+
self.target_realm = target_realm
947951
realm = self.variable.get("modeling_realm")
948952
if realm and len(realm.split()) > 1:
949953
if target_realm is None:

0 commit comments

Comments
 (0)