esgvoc 0.2.1__py3-none-any.whl → 0.4.0__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 +3 -1
- esgvoc/api/__init__.py +96 -72
- esgvoc/api/data_descriptors/__init__.py +18 -12
- esgvoc/api/data_descriptors/activity.py +8 -45
- esgvoc/api/data_descriptors/area_label.py +6 -0
- esgvoc/api/data_descriptors/branded_suffix.py +5 -0
- esgvoc/api/data_descriptors/branded_variable.py +5 -0
- esgvoc/api/data_descriptors/consortium.py +16 -56
- esgvoc/api/data_descriptors/data_descriptor.py +106 -0
- esgvoc/api/data_descriptors/date.py +3 -46
- esgvoc/api/data_descriptors/directory_date.py +3 -46
- esgvoc/api/data_descriptors/experiment.py +19 -54
- esgvoc/api/data_descriptors/forcing_index.py +3 -45
- esgvoc/api/data_descriptors/frequency.py +6 -43
- esgvoc/api/data_descriptors/grid_label.py +6 -44
- esgvoc/api/data_descriptors/horizontal_label.py +6 -0
- esgvoc/api/data_descriptors/initialisation_index.py +3 -44
- esgvoc/api/data_descriptors/institution.py +11 -54
- esgvoc/api/data_descriptors/license.py +4 -44
- esgvoc/api/data_descriptors/mip_era.py +6 -44
- esgvoc/api/data_descriptors/model_component.py +7 -45
- esgvoc/api/data_descriptors/organisation.py +3 -40
- esgvoc/api/data_descriptors/physic_index.py +3 -45
- esgvoc/api/data_descriptors/product.py +4 -43
- esgvoc/api/data_descriptors/realisation_index.py +3 -44
- esgvoc/api/data_descriptors/realm.py +4 -42
- esgvoc/api/data_descriptors/resolution.py +6 -44
- esgvoc/api/data_descriptors/source.py +18 -53
- esgvoc/api/data_descriptors/source_type.py +3 -41
- esgvoc/api/data_descriptors/sub_experiment.py +3 -41
- esgvoc/api/data_descriptors/table.py +6 -48
- esgvoc/api/data_descriptors/temporal_label.py +6 -0
- esgvoc/api/data_descriptors/time_range.py +3 -27
- esgvoc/api/data_descriptors/variable.py +13 -71
- esgvoc/api/data_descriptors/variant_label.py +3 -47
- esgvoc/api/data_descriptors/vertical_label.py +5 -0
- esgvoc/api/project_specs.py +3 -2
- esgvoc/api/projects.py +727 -446
- esgvoc/api/py.typed +0 -0
- esgvoc/api/report.py +29 -16
- esgvoc/api/search.py +140 -95
- esgvoc/api/universe.py +362 -156
- esgvoc/apps/__init__.py +3 -4
- esgvoc/apps/drs/constants.py +1 -1
- esgvoc/apps/drs/generator.py +185 -198
- esgvoc/apps/drs/report.py +272 -136
- esgvoc/apps/drs/validator.py +132 -145
- esgvoc/apps/py.typed +0 -0
- esgvoc/cli/drs.py +32 -21
- esgvoc/cli/get.py +35 -31
- esgvoc/cli/install.py +11 -8
- esgvoc/cli/main.py +0 -2
- esgvoc/cli/status.py +5 -5
- esgvoc/cli/valid.py +40 -40
- esgvoc/core/constants.py +1 -1
- esgvoc/core/db/__init__.py +2 -4
- esgvoc/core/db/connection.py +5 -3
- esgvoc/core/db/models/project.py +50 -8
- esgvoc/core/db/models/universe.py +51 -12
- esgvoc/core/db/project_ingestion.py +60 -46
- esgvoc/core/db/universe_ingestion.py +58 -29
- esgvoc/core/exceptions.py +33 -0
- esgvoc/core/logging_handler.py +1 -1
- esgvoc/core/repo_fetcher.py +4 -3
- esgvoc/core/service/__init__.py +37 -5
- esgvoc/core/service/configuration/config_manager.py +188 -0
- esgvoc/core/service/configuration/setting.py +88 -0
- esgvoc/core/service/state.py +49 -32
- {esgvoc-0.2.1.dist-info → esgvoc-0.4.0.dist-info}/METADATA +34 -3
- esgvoc-0.4.0.dist-info/RECORD +80 -0
- esgvoc/api/_utils.py +0 -39
- esgvoc/cli/config.py +0 -82
- esgvoc/core/service/settings.py +0 -73
- esgvoc/core/service/settings.toml +0 -17
- esgvoc/core/service/settings_default.toml +0 -17
- esgvoc-0.2.1.dist-info/RECORD +0 -73
- {esgvoc-0.2.1.dist-info → esgvoc-0.4.0.dist-info}/WHEEL +0 -0
- {esgvoc-0.2.1.dist-info → esgvoc-0.4.0.dist-info}/entry_points.txt +0 -0
- {esgvoc-0.2.1.dist-info → esgvoc-0.4.0.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -1,46 +1,5 @@
|
|
|
1
|
+
from esgvoc.api.data_descriptors.data_descriptor import PatternTermDataDescriptor
|
|
1
2
|
|
|
2
3
|
|
|
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()
|
|
4
|
+
class RealisationIndex(PatternTermDataDescriptor):
|
|
5
|
+
pass
|
|
@@ -1,44 +1,6 @@
|
|
|
1
|
+
from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
|
|
1
2
|
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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()
|
|
4
|
+
class Realm(PlainTermDataDescriptor):
|
|
5
|
+
description: str
|
|
6
|
+
name: str
|
|
@@ -1,46 +1,8 @@
|
|
|
1
|
+
from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
|
|
1
2
|
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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()
|
|
4
|
+
class Resolution(PlainTermDataDescriptor):
|
|
5
|
+
description: str
|
|
6
|
+
value: str
|
|
7
|
+
name: str
|
|
8
|
+
unit: str
|
|
@@ -1,57 +1,22 @@
|
|
|
1
|
+
from pydantic import Field
|
|
2
|
+
from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
|
|
1
3
|
|
|
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
4
|
|
|
21
|
-
|
|
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):
|
|
5
|
+
class Source(PlainTermDataDescriptor):
|
|
40
6
|
"""
|
|
41
|
-
|
|
7
|
+
A 'source' refers to a numerical representations of the Earth's climate system. They simulate \
|
|
8
|
+
the interactions between the atmosphere, oceans, land surface, and ice. These models are based \
|
|
9
|
+
on fundamental physical, chemical, and biological processes and are used to understand past, \
|
|
10
|
+
present, and future climate conditions. Each source or model is typically associated with a \
|
|
11
|
+
specific research institution, center, or group. For instance, models like 'EC-Earth' are \
|
|
12
|
+
developed by a consortium of European institutes, while 'GFDL-CM4' is developed by the \
|
|
13
|
+
Geophysical Fluid Dynamics Laboratory (GFDL) in the United States.
|
|
42
14
|
"""
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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()
|
|
15
|
+
activity_participation: list[str]|None
|
|
16
|
+
cohort: list[str] = Field(default_factory=list)
|
|
17
|
+
organisation_id: list[str] = Field(default_factory=list)
|
|
18
|
+
label: str
|
|
19
|
+
label_extended: str|None
|
|
20
|
+
license: dict = Field(default_factory=dict)
|
|
21
|
+
model_component: dict|None
|
|
22
|
+
release_year: int|None
|
|
@@ -1,43 +1,5 @@
|
|
|
1
|
+
from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
|
|
1
2
|
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
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()
|
|
4
|
+
class SourceType(PlainTermDataDescriptor):
|
|
5
|
+
description: str
|
|
@@ -1,43 +1,5 @@
|
|
|
1
|
+
from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
|
|
1
2
|
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
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()
|
|
4
|
+
class SubExperiment(PlainTermDataDescriptor):
|
|
5
|
+
description: str
|
|
@@ -1,50 +1,8 @@
|
|
|
1
|
+
from pydantic import Field
|
|
2
|
+
from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
|
|
1
3
|
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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()
|
|
5
|
+
class Table(PlainTermDataDescriptor):
|
|
6
|
+
product: str|None
|
|
7
|
+
table_date: str|None
|
|
8
|
+
variable_entry: list[str] = Field(default_factory=list)
|
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
from
|
|
1
|
+
from esgvoc.api.data_descriptors.data_descriptor import CompositeTermDataDescriptor
|
|
2
2
|
|
|
3
|
-
class
|
|
4
|
-
|
|
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()
|
|
3
|
+
class TimeRange(CompositeTermDataDescriptor):
|
|
4
|
+
description: str
|
|
@@ -1,77 +1,19 @@
|
|
|
1
|
+
from pydantic import Field
|
|
2
|
+
from esgvoc.api.data_descriptors.data_descriptor import PlainTermDataDescriptor
|
|
1
3
|
|
|
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
4
|
|
|
22
|
-
|
|
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):
|
|
5
|
+
class Variable(PlainTermDataDescriptor):
|
|
58
6
|
"""
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
7
|
+
A variable refers to a specific type of climate-related quantity or measurement that is \
|
|
8
|
+
simulated and stored in a data file. These variables represent key physical, chemical, or \
|
|
9
|
+
biological properties of the Earth system and are outputs from climate models.
|
|
10
|
+
Each variable captures a different aspect of the climate system, such as temperature, \
|
|
11
|
+
precipitation, sea level, radiation, or atmospheric composition.
|
|
12
|
+
Examples of Variables: tas: Near-surface air temperature (often measured at 2 meters above \
|
|
13
|
+
the surface) pr: Precipitation psl: Sea level pressure zg: Geopotential height rlut: \
|
|
14
|
+
Top-of-atmosphere longwave radiation siconc: Sea ice concentration co2: Atmospheric CO2 concentration
|
|
64
15
|
"""
|
|
65
|
-
|
|
66
|
-
id: str
|
|
67
|
-
cmip_acronym: str
|
|
68
16
|
validation_method: str = Field(default = "list")
|
|
69
17
|
long_name: str
|
|
70
|
-
standard_name:
|
|
71
|
-
|
|
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()
|
|
18
|
+
standard_name: str|None
|
|
19
|
+
units: str|None
|
|
@@ -1,49 +1,5 @@
|
|
|
1
|
+
from esgvoc.api.data_descriptors.data_descriptor import CompositeTermDataDescriptor
|
|
1
2
|
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
List
|
|
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
|
-
class Part(ConfiguredBaseModel):
|
|
34
|
-
id: str
|
|
35
|
-
type : str
|
|
36
|
-
is_required : bool
|
|
37
|
-
|
|
38
|
-
class VariantLabel(ConfiguredBaseModel):
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
id: str
|
|
42
|
-
separator: str
|
|
43
|
-
type: str
|
|
44
|
-
parts: List[Part]
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
# Model rebuild
|
|
48
|
-
# see https://pydantic-docs.helpmanual.io/usage/models/#rebuilding-a-model
|
|
49
|
-
VariantLabel.model_rebuild()
|
|
4
|
+
class VariantLabel(CompositeTermDataDescriptor):
|
|
5
|
+
description: str
|
esgvoc/api/project_specs.py
CHANGED
|
@@ -64,11 +64,12 @@ class DrsSpecification(BaseModel):
|
|
|
64
64
|
"""The type of the specification."""
|
|
65
65
|
separator: str
|
|
66
66
|
"""The textual separator string or character."""
|
|
67
|
-
properties: dict|None = None
|
|
67
|
+
properties: dict | None = None
|
|
68
68
|
"""The other specifications (e.g., file name extension for file name DRS specification)."""
|
|
69
69
|
parts: list[DrsPart]
|
|
70
70
|
"""The parts of the DRS specification."""
|
|
71
71
|
|
|
72
|
+
|
|
72
73
|
class ProjectSpecs(BaseModel):
|
|
73
74
|
"""
|
|
74
75
|
A project specifications.
|
|
@@ -79,4 +80,4 @@ class ProjectSpecs(BaseModel):
|
|
|
79
80
|
"""The description of the project."""
|
|
80
81
|
drs_specs: list[DrsSpecification]
|
|
81
82
|
"""The DRS specifications of the project (directory, file name and dataset id."""
|
|
82
|
-
model_config = ConfigDict(extra
|
|
83
|
+
model_config = ConfigDict(extra="allow")
|