You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
Uses omegaconf to resolve the configuration. This allows to use
interpolations in the configuration, similar to the anemoi-core
packages.
## What problem does this change solve?
<!-- Describe if it's a bugfix, new feature, doc update, or breaking
change -->
## What issue or task does this change relate to?
Fixesecmwf#243.
## Additional notes ##
<!-- Include any additional information, caveats, or considerations that
the reviewer should be aware of. -->
***As a contributor to the Anemoi framework, please ensure that your
changes include unit tests, updates to any affected dependencies and
documentation, and have been tested in a parallel setting (i.e., with
multiple GPUs). As a reviewer, you are also responsible for verifying
these aspects and requesting changes if they are not adequately
addressed. For guidelines about those please refer to
https://anemoi.readthedocs.io/en/latest/***
<!-- readthedocs-preview anemoi-inference start -->
----
📚 Documentation preview 📚:
https://anemoi-inference--252.org.readthedocs.build/en/252/
<!-- readthedocs-preview anemoi-inference end -->
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Gert Mertes <13658335+gmertes@users.noreply.github.com>
Copy file name to clipboardExpand all lines: src/anemoi/inference/config/__init__.py
+81-49Lines changed: 81 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
12
12
importlogging
13
13
importos
14
-
fromcopyimportdeepcopy
14
+
fromdatetimeimportdatetime
15
15
fromtypingimportAny
16
16
fromtypingimportDict
17
17
fromtypingimportList
@@ -20,9 +20,13 @@
20
20
fromtypingimportTypeVar
21
21
fromtypingimportUnion
22
22
23
-
importyaml
23
+
fromearthkit.data.utils.datesimportto_datetime
24
+
fromomegaconfimportDictConfig
25
+
fromomegaconfimportListConfig
26
+
fromomegaconfimportOmegaConf
24
27
frompydanticimportBaseModel
25
28
frompydanticimportConfigDict
29
+
frompydanticimportfield_validator
26
30
27
31
LOG=logging.getLogger(__name__)
28
32
@@ -34,6 +38,15 @@ class Configuration(BaseModel):
34
38
35
39
model_config=ConfigDict(extra="forbid")
36
40
41
+
date: Union[datetime, None] =None
42
+
"""The starting date for the forecast. If not provided, the date will depend on the selected Input object. If a string, it is parsed by :func:`earthkit.data.utils.dates`."""
Copy file name to clipboardExpand all lines: src/anemoi/inference/config/couple.py
-4Lines changed: 0 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,6 @@
18
18
fromtypingimportTuple
19
19
20
20
fromanemoi.inference.configimportConfiguration
21
-
fromanemoi.inference.typesimportDate
22
21
23
22
LOG=logging.getLogger(__name__)
24
23
@@ -28,9 +27,6 @@ class CoupleConfiguration(Configuration):
28
27
29
28
description: Optional[str] =None
30
29
31
-
date: Optional[Date] =None
32
-
"""The starting date for the forecast. If not provided, the date will depend on the selected Input object. If a string, it is parsed by :func:`anemoi.utils.dates.as_datetime`."""
"""The starting date for the forecast. If not provided, the date will depend on the selected Input object. If a string, it is parsed by :func:`anemoi.utils.dates.as_datetime`."""
0 commit comments