Skip to content

Commit 5c2ebf0

Browse files
authored
Merge pull request #67 from ecmwf-lab/develop
Allow for model to set GRIB edition
2 parents b1a202c + 3a7028b commit 5c2ebf0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/ai_models/model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class Model:
6363
assets_extra_dir = None
6464
retrieve = {} # Extra parameters for retrieve
6565
version = 1 # To be overriden in subclasses
66+
grib_edition = 2 # Default GRIB edition
6667
grib_extra_metadata = {} # Extra metadata for grib files
6768

6869
param_level_ml = ([], []) # param, level

src/ai_models/outputs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(self, owner, path, metadata, **kwargs):
3838

3939
@cached_property
4040
def grib_keys(self):
41-
edition = self.metadata.pop("edition", 2)
41+
edition = self.metadata.pop("edition", self.owner.grib_edition)
4242

4343
_grib_keys = dict(
4444
edition=edition,

0 commit comments

Comments
 (0)