esgvoc 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of esgvoc might be problematic. Click here for more details.
- esgvoc/__init__.py +1 -0
- esgvoc/api/__init__.py +62 -0
- esgvoc/api/_utils.py +39 -0
- esgvoc/api/data_descriptors/__init__.py +60 -0
- esgvoc/api/data_descriptors/activity.py +51 -0
- esgvoc/api/data_descriptors/consortium.py +66 -0
- esgvoc/api/data_descriptors/date.py +48 -0
- esgvoc/api/data_descriptors/experiment.py +60 -0
- esgvoc/api/data_descriptors/forcing_index.py +47 -0
- esgvoc/api/data_descriptors/frequency.py +45 -0
- esgvoc/api/data_descriptors/grid_label.py +46 -0
- esgvoc/api/data_descriptors/initialisation_index.py +46 -0
- esgvoc/api/data_descriptors/institution.py +58 -0
- esgvoc/api/data_descriptors/license.py +47 -0
- esgvoc/api/data_descriptors/mip_era.py +46 -0
- esgvoc/api/data_descriptors/model_component.py +47 -0
- esgvoc/api/data_descriptors/organisation.py +42 -0
- esgvoc/api/data_descriptors/physic_index.py +47 -0
- esgvoc/api/data_descriptors/product.py +45 -0
- esgvoc/api/data_descriptors/realisation_index.py +46 -0
- esgvoc/api/data_descriptors/realm.py +44 -0
- esgvoc/api/data_descriptors/resolution.py +46 -0
- esgvoc/api/data_descriptors/source.py +57 -0
- esgvoc/api/data_descriptors/source_type.py +43 -0
- esgvoc/api/data_descriptors/sub_experiment.py +43 -0
- esgvoc/api/data_descriptors/table.py +50 -0
- esgvoc/api/data_descriptors/time_range.py +28 -0
- esgvoc/api/data_descriptors/variable.py +77 -0
- esgvoc/api/data_descriptors/variant_label.py +49 -0
- esgvoc/api/projects.py +854 -0
- esgvoc/api/report.py +86 -0
- esgvoc/api/search.py +92 -0
- esgvoc/api/universe.py +218 -0
- esgvoc/apps/drs/__init__.py +16 -0
- esgvoc/apps/drs/models.py +43 -0
- esgvoc/apps/drs/parser.py +27 -0
- esgvoc/cli/config.py +79 -0
- esgvoc/cli/get.py +142 -0
- esgvoc/cli/install.py +14 -0
- esgvoc/cli/main.py +22 -0
- esgvoc/cli/status.py +26 -0
- esgvoc/cli/valid.py +156 -0
- esgvoc/core/constants.py +13 -0
- esgvoc/core/convert.py +0 -0
- esgvoc/core/data_handler.py +133 -0
- esgvoc/core/db/__init__.py +5 -0
- esgvoc/core/db/connection.py +31 -0
- esgvoc/core/db/models/mixins.py +18 -0
- esgvoc/core/db/models/project.py +65 -0
- esgvoc/core/db/models/universe.py +59 -0
- esgvoc/core/db/project_ingestion.py +152 -0
- esgvoc/core/db/universe_ingestion.py +120 -0
- esgvoc/core/logging.conf +21 -0
- esgvoc/core/logging_handler.py +4 -0
- esgvoc/core/repo_fetcher.py +259 -0
- esgvoc/core/service/__init__.py +8 -0
- esgvoc/core/service/data_merger.py +83 -0
- esgvoc/core/service/esg_voc.py +79 -0
- esgvoc/core/service/settings.py +64 -0
- esgvoc/core/service/settings.toml +12 -0
- esgvoc/core/service/settings_default.toml +20 -0
- esgvoc/core/service/state.py +222 -0
- esgvoc-0.1.2.dist-info/METADATA +54 -0
- esgvoc-0.1.2.dist-info/RECORD +66 -0
- esgvoc-0.1.2.dist-info/WHEEL +4 -0
- esgvoc-0.1.2.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
5
|
+
if int(PYDANTIC_VERSION[0])>=2:
|
|
6
|
+
from pydantic import (
|
|
7
|
+
BaseModel,
|
|
8
|
+
ConfigDict
|
|
9
|
+
)
|
|
10
|
+
else:
|
|
11
|
+
from pydantic import (
|
|
12
|
+
BaseModel
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
metamodel_version = "None"
|
|
16
|
+
version = "None"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ConfiguredBaseModel(BaseModel):
|
|
20
|
+
model_config = ConfigDict(
|
|
21
|
+
validate_assignment = True,
|
|
22
|
+
validate_default = True,
|
|
23
|
+
extra = "allow",
|
|
24
|
+
arbitrary_types_allowed = True,
|
|
25
|
+
use_enum_values = True,
|
|
26
|
+
strict = False,
|
|
27
|
+
)
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class MipEra(ConfiguredBaseModel):
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
id: str
|
|
39
|
+
start : int
|
|
40
|
+
end : int
|
|
41
|
+
name : str
|
|
42
|
+
type : str
|
|
43
|
+
url : str
|
|
44
|
+
# Model rebuild
|
|
45
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
46
|
+
MipEra.model_rebuild()
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
6
|
+
if int(PYDANTIC_VERSION[0])>=2:
|
|
7
|
+
from pydantic import (
|
|
8
|
+
BaseModel,
|
|
9
|
+
ConfigDict
|
|
10
|
+
)
|
|
11
|
+
else:
|
|
12
|
+
from pydantic import (
|
|
13
|
+
BaseModel
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
metamodel_version = "None"
|
|
17
|
+
version = "None"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ConfiguredBaseModel(BaseModel):
|
|
21
|
+
model_config = ConfigDict(
|
|
22
|
+
validate_assignment = True,
|
|
23
|
+
validate_default = True,
|
|
24
|
+
extra = "allow",
|
|
25
|
+
arbitrary_types_allowed = True,
|
|
26
|
+
use_enum_values = True,
|
|
27
|
+
strict = False,
|
|
28
|
+
)
|
|
29
|
+
pass
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class ModelComponent(ConfiguredBaseModel):
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
id: str
|
|
40
|
+
description :str
|
|
41
|
+
name : str
|
|
42
|
+
type : str
|
|
43
|
+
realm : dict
|
|
44
|
+
nominal_resolution : dict
|
|
45
|
+
# Model rebuild
|
|
46
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
47
|
+
ModelComponent.model_rebuild()
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
6
|
+
if int(PYDANTIC_VERSION[0])>=2:
|
|
7
|
+
from pydantic import (
|
|
8
|
+
BaseModel,
|
|
9
|
+
ConfigDict,
|
|
10
|
+
Field
|
|
11
|
+
)
|
|
12
|
+
else:
|
|
13
|
+
from pydantic import (
|
|
14
|
+
BaseModel,
|
|
15
|
+
Field
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
metamodel_version = "None"
|
|
19
|
+
version = "None"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ConfiguredBaseModel(BaseModel):
|
|
23
|
+
model_config = ConfigDict(
|
|
24
|
+
validate_assignment = True,
|
|
25
|
+
validate_default = True,
|
|
26
|
+
extra = "allow",
|
|
27
|
+
arbitrary_types_allowed = True,
|
|
28
|
+
use_enum_values = True,
|
|
29
|
+
strict = False,
|
|
30
|
+
)
|
|
31
|
+
pass
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class Organisation(ConfiguredBaseModel):
|
|
36
|
+
|
|
37
|
+
id: str
|
|
38
|
+
validation_method: str = Field(default = "list")
|
|
39
|
+
type : str
|
|
40
|
+
# Model rebuild
|
|
41
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
42
|
+
Organisation.model_rebuild()
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
9
|
+
if int(PYDANTIC_VERSION[0])>=2:
|
|
10
|
+
from pydantic import (
|
|
11
|
+
BaseModel,
|
|
12
|
+
ConfigDict
|
|
13
|
+
)
|
|
14
|
+
else:
|
|
15
|
+
from pydantic import (
|
|
16
|
+
BaseModel
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
metamodel_version = "None"
|
|
20
|
+
version = "None"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class ConfiguredBaseModel(BaseModel):
|
|
24
|
+
model_config = ConfigDict(
|
|
25
|
+
validate_assignment = True,
|
|
26
|
+
validate_default = True,
|
|
27
|
+
extra = "allow",
|
|
28
|
+
arbitrary_types_allowed = True,
|
|
29
|
+
use_enum_values = True,
|
|
30
|
+
strict = False,
|
|
31
|
+
)
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class PhysicIndex(ConfiguredBaseModel):
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
id: str
|
|
43
|
+
type : str
|
|
44
|
+
regex : str
|
|
45
|
+
# Model rebuild
|
|
46
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
47
|
+
PhysicIndex.model_rebuild()
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
6
|
+
if int(PYDANTIC_VERSION[0])>=2:
|
|
7
|
+
from pydantic import (
|
|
8
|
+
BaseModel,
|
|
9
|
+
ConfigDict
|
|
10
|
+
)
|
|
11
|
+
else:
|
|
12
|
+
from pydantic import (
|
|
13
|
+
BaseModel
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
metamodel_version = "None"
|
|
17
|
+
version = "None"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ConfiguredBaseModel(BaseModel):
|
|
21
|
+
model_config = ConfigDict(
|
|
22
|
+
validate_assignment = True,
|
|
23
|
+
validate_default = True,
|
|
24
|
+
extra = "allow",
|
|
25
|
+
arbitrary_types_allowed = True,
|
|
26
|
+
use_enum_values = True,
|
|
27
|
+
strict = False,
|
|
28
|
+
)
|
|
29
|
+
pass
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class Product(ConfiguredBaseModel):
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
id: str
|
|
40
|
+
description : str
|
|
41
|
+
type : str
|
|
42
|
+
kind : str
|
|
43
|
+
# Model rebuild
|
|
44
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
45
|
+
Product.model_rebuild()
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
8
|
+
if int(PYDANTIC_VERSION[0])>=2:
|
|
9
|
+
from pydantic import (
|
|
10
|
+
BaseModel,
|
|
11
|
+
ConfigDict,
|
|
12
|
+
)
|
|
13
|
+
else:
|
|
14
|
+
from pydantic import (
|
|
15
|
+
BaseModel,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
metamodel_version = "None"
|
|
19
|
+
version = "None"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ConfiguredBaseModel(BaseModel):
|
|
23
|
+
model_config = ConfigDict(
|
|
24
|
+
validate_assignment = True,
|
|
25
|
+
validate_default = True,
|
|
26
|
+
extra = "allow",
|
|
27
|
+
arbitrary_types_allowed = True,
|
|
28
|
+
use_enum_values = True,
|
|
29
|
+
strict = False,
|
|
30
|
+
)
|
|
31
|
+
pass
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class RealisationIndex(ConfiguredBaseModel):
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
id: str
|
|
42
|
+
type : str
|
|
43
|
+
regex : str
|
|
44
|
+
# Model rebuild
|
|
45
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
46
|
+
RealisationIndex.model_rebuild()
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
5
|
+
if int(PYDANTIC_VERSION[0])>=2:
|
|
6
|
+
from pydantic import (
|
|
7
|
+
BaseModel,
|
|
8
|
+
ConfigDict
|
|
9
|
+
)
|
|
10
|
+
else:
|
|
11
|
+
from pydantic import (
|
|
12
|
+
BaseModel
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
metamodel_version = "None"
|
|
16
|
+
version = "None"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ConfiguredBaseModel(BaseModel):
|
|
20
|
+
model_config = ConfigDict(
|
|
21
|
+
validate_assignment = True,
|
|
22
|
+
validate_default = True,
|
|
23
|
+
extra = "allow",
|
|
24
|
+
arbitrary_types_allowed = True,
|
|
25
|
+
use_enum_values = True,
|
|
26
|
+
strict = False,
|
|
27
|
+
)
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class Realm(ConfiguredBaseModel):
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
id: str
|
|
39
|
+
description :str
|
|
40
|
+
name : str
|
|
41
|
+
type : str
|
|
42
|
+
# Model rebuild
|
|
43
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
44
|
+
Realm.model_rebuild()
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
5
|
+
if int(PYDANTIC_VERSION[0])>=2:
|
|
6
|
+
from pydantic import (
|
|
7
|
+
BaseModel,
|
|
8
|
+
ConfigDict
|
|
9
|
+
)
|
|
10
|
+
else:
|
|
11
|
+
from pydantic import (
|
|
12
|
+
BaseModel
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
metamodel_version = "None"
|
|
16
|
+
version = "None"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ConfiguredBaseModel(BaseModel):
|
|
20
|
+
model_config = ConfigDict(
|
|
21
|
+
validate_assignment = True,
|
|
22
|
+
validate_default = True,
|
|
23
|
+
extra = "allow",
|
|
24
|
+
arbitrary_types_allowed = True,
|
|
25
|
+
use_enum_values = True,
|
|
26
|
+
strict = False,
|
|
27
|
+
)
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class Resolution(ConfiguredBaseModel):
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
id: str
|
|
39
|
+
description :str
|
|
40
|
+
value :str
|
|
41
|
+
name : str
|
|
42
|
+
unit : str
|
|
43
|
+
type : str
|
|
44
|
+
# Model rebuild
|
|
45
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
46
|
+
Resolution.model_rebuild()
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
from typing import (
|
|
4
|
+
List,
|
|
5
|
+
Dict,
|
|
6
|
+
Optional
|
|
7
|
+
)
|
|
8
|
+
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
9
|
+
if int(PYDANTIC_VERSION[0])>=2:
|
|
10
|
+
from pydantic import (
|
|
11
|
+
BaseModel,
|
|
12
|
+
ConfigDict,
|
|
13
|
+
Field
|
|
14
|
+
)
|
|
15
|
+
else:
|
|
16
|
+
from pydantic import (
|
|
17
|
+
BaseModel,
|
|
18
|
+
Field
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
metamodel_version = "None"
|
|
22
|
+
version = "None"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ConfiguredBaseModel(BaseModel):
|
|
26
|
+
model_config = ConfigDict(
|
|
27
|
+
validate_assignment = True,
|
|
28
|
+
validate_default = True,
|
|
29
|
+
extra = "allow",
|
|
30
|
+
arbitrary_types_allowed = True,
|
|
31
|
+
use_enum_values = True,
|
|
32
|
+
strict = False,
|
|
33
|
+
protected_namespaces = (),
|
|
34
|
+
)
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class Source(ConfiguredBaseModel):
|
|
40
|
+
"""
|
|
41
|
+
a 'source' refers to a numerical representations of the Earth's climate system. They simulate the interactions between the atmosphere, oceans, land surface, and ice. These models are based on fundamental physical, chemical, and biological processes and are used to understand past, present, and future climate conditions. Each source or model is typically associated with a specific research institution, center, or group. For instance, models like 'EC-Earth' are developed by a consortium of European institutes, while 'GFDL-CM4' is developed by the Geophysical Fluid Dynamics Laboratory (GFDL) in the United States.
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
id: str
|
|
45
|
+
validation_method: str = Field(default = "list")
|
|
46
|
+
activity_participation: Optional[List[str]]
|
|
47
|
+
cohort: List[str] = Field(default_factory=list)
|
|
48
|
+
organisation_id: List[str] = Field(default_factory=list)
|
|
49
|
+
label : str
|
|
50
|
+
label_extended: Optional[str]
|
|
51
|
+
license: Optional[Dict] = Field(default_factory=dict)
|
|
52
|
+
model_component: Optional[dict]
|
|
53
|
+
release_year: Optional[int]
|
|
54
|
+
|
|
55
|
+
# Model rebuild
|
|
56
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
57
|
+
Source.model_rebuild()
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
5
|
+
if int(PYDANTIC_VERSION[0])>=2:
|
|
6
|
+
from pydantic import (
|
|
7
|
+
BaseModel,
|
|
8
|
+
ConfigDict
|
|
9
|
+
)
|
|
10
|
+
else:
|
|
11
|
+
from pydantic import (
|
|
12
|
+
BaseModel
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
metamodel_version = "None"
|
|
16
|
+
version = "None"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ConfiguredBaseModel(BaseModel):
|
|
20
|
+
model_config = ConfigDict(
|
|
21
|
+
validate_assignment = True,
|
|
22
|
+
validate_default = True,
|
|
23
|
+
extra = "allow",
|
|
24
|
+
arbitrary_types_allowed = True,
|
|
25
|
+
use_enum_values = True,
|
|
26
|
+
strict = False,
|
|
27
|
+
)
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class SourceType(ConfiguredBaseModel):
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
id: str
|
|
39
|
+
description :str
|
|
40
|
+
type : str
|
|
41
|
+
# Model rebuild
|
|
42
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
43
|
+
SourceType.model_rebuild()
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
5
|
+
if int(PYDANTIC_VERSION[0])>=2:
|
|
6
|
+
from pydantic import (
|
|
7
|
+
BaseModel,
|
|
8
|
+
ConfigDict
|
|
9
|
+
)
|
|
10
|
+
else:
|
|
11
|
+
from pydantic import (
|
|
12
|
+
BaseModel
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
metamodel_version = "None"
|
|
16
|
+
version = "None"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ConfiguredBaseModel(BaseModel):
|
|
20
|
+
model_config = ConfigDict(
|
|
21
|
+
validate_assignment = True,
|
|
22
|
+
validate_default = True,
|
|
23
|
+
extra = "allow",
|
|
24
|
+
arbitrary_types_allowed = True,
|
|
25
|
+
use_enum_values = True,
|
|
26
|
+
strict = False,
|
|
27
|
+
)
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class SubExperiment(ConfiguredBaseModel):
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
id: str
|
|
39
|
+
description :str
|
|
40
|
+
type : str
|
|
41
|
+
# Model rebuild
|
|
42
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
43
|
+
SubExperiment.model_rebuild()
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
from typing import (
|
|
6
|
+
List,
|
|
7
|
+
Optional
|
|
8
|
+
)
|
|
9
|
+
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
10
|
+
if int(PYDANTIC_VERSION[0])>=2:
|
|
11
|
+
from pydantic import (
|
|
12
|
+
BaseModel,
|
|
13
|
+
ConfigDict,
|
|
14
|
+
Field
|
|
15
|
+
)
|
|
16
|
+
else:
|
|
17
|
+
from pydantic import (
|
|
18
|
+
BaseModel,
|
|
19
|
+
Field
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
metamodel_version = "None"
|
|
23
|
+
version = "None"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class ConfiguredBaseModel(BaseModel):
|
|
27
|
+
model_config = ConfigDict(
|
|
28
|
+
validate_assignment = True,
|
|
29
|
+
validate_default = True,
|
|
30
|
+
extra = "allow",
|
|
31
|
+
arbitrary_types_allowed = True,
|
|
32
|
+
use_enum_values = True,
|
|
33
|
+
strict = False,
|
|
34
|
+
)
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class Table(ConfiguredBaseModel):
|
|
40
|
+
|
|
41
|
+
id: str
|
|
42
|
+
validation_method: str = Field(default = "list")
|
|
43
|
+
type: str
|
|
44
|
+
product: Optional[str]
|
|
45
|
+
table_date: Optional[str]
|
|
46
|
+
|
|
47
|
+
variable_entry: List[str] = Field(default_factory=list)
|
|
48
|
+
# Model rebuild
|
|
49
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
50
|
+
Table.model_rebuild()
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from pydantic import BaseModel, ConfigDict
|
|
2
|
+
|
|
3
|
+
class ConfiguredBaseModel(BaseModel):
|
|
4
|
+
model_config = ConfigDict(
|
|
5
|
+
validate_assignment = True,
|
|
6
|
+
validate_default = True,
|
|
7
|
+
extra = "allow",
|
|
8
|
+
arbitrary_types_allowed = True,
|
|
9
|
+
use_enum_values = True,
|
|
10
|
+
strict = False,
|
|
11
|
+
)
|
|
12
|
+
pass
|
|
13
|
+
|
|
14
|
+
class Part(ConfiguredBaseModel):
|
|
15
|
+
id: str
|
|
16
|
+
type : str
|
|
17
|
+
is_required : bool
|
|
18
|
+
|
|
19
|
+
class TimeRange(ConfiguredBaseModel):
|
|
20
|
+
id: str
|
|
21
|
+
separator: str
|
|
22
|
+
type: str
|
|
23
|
+
parts: list[Part]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# Model rebuild
|
|
27
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
28
|
+
TimeRange.model_rebuild()
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
from typing import (
|
|
4
|
+
Any,
|
|
5
|
+
Dict,
|
|
6
|
+
Optional
|
|
7
|
+
)
|
|
8
|
+
from pydantic.version import VERSION as PYDANTIC_VERSION
|
|
9
|
+
if int(PYDANTIC_VERSION[0])>=2:
|
|
10
|
+
from pydantic import (
|
|
11
|
+
BaseModel,
|
|
12
|
+
ConfigDict,
|
|
13
|
+
Field,
|
|
14
|
+
RootModel
|
|
15
|
+
)
|
|
16
|
+
else:
|
|
17
|
+
from pydantic import (
|
|
18
|
+
BaseModel,
|
|
19
|
+
Field
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
metamodel_version = "None"
|
|
23
|
+
version = "None"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class ConfiguredBaseModel(BaseModel):
|
|
27
|
+
model_config = ConfigDict(
|
|
28
|
+
validate_assignment = True,
|
|
29
|
+
validate_default = True,
|
|
30
|
+
extra = "allow",
|
|
31
|
+
arbitrary_types_allowed = True,
|
|
32
|
+
use_enum_values = True,
|
|
33
|
+
strict = False,
|
|
34
|
+
)
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class LinkMLMeta(RootModel):
|
|
41
|
+
root: Dict[str, Any] = {}
|
|
42
|
+
model_config = ConfigDict(frozen=True)
|
|
43
|
+
|
|
44
|
+
def __getattr__(self, key:str):
|
|
45
|
+
return getattr(self.root, key)
|
|
46
|
+
|
|
47
|
+
def __getitem__(self, key:str):
|
|
48
|
+
return self.root[key]
|
|
49
|
+
|
|
50
|
+
def __setitem__(self, key:str, value):
|
|
51
|
+
self.root[key] = value
|
|
52
|
+
|
|
53
|
+
def __contains__(self, key:str) -> bool:
|
|
54
|
+
return key in self.root
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class Variable(ConfiguredBaseModel):
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
a variable refers to a specific type of climate-related quantity or measurement that is simulated and stored in a data file. These variables represent key physical, chemical, or biological properties of the Earth system and are outputs from climate models.
|
|
61
|
+
Each variable captures a different aspect of the climate system, such as temperature, precipitation, sea level, radiation, or atmospheric composition.
|
|
62
|
+
Examples of Variables: tas: Near-surface air temperature (often measured at 2 meters above the surface) pr: Precipitation psl: Sea level pressure zg: Geopotential height rlut: Top-of-atmosphere longwave radiation siconc: Sea ice concentration co2: Atmospheric CO2 concentration
|
|
63
|
+
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
id: str
|
|
67
|
+
cmip_acronym: str
|
|
68
|
+
validation_method: str = Field(default = "list")
|
|
69
|
+
long_name: str
|
|
70
|
+
standard_name: Optional[str]
|
|
71
|
+
type: str
|
|
72
|
+
units: Optional[str]
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
# Model rebuild
|
|
76
|
+
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
77
|
+
Variable.model_rebuild()
|