hestia-earth-models 0.65.7__py3-none-any.whl → 0.65.9__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.
- hestia_earth/models/config/Cycle.json +381 -401
- hestia_earth/models/config/run-calculations.json +5 -5
- hestia_earth/models/config/trigger-calculations.json +1 -1
- hestia_earth/models/environmentalFootprintV3/soilQualityIndexLandTransformation.py +12 -4
- hestia_earth/models/hestia/landCover.py +2 -2
- hestia_earth/models/mocking/search-results.json +726 -726
- hestia_earth/models/site/management.py +6 -6
- hestia_earth/models/utils/lookup.py +3 -3
- hestia_earth/models/version.py +1 -1
- hestia_earth/orchestrator/models/__init__.py +2 -2
- {hestia_earth_models-0.65.7.dist-info → hestia_earth_models-0.65.9.dist-info}/METADATA +1 -1
- {hestia_earth_models-0.65.7.dist-info → hestia_earth_models-0.65.9.dist-info}/RECORD +18 -18
- tests/models/environmentalFootprintV3/test_soilQualityIndexLandTransformation.py +8 -15
- tests/models/hestia/test_landCover.py +2 -1
- tests/models/site/test_management.py +2 -1
- {hestia_earth_models-0.65.7.dist-info → hestia_earth_models-0.65.9.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.65.7.dist-info → hestia_earth_models-0.65.9.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.65.7.dist-info → hestia_earth_models-0.65.9.dist-info}/top_level.txt +0 -0
@@ -15,11 +15,6 @@
|
|
15
15
|
"key": "nested",
|
16
16
|
"type": "Site",
|
17
17
|
"stage": 1
|
18
|
-
},
|
19
|
-
{
|
20
|
-
"key": "nested",
|
21
|
-
"type": "ImpactAssessment",
|
22
|
-
"stage": 1
|
23
18
|
}
|
24
19
|
],
|
25
20
|
"stage-2": [
|
@@ -27,6 +22,11 @@
|
|
27
22
|
"key": "nested",
|
28
23
|
"type": "Site",
|
29
24
|
"stage": 2
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"key": "nested",
|
28
|
+
"type": "ImpactAssessment",
|
29
|
+
"stage": 1
|
30
30
|
}
|
31
31
|
]
|
32
32
|
},
|
@@ -25,7 +25,8 @@ REQUIREMENTS = {
|
|
25
25
|
{
|
26
26
|
"@type": "Indicator",
|
27
27
|
"term.termType": "resourceUse",
|
28
|
-
"term
|
28
|
+
"term.@id": ["landTransformation20YearAverageInputsProduction",
|
29
|
+
"landTransformation20YearAverageDuringCycle"],
|
29
30
|
"value": "> 0",
|
30
31
|
"landCover": {"@type": "Term", "term.termType": "landCover"},
|
31
32
|
"previousLandCover": {"@type": "Term", "term.termType": "landCover"}
|
@@ -74,6 +75,10 @@ def _run(transformations: List[dict]):
|
|
74
75
|
return _indicator(list_sum(values))
|
75
76
|
|
76
77
|
|
78
|
+
def _is_valid_indicator(indicator: dict) -> bool:
|
79
|
+
return indicator['term']['@id'] in REQUIREMENTS['ImpactAssessment']['emissionsResourceUse'][0]['term.@id']
|
80
|
+
|
81
|
+
|
77
82
|
def _should_run(impact_assessment: dict) -> Tuple[bool, list]:
|
78
83
|
resource_uses = filter_list_term_type(impact_assessment.get('emissionsResourceUse', []), TermTermType.RESOURCEUSE)
|
79
84
|
found_transformations = [
|
@@ -82,7 +87,9 @@ def _should_run(impact_assessment: dict) -> Tuple[bool, list]:
|
|
82
87
|
'land-cover-id-from': transformation_indicator.get('previousLandCover', {}).get("@id"),
|
83
88
|
'land-cover-id-to': transformation_indicator.get('landCover', {}).get("@id"),
|
84
89
|
'indicator-id': transformation_indicator.get('term', {}).get('@id', ''),
|
85
|
-
'
|
90
|
+
'indicator-is-valid': _is_valid_indicator(transformation_indicator),
|
91
|
+
'good-land-cover-term': all([bool(transformation_indicator.get('landCover')),
|
92
|
+
bool(transformation_indicator.get('previousLandCover'))]),
|
86
93
|
'country-id': get_country_id(impact_assessment),
|
87
94
|
'area-is-valid': _node_value(transformation_indicator) is not None and _node_value(
|
88
95
|
transformation_indicator) > 0,
|
@@ -112,19 +119,20 @@ def _should_run(impact_assessment: dict) -> Tuple[bool, list]:
|
|
112
119
|
valid_transformations_with_coef = [
|
113
120
|
t for t in found_transformations_with_coefficient if all([
|
114
121
|
t['area-is-valid'],
|
122
|
+
t['indicator-is-valid'],
|
115
123
|
t['factor-from'] is not None,
|
116
124
|
t['factor-to'] is not None
|
117
125
|
])
|
118
126
|
]
|
119
127
|
|
120
128
|
has_land_transformation_indicators = any([
|
121
|
-
indicator
|
129
|
+
_is_valid_indicator(indicator)
|
122
130
|
for indicator in resource_uses
|
123
131
|
])
|
124
132
|
|
125
133
|
all_transformations_are_valid = all(
|
126
134
|
[
|
127
|
-
all([t['area-is-valid'], t['good-land-cover-term']])
|
135
|
+
all([t['area-is-valid'], t['indicator-is-valid'], t['good-land-cover-term']])
|
128
136
|
for t in found_transformations_with_coefficient
|
129
137
|
]
|
130
138
|
) if found_transformations_with_coefficient else False
|
@@ -34,7 +34,7 @@ from .utils import (
|
|
34
34
|
crop_ipcc_land_use_category,
|
35
35
|
)
|
36
36
|
from . import MODEL
|
37
|
-
from ..utils.blank_node import _node_date, DatestrFormat
|
37
|
+
from ..utils.blank_node import _node_date, DatestrFormat, _gapfill_datestr, DatestrGapfillMode
|
38
38
|
from ..utils.constant import DAYS_IN_YEAR
|
39
39
|
|
40
40
|
REQUIREMENTS = {
|
@@ -697,7 +697,7 @@ def _collect_land_use_types(nodes: list) -> list:
|
|
697
697
|
{
|
698
698
|
"id": node.get("term", {}).get("@id"),
|
699
699
|
"land-use-type": _get_land_use_term_from_node(node),
|
700
|
-
"endDate": node.get("endDate")
|
700
|
+
"endDate": _gapfill_datestr(datestr=node.get("endDate"), mode=DatestrGapfillMode.END)[:10]
|
701
701
|
} for node in nodes
|
702
702
|
]
|
703
703
|
|