hestia-earth-models 0.65.5__py3-none-any.whl → 0.65.7__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 hestia-earth-models might be problematic. Click here for more details.
- hestia_earth/models/cml2001Baseline/abioticResourceDepletionFossilFuels.py +9 -5
- hestia_earth/models/config/Cycle.json +2193 -0
- hestia_earth/models/config/ImpactAssessment.json +2041 -0
- hestia_earth/models/config/Site.json +471 -0
- hestia_earth/models/config/__init__.py +71 -0
- hestia_earth/models/config/run-calculations.json +42 -0
- hestia_earth/models/config/trigger-calculations.json +43 -0
- hestia_earth/models/hestia/landCover.py +70 -22
- hestia_earth/models/ipcc2019/animal/hoursWorkedPerDay.py +38 -0
- hestia_earth/models/mocking/search-results.json +833 -829
- hestia_earth/models/site/management.py +82 -22
- hestia_earth/models/utils/crop.py +5 -1
- hestia_earth/models/version.py +1 -1
- hestia_earth/orchestrator/__init__.py +40 -0
- hestia_earth/orchestrator/log.py +62 -0
- hestia_earth/orchestrator/models/__init__.py +118 -0
- hestia_earth/orchestrator/models/emissions/__init__.py +0 -0
- hestia_earth/orchestrator/models/emissions/deleted.py +15 -0
- hestia_earth/orchestrator/models/transformations.py +103 -0
- hestia_earth/orchestrator/strategies/__init__.py +0 -0
- hestia_earth/orchestrator/strategies/merge/__init__.py +42 -0
- hestia_earth/orchestrator/strategies/merge/merge_append.py +29 -0
- hestia_earth/orchestrator/strategies/merge/merge_default.py +1 -0
- hestia_earth/orchestrator/strategies/merge/merge_list.py +103 -0
- hestia_earth/orchestrator/strategies/merge/merge_node.py +59 -0
- hestia_earth/orchestrator/strategies/run/__init__.py +8 -0
- hestia_earth/orchestrator/strategies/run/add_blank_node_if_missing.py +85 -0
- hestia_earth/orchestrator/strategies/run/add_key_if_missing.py +9 -0
- hestia_earth/orchestrator/strategies/run/always.py +6 -0
- hestia_earth/orchestrator/utils.py +116 -0
- {hestia_earth_models-0.65.5.dist-info → hestia_earth_models-0.65.7.dist-info}/METADATA +27 -5
- {hestia_earth_models-0.65.5.dist-info → hestia_earth_models-0.65.7.dist-info}/RECORD +57 -13
- tests/models/cml2001Baseline/test_abioticResourceDepletionFossilFuels.py +1 -1
- tests/models/hestia/test_landCover.py +2 -1
- tests/models/ipcc2019/animal/test_hoursWorkedPerDay.py +22 -0
- tests/models/test_config.py +115 -0
- tests/orchestrator/__init__.py +0 -0
- tests/orchestrator/models/__init__.py +0 -0
- tests/orchestrator/models/emissions/__init__.py +0 -0
- tests/orchestrator/models/emissions/test_deleted.py +21 -0
- tests/orchestrator/models/test_transformations.py +29 -0
- tests/orchestrator/strategies/__init__.py +0 -0
- tests/orchestrator/strategies/merge/__init__.py +0 -0
- tests/orchestrator/strategies/merge/test_merge_append.py +33 -0
- tests/orchestrator/strategies/merge/test_merge_default.py +7 -0
- tests/orchestrator/strategies/merge/test_merge_list.py +327 -0
- tests/orchestrator/strategies/merge/test_merge_node.py +95 -0
- tests/orchestrator/strategies/run/__init__.py +0 -0
- tests/orchestrator/strategies/run/test_add_blank_node_if_missing.py +114 -0
- tests/orchestrator/strategies/run/test_add_key_if_missing.py +14 -0
- tests/orchestrator/strategies/run/test_always.py +5 -0
- tests/orchestrator/test_models.py +69 -0
- tests/orchestrator/test_orchestrator.py +27 -0
- tests/orchestrator/test_utils.py +109 -0
- {hestia_earth_models-0.65.5.dist-info → hestia_earth_models-0.65.7.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.65.5.dist-info → hestia_earth_models-0.65.7.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.65.5.dist-info → hestia_earth_models-0.65.7.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import pydash
|
|
2
|
+
from hestia_earth.schema import UNIQUENESS_FIELDS
|
|
3
|
+
|
|
4
|
+
from hestia_earth.orchestrator.utils import _non_empty_list, update_node_version
|
|
5
|
+
from .merge_node import merge as merge_node
|
|
6
|
+
|
|
7
|
+
_METHOD_MODEL_KEY = 'methodModel.@id'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _matching_properties(model: dict, node_type: str):
|
|
11
|
+
return UNIQUENESS_FIELDS.get(node_type, {}).get(model.get('key'), [])
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _has_property(value: dict, key: str):
|
|
15
|
+
keys = key.split('.')
|
|
16
|
+
is_list = len(keys) >= 2 and isinstance(pydash.objects.get(value, keys[0]), list)
|
|
17
|
+
values = [
|
|
18
|
+
pydash.objects.get(v, '.'.join(keys[1:])) for v in pydash.objects.get(value, keys[0])
|
|
19
|
+
] if is_list else [
|
|
20
|
+
pydash.objects.get(value, key)
|
|
21
|
+
]
|
|
22
|
+
return all([v is not None for v in values])
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _values_have_property(values: list, key: str): return any([_has_property(v, key) for v in values])
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _match_list_el(source: list, dest: list, key: str):
|
|
29
|
+
src_value = sorted(_non_empty_list([pydash.objects.get(x, key) for x in source]))
|
|
30
|
+
dest_value = sorted(_non_empty_list([pydash.objects.get(x, key) for x in dest]))
|
|
31
|
+
return src_value == dest_value
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _match_el(source: dict, dest: dict, keys: list):
|
|
35
|
+
def match(key: str):
|
|
36
|
+
keys = key.split('.')
|
|
37
|
+
src_value = pydash.objects.get(source, key)
|
|
38
|
+
dest_value = pydash.objects.get(dest, key)
|
|
39
|
+
is_list = len(keys) >= 2 and (
|
|
40
|
+
isinstance(pydash.objects.get(source, keys[0]), list) or
|
|
41
|
+
isinstance(pydash.objects.get(dest, keys[0]), list)
|
|
42
|
+
)
|
|
43
|
+
return _match_list_el(
|
|
44
|
+
pydash.objects.get(source, keys[0], []),
|
|
45
|
+
pydash.objects.get(dest, keys[0], []),
|
|
46
|
+
'.'.join(keys[1:])
|
|
47
|
+
) if is_list else src_value == dest_value
|
|
48
|
+
|
|
49
|
+
source_properties = [p for p in keys if _has_property(source, p)]
|
|
50
|
+
dest_properties = [p for p in keys if _has_property(dest, p)]
|
|
51
|
+
|
|
52
|
+
return all(map(match, source_properties)) if source_properties == dest_properties else False
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def _handle_local_property(values: list, properties: list, local_id: str):
|
|
56
|
+
# Handle "impactAssessment.@id" if present in the data
|
|
57
|
+
existing_id = local_id.replace('.id', '.@id')
|
|
58
|
+
|
|
59
|
+
if local_id in properties:
|
|
60
|
+
# remove if not used
|
|
61
|
+
if not _values_have_property(values, local_id):
|
|
62
|
+
properties.remove(local_id)
|
|
63
|
+
|
|
64
|
+
# add if used
|
|
65
|
+
if _values_have_property(values, existing_id):
|
|
66
|
+
properties.append(existing_id)
|
|
67
|
+
|
|
68
|
+
return properties
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _find_match_el_index(values: list, el: dict, same_methodModel: bool, model: dict, node_type: str):
|
|
72
|
+
"""
|
|
73
|
+
Find an element in the values that match the new element, based on the unique properties.
|
|
74
|
+
To find a matching element:
|
|
75
|
+
|
|
76
|
+
1. Update list of properties to handle `methodModel.@id` and `impactAssessment.@id`
|
|
77
|
+
2. Filter values that have the same unique properties as el
|
|
78
|
+
3. Make sure all shared unique properties are identical
|
|
79
|
+
"""
|
|
80
|
+
properties = _matching_properties(model, node_type)
|
|
81
|
+
properties = list(set(properties + [_METHOD_MODEL_KEY])) if same_methodModel else [
|
|
82
|
+
p for p in properties if p != _METHOD_MODEL_KEY
|
|
83
|
+
]
|
|
84
|
+
properties = _handle_local_property(values, properties, 'impactAssessment.id')
|
|
85
|
+
|
|
86
|
+
return next((i for i in range(len(values)) if _match_el(values[i], el, properties)), None) if properties else None
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def merge(source: list, merge_with: list, version: str, model: dict = {}, merge_args: dict = {}, node_type: str = ''):
|
|
90
|
+
source = source if source is not None else []
|
|
91
|
+
|
|
92
|
+
# only merge node if it has the same `methodModel`
|
|
93
|
+
same_methodModel = merge_args.get('sameMethodModel', False)
|
|
94
|
+
# only merge if the
|
|
95
|
+
skip_same_term = merge_args.get('skipSameTerm', False)
|
|
96
|
+
|
|
97
|
+
for el in _non_empty_list(merge_with):
|
|
98
|
+
source_index = _find_match_el_index(source, el, same_methodModel, model, node_type)
|
|
99
|
+
if source_index is None:
|
|
100
|
+
source.append(update_node_version(version, el))
|
|
101
|
+
elif not skip_same_term:
|
|
102
|
+
source[source_index] = merge_node(source[source_index], el, version, model, merge_args)
|
|
103
|
+
return source
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import pydash
|
|
2
|
+
from hestia_earth.schema import EmissionMethodTier
|
|
3
|
+
|
|
4
|
+
from hestia_earth.orchestrator.log import logger, logShouldMerge
|
|
5
|
+
from hestia_earth.orchestrator.utils import update_node_version, _average
|
|
6
|
+
|
|
7
|
+
_METHOD_TIER_ORDER = [
|
|
8
|
+
EmissionMethodTier.NOT_RELEVANT.value,
|
|
9
|
+
EmissionMethodTier.TIER_1.value,
|
|
10
|
+
EmissionMethodTier.TIER_2.value,
|
|
11
|
+
EmissionMethodTier.TIER_3.value,
|
|
12
|
+
EmissionMethodTier.MEASURED.value,
|
|
13
|
+
EmissionMethodTier.BACKGROUND.value
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _has_threshold_diff(source: dict, dest: dict, key: str, threshold: float):
|
|
18
|
+
term_id = dest.get('term', {}).get('@id', dest.get('@id'))
|
|
19
|
+
source_value = _average(source.get(key), None)
|
|
20
|
+
dest_value = _average(dest.get(key), None)
|
|
21
|
+
delta = None if any([source_value is None, dest_value is None]) else (
|
|
22
|
+
abs(source_value - dest_value) / (1 if source_value == 0 else source_value)
|
|
23
|
+
)
|
|
24
|
+
should_merge = source_value is None or (delta is not None and delta > threshold)
|
|
25
|
+
logger.debug('merge %s for %s with threshold=%s, delta=%s: %s', key, term_id, threshold, delta, should_merge)
|
|
26
|
+
return should_merge
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _should_merge_threshold(source: dict, dest: dict, args: dict):
|
|
30
|
+
[key, threshold] = args.get('replaceThreshold', [None, 0])
|
|
31
|
+
return True if key is None else _has_threshold_diff(source, dest, key, threshold)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _should_merge_lower_tier(source: dict, dest: dict, args: dict):
|
|
35
|
+
source_tier = _METHOD_TIER_ORDER.index(source.get('methodTier', _METHOD_TIER_ORDER[0]))
|
|
36
|
+
dest_tier = _METHOD_TIER_ORDER.index(dest.get('methodTier', _METHOD_TIER_ORDER[-1]))
|
|
37
|
+
term_id = dest.get('term', {}).get('@id', dest.get('@id'))
|
|
38
|
+
should_merge = args.get('replaceLowerTier', False) or dest_tier >= source_tier
|
|
39
|
+
logger.debug('merge for %s with original tier=%s, new tier=%s: %s',
|
|
40
|
+
term_id, source.get('methodTier'), dest.get('methodTier'), should_merge)
|
|
41
|
+
return should_merge
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
_MERGE_FROM_ARGS = {
|
|
45
|
+
'replaceThreshold': _should_merge_threshold,
|
|
46
|
+
'replaceLowerTier': _should_merge_lower_tier
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def merge(source: dict, dest: dict, version: str, model: dict = {}, merge_args: dict = {}, *args):
|
|
51
|
+
merge_args = {
|
|
52
|
+
key: func(source, dest, merge_args) for key, func in _MERGE_FROM_ARGS.items()
|
|
53
|
+
} if source is not None else {}
|
|
54
|
+
term_id = dest.get('term', {}).get('@id', dest.get('@id'))
|
|
55
|
+
|
|
56
|
+
should_merge = all([v for _k, v in merge_args.items()])
|
|
57
|
+
logShouldMerge(source, model.get('model'), term_id, should_merge, key=model.get('key'), value=term_id, **merge_args)
|
|
58
|
+
|
|
59
|
+
return update_node_version(version, pydash.objects.merge({}, source, dest), source) if should_merge else source
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import importlib
|
|
2
|
+
|
|
3
|
+
from hestia_earth.orchestrator.utils import get_required_model_param
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def should_run(data: dict, model: dict):
|
|
7
|
+
strategy = get_required_model_param(model, 'runStrategy')
|
|
8
|
+
return importlib.import_module(f"hestia_earth.orchestrator.strategies.run.{strategy}").should_run(data, model)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
from hestia_earth.utils.lookup import download_lookup, get_table_value, column_name
|
|
2
|
+
from hestia_earth.utils.api import download_hestia
|
|
3
|
+
|
|
4
|
+
from hestia_earth.orchestrator.log import debugValues, logShouldRun
|
|
5
|
+
from hestia_earth.orchestrator.utils import get_required_model_param, find_term_match
|
|
6
|
+
|
|
7
|
+
_ALLOW_ALL = 'all'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _lookup_values(term: dict, column: str):
|
|
11
|
+
term_id = term.get('@id')
|
|
12
|
+
term_type = term.get('termType')
|
|
13
|
+
lookup = download_lookup(f"{term_type}.csv")
|
|
14
|
+
values = get_table_value(lookup, 'termid', term_id, column_name(column))
|
|
15
|
+
return (values or _ALLOW_ALL).split(';')
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _is_node_type_allowed(data: dict, term_id: str):
|
|
19
|
+
node_type = data.get('@type', data.get('type'))
|
|
20
|
+
term = download_hestia(term_id)
|
|
21
|
+
allowed_types = _lookup_values(term, 'typesAllowed') if term else [_ALLOW_ALL]
|
|
22
|
+
return True if _ALLOW_ALL in allowed_types or not node_type else node_type in allowed_types
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _run_required(data: dict, model: str, term_id: str):
|
|
26
|
+
node_type_allowed = _is_node_type_allowed(data, term_id)
|
|
27
|
+
|
|
28
|
+
run_required = all([node_type_allowed])
|
|
29
|
+
debugValues(data, model=model, term=term_id,
|
|
30
|
+
run_required=run_required,
|
|
31
|
+
node_type_allowed=node_type_allowed)
|
|
32
|
+
return run_required
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
_RUN_FROM_ARGS = {
|
|
36
|
+
'runNonAddedTerm': lambda node: 'term' not in node.get('added', []),
|
|
37
|
+
'runNonMeasured': lambda node: node.get('methodTier') != 'measured'
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _is_empty(node: dict, skip_empty_value: bool = False):
|
|
42
|
+
return node is None or all([
|
|
43
|
+
not skip_empty_value,
|
|
44
|
+
node.get('value') is None or node.get('value') == []
|
|
45
|
+
])
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _run_aggregated(data: dict, skip_aggregated: bool = False):
|
|
49
|
+
return not data.get('aggregated', False) or not skip_aggregated
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _is_0_emission(node: dict):
|
|
53
|
+
# emissions are set to 0 when not required to run, but we should still run for every model
|
|
54
|
+
return node is not None and all([
|
|
55
|
+
node.get('@type', node.get('type')) == 'Emission',
|
|
56
|
+
'value' in node.get('added', [])
|
|
57
|
+
]) and node.get('value', [])[0] == 0
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def should_run(data: dict, model: dict):
|
|
61
|
+
key = get_required_model_param(model, 'key')
|
|
62
|
+
term_id = get_required_model_param(model, 'value')
|
|
63
|
+
args = model.get('runArgs', {})
|
|
64
|
+
node = find_term_match(data.get(key, []), args.get('termId', term_id), None)
|
|
65
|
+
|
|
66
|
+
# run if: value is empty or force run from args
|
|
67
|
+
is_empty = _is_empty(node, args.get('skipEmptyValue', False))
|
|
68
|
+
is_0_emission = _is_0_emission(node)
|
|
69
|
+
run_is_aggregated = _run_aggregated(data, args.get('skipAggregated', False))
|
|
70
|
+
run_args = {
|
|
71
|
+
key: func(node) for key, func in _RUN_FROM_ARGS.items() if node and args.get(key, False) is True
|
|
72
|
+
}
|
|
73
|
+
run = any([
|
|
74
|
+
is_empty,
|
|
75
|
+
is_0_emission,
|
|
76
|
+
(len(run_args.keys()) > 0 and all([v for _k, v in run_args.items()]))
|
|
77
|
+
]) and _run_required(data, model.get('model'), term_id) and run_is_aggregated
|
|
78
|
+
|
|
79
|
+
logShouldRun(data, model.get('model'), term_id, run, key=key, value=term_id,
|
|
80
|
+
is_empty=is_empty,
|
|
81
|
+
is_0_emission=is_0_emission,
|
|
82
|
+
run_is_aggregated=run_is_aggregated,
|
|
83
|
+
**run_args)
|
|
84
|
+
|
|
85
|
+
return run
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from hestia_earth.orchestrator.log import logShouldRun
|
|
2
|
+
from hestia_earth.orchestrator.utils import get_required_model_param
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def should_run(data: dict, model: dict):
|
|
6
|
+
key = get_required_model_param(model, 'key')
|
|
7
|
+
run = data.get(key) is None
|
|
8
|
+
logShouldRun(data, model.get('model'), None, run, key=key, value=model.get('value'))
|
|
9
|
+
return run
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
from typing import Union
|
|
2
|
+
import re
|
|
3
|
+
from statistics import mean
|
|
4
|
+
from functools import reduce
|
|
5
|
+
|
|
6
|
+
EXCLUDED_VERSION_KEYS = [
|
|
7
|
+
'@type'
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def get_required_model_param(model, key: str):
|
|
12
|
+
if key not in model:
|
|
13
|
+
raise KeyError(f"Missing required '{key}' in model")
|
|
14
|
+
return model[key]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _lowercase(string): return str(string).lower()
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _snakecase(string):
|
|
21
|
+
string = re.sub(r"[\-\.\s]", '_', str(string))
|
|
22
|
+
if not string:
|
|
23
|
+
return string
|
|
24
|
+
return _lowercase(string[0]) + re.sub(r"[A-Z]", lambda matched: '_' + _lowercase(matched.group(0)), string[1:])
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _average(value, default=0): return mean(value) if value is not None and isinstance(value, list) else default
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def find_term_match(values: list, term_id: str, default_val={}):
|
|
31
|
+
return next((v for v in values if v.get('term', {}).get('@id') == term_id), default_val)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _non_empty(value): return value != '' and value is not None and value != []
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _non_empty_list(values):
|
|
38
|
+
return list(filter(_non_empty, values)) if isinstance(values, list) else _non_empty(values)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _filter_by_keys(values, keys: list): return {key: values[key] for key in keys if values.get(key) is not None}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
_SKIP_KEYS = ['added', 'addedVersion', 'updated', 'updatedVersion']
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _update_key_version(version: str, node: dict, key: str, is_update=True):
|
|
48
|
+
def update(field: str):
|
|
49
|
+
if key not in _SKIP_KEYS:
|
|
50
|
+
if key in node.get(field, []):
|
|
51
|
+
node.get(f"{field}Version")[node[field].index(key)] = version
|
|
52
|
+
else:
|
|
53
|
+
node[field] = node.get(field, []) + [key]
|
|
54
|
+
node[f"{field}Version"] = node.get(f"{field}Version", []) + [version]
|
|
55
|
+
return node
|
|
56
|
+
|
|
57
|
+
return update('updated' if is_update else 'added')
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def _safe_deep_update_list_version(version: str, new_data: list, prev_data: list, index: int):
|
|
61
|
+
try:
|
|
62
|
+
new_data[index] = update_node_version(version, new_data[index], prev_data[index])
|
|
63
|
+
except Exception:
|
|
64
|
+
try:
|
|
65
|
+
# try again with an empty value as old data
|
|
66
|
+
new_data[index] = update_node_version(version, new_data[index], {})
|
|
67
|
+
except Exception:
|
|
68
|
+
pass
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _deep_update_node_version(version: str, new_data: Union[dict, list], prev_data: Union[dict, list]):
|
|
72
|
+
if isinstance(new_data, list) and all([isinstance(v, dict) for v in new_data]):
|
|
73
|
+
for index, v in enumerate(new_data):
|
|
74
|
+
_safe_deep_update_list_version(version, new_data, prev_data, index)
|
|
75
|
+
if isinstance(new_data, dict):
|
|
76
|
+
new_data = update_node_version(version, new_data, prev_data)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def update_node_version(version: str, new_data: dict, prev_data: dict = {}):
|
|
80
|
+
"""
|
|
81
|
+
Update the node `added` and `updated` fields by comparing the previous fields with the new ones.
|
|
82
|
+
The version of the model adding/updating the fields will be used by default.
|
|
83
|
+
|
|
84
|
+
Parameters
|
|
85
|
+
----------
|
|
86
|
+
version : str
|
|
87
|
+
The version to use in the `addedVersion` or `updatedVersion` field.
|
|
88
|
+
new_data : dict
|
|
89
|
+
The new data.
|
|
90
|
+
prev_data : dict
|
|
91
|
+
Optional - the previous data. If not set, a default empty dictionary will be used as previous value,
|
|
92
|
+
so every field will be marked as "added".
|
|
93
|
+
|
|
94
|
+
Returns
|
|
95
|
+
-------
|
|
96
|
+
dict
|
|
97
|
+
The new data with additional `added`, `addedVersion`, `updated` and `updatedVersion` fields.
|
|
98
|
+
"""
|
|
99
|
+
def update(prev, key):
|
|
100
|
+
# TODO: do a better comparison
|
|
101
|
+
is_updated = key in prev_data and prev_data.get(key) != new_data.get(key)
|
|
102
|
+
is_added = key not in prev_data
|
|
103
|
+
value = _update_key_version(version, prev, key, is_updated) if is_updated or is_added else prev
|
|
104
|
+
_deep_update_node_version(version, new_data.get(key), prev_data.get(key))
|
|
105
|
+
return value
|
|
106
|
+
|
|
107
|
+
keys = [key for key in new_data.keys() if key not in EXCLUDED_VERSION_KEYS]
|
|
108
|
+
return new_data if any([
|
|
109
|
+
prev_data is None,
|
|
110
|
+
# do not add fields on Term
|
|
111
|
+
(prev_data or {}).get('@type') == 'Term',
|
|
112
|
+
new_data.get('@type') == 'Term'
|
|
113
|
+
]) else reduce(update, keys, new_data)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def new_practice(term: dict): return {'@type': 'Practice', 'term': term}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hestia-earth-models
|
|
3
|
-
Version: 0.65.
|
|
3
|
+
Version: 0.65.7
|
|
4
4
|
Summary: HESTIA's set of modules for filling gaps in the activity data using external datasets (e.g. populating soil properties with a geospatial dataset using provided coordinates) and internal lookups (e.g. populating machinery use from fuel use). Includes rules for when gaps should be filled versus not (e.g. never gap fill yield, gap fill crop residue if yield provided etc.).
|
|
5
5
|
Home-page: https://gitlab.com/hestia-earth/hestia-engine-models
|
|
6
6
|
Author: HESTIA Team
|
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3.6
|
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: hestia-earth-schema==30.*
|
|
15
|
-
Requires-Dist: hestia-earth-utils>=0.13.
|
|
15
|
+
Requires-Dist: hestia-earth-utils>=0.13.16
|
|
16
16
|
Requires-Dist: python-dateutil>=2.8.1
|
|
17
17
|
Requires-Dist: CurrencyConverter==0.16.8
|
|
18
18
|
Requires-Dist: haversine>=2.7.0
|
|
@@ -49,10 +49,14 @@ WEB_URL=https://hestia.earth
|
|
|
49
49
|
```python
|
|
50
50
|
from hestia_earth.models.pooreNemecek2018 import run
|
|
51
51
|
|
|
52
|
+
cycle_data = {"@type": "Cycle", ...}
|
|
52
53
|
# cycle is a JSONLD node Cycle
|
|
53
|
-
run('no3ToGroundwaterSoilFlux', cycle_data)
|
|
54
|
+
result = run('no3ToGroundwaterSoilFlux', cycle_data)
|
|
55
|
+
print(result)
|
|
54
56
|
```
|
|
55
57
|
|
|
58
|
+
This will display only the result of the `no3ToGroundwaterSoilFlux` model (Emission).
|
|
59
|
+
|
|
56
60
|
Additionally, to reduce the number of queries to the HESTIA API and run the models faster, prefetching can be enabled:
|
|
57
61
|
```python
|
|
58
62
|
from hestia_earth.models.preload_requests import enable_preload
|
|
@@ -60,13 +64,31 @@ from hestia_earth.models.preload_requests import enable_preload
|
|
|
60
64
|
enable_preload()
|
|
61
65
|
```
|
|
62
66
|
|
|
63
|
-
|
|
67
|
+
#### Using the orchestrator
|
|
68
|
+
|
|
69
|
+
The models come with an "orchestrator", which allows you to run a pre-configured set of models instead of a single one.
|
|
70
|
+
|
|
71
|
+
The configuration for each Node (Cycle, Site or ImpactAssessment) can be found in the [config](./config) folder.
|
|
72
|
+
|
|
73
|
+
Usage:
|
|
74
|
+
```python
|
|
75
|
+
from hestia_earth.orchestrator import run
|
|
76
|
+
from hestia_earth.models.config import load_config
|
|
77
|
+
|
|
78
|
+
cycle_data = {"@type": "Cycle", ...}
|
|
79
|
+
result = run(cycle, load_config(cycle))
|
|
80
|
+
print(result)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
This will display the Cycle recalculated with all HESTIA default models running.
|
|
84
|
+
|
|
85
|
+
#### Using Spatial Models
|
|
64
86
|
|
|
65
87
|
We have models that can gap-fill geographical information on a `Site`. If you want to use these models:
|
|
66
88
|
1. Install the library: `pip install hestia_earth.earth_engine`
|
|
67
89
|
2. Follow the [Getting Started instructions](https://gitlab.com/hestia-earth/hestia-earth-engine#getting-started).
|
|
68
90
|
|
|
69
|
-
|
|
91
|
+
#### Using the ecoinventV3 model
|
|
70
92
|
|
|
71
93
|
ecoinvent is a consistent, transparent, and well validated life cycle inventory database.
|
|
72
94
|
We use ecoinvent data to ascertain the environmental impacts of activities that occur outside of our system boundary, for example data on the environmental impacts of extracting oil and producing diesel, or the impacts of manufacturing plastics.
|
|
@@ -4,7 +4,7 @@ hestia_earth/models/cache_sites.py,sha256=Llo2SH1Lp-R8x1JRxJ2Ta-vw5RbdUj2FHXUP-c
|
|
|
4
4
|
hestia_earth/models/log.py,sha256=_zAfyOkL_VknEnMFvcpvenSMghadlDfZhiSx28545Gk,3558
|
|
5
5
|
hestia_earth/models/preload_requests.py,sha256=vK_G1UzhNMhYy7ymnCtHUz_vv3cfApCSKqv29VREEBQ,1943
|
|
6
6
|
hestia_earth/models/requirements.py,sha256=eU4yT443fx7BnaokhrLB_PCizJI7Y6m4auyo8vQauNg,17363
|
|
7
|
-
hestia_earth/models/version.py,sha256=
|
|
7
|
+
hestia_earth/models/version.py,sha256=stR4pjKHfSb4U3BpRBryv63I9rlfGch2ifjxGb-dZps,19
|
|
8
8
|
hestia_earth/models/agribalyse2016/__init__.py,sha256=WvK0qCQbnYtg9oZxrACd1wGormZyXibPtpCnIQeDqbw,415
|
|
9
9
|
hestia_earth/models/agribalyse2016/fuelElectricity.py,sha256=rm5ZaRAzJ08m2y4BxkGh-RjudkDWgozmg3XumoRm-fQ,4511
|
|
10
10
|
hestia_earth/models/agribalyse2016/machineryInfrastructureDepreciatedAmountPerCycle.py,sha256=BPjnWmg73i_OxM2ouCdMTWZtPIqyoUAXrvutntyteE0,3390
|
|
@@ -27,13 +27,19 @@ hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsLandTransfo
|
|
|
27
27
|
hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsTotalLandUseEffects.py,sha256=11H8j9i2h2zChea92CdzPodWZfdegkAnQx6qYC6Ym9A,2623
|
|
28
28
|
hestia_earth/models/chaudharyBrooks2018/utils.py,sha256=Z0IrvVv-dKsRt09LmT7sc6e1bWnhjZ-WBrO-namIngo,1539
|
|
29
29
|
hestia_earth/models/cml2001Baseline/__init__.py,sha256=0uGrCKDNUH-MUkpvts9MyPMnZKao-M03gU8uKquUozQ,416
|
|
30
|
-
hestia_earth/models/cml2001Baseline/abioticResourceDepletionFossilFuels.py,sha256=
|
|
30
|
+
hestia_earth/models/cml2001Baseline/abioticResourceDepletionFossilFuels.py,sha256=nRAwh5UljL7Tg0BGlYsA6nrIGzIlizVPeangtjHOIQE,7869
|
|
31
31
|
hestia_earth/models/cml2001Baseline/abioticResourceDepletionMineralsAndMetals.py,sha256=4p9Ui78F69yhZkXCwcM6lwbpaNLdpO9p_uJDnLqYhRM,5919
|
|
32
32
|
hestia_earth/models/cml2001Baseline/eutrophicationPotentialExcludingFate.py,sha256=nUWKsn3COqAOrYNmiBKnA2rUs88pj4o3k4fHKA0TVbU,1068
|
|
33
33
|
hestia_earth/models/cml2001Baseline/terrestrialAcidificationPotentialIncludingFateAverageEurope.py,sha256=N8neIISqeTAS7VGTNWbbbozOtfCb816qwwHCnv7Nnpw,1113
|
|
34
34
|
hestia_earth/models/cml2001NonBaseline/__init__.py,sha256=vI8wp8Og_e8DiJqYYvp33YoI3t4ffAC31LWlnV20JTg,419
|
|
35
35
|
hestia_earth/models/cml2001NonBaseline/eutrophicationPotentialIncludingFateAverageEurope.py,sha256=lcgyRHY08KCBFPERJNqV4DYGEJCvyHBDnJXD0kEkVqM,1097
|
|
36
36
|
hestia_earth/models/cml2001NonBaseline/terrestrialAcidificationPotentialExcludingFate.py,sha256=xcrxfs9UoV_EWvV-XzMt35oPWCUsTzqg2SGA3j2MFIw,1091
|
|
37
|
+
hestia_earth/models/config/Cycle.json,sha256=JSrcDhzYLyQ1M7oDfY39pxOgWCScz3dXFSjNNPWvMTo,56546
|
|
38
|
+
hestia_earth/models/config/ImpactAssessment.json,sha256=EB8O8_GZ182upCP-Rpko7I48Tdf30ScK-ZZ3rf4DQQI,57585
|
|
39
|
+
hestia_earth/models/config/Site.json,sha256=FfuME8DLLyoHYJ2uBgnueTIK9E7m9aV7iPT8TBoqlzk,12565
|
|
40
|
+
hestia_earth/models/config/__init__.py,sha256=UZZdwfnxTqnZLG4hNecu6sfKvMLvctjdWFraE_9H438,2130
|
|
41
|
+
hestia_earth/models/config/run-calculations.json,sha256=c-WhY3Rd6UinTxz9ht-1O5_rwe2L7DmX6tFaiVGJ0VY,615
|
|
42
|
+
hestia_earth/models/config/trigger-calculations.json,sha256=pAlb_6GN1HVv9OZwQr8togx7y2ygabGmisJLWILMq_A,623
|
|
37
43
|
hestia_earth/models/cycle/__init__.py,sha256=VowO3kOHb0LpURsljNaJsYO7s6vgjhul6bF_85UjUEI,406
|
|
38
44
|
hestia_earth/models/cycle/aboveGroundCropResidueTotal.py,sha256=9swq4YEeJQ2YjVOmghgBYWkMZWdNU4MKCUBY5FsmBSU,3088
|
|
39
45
|
hestia_earth/models/cycle/coldCarcassWeightPerHead.py,sha256=fQ7huuxyS5PQkRmR_tRCOz9rV3LJwLfLQJjH_TcTz6k,2955
|
|
@@ -200,7 +206,7 @@ hestia_earth/models/haversineFormula/__init__.py,sha256=o155nR-XI67iCSBVNYIu4sPR
|
|
|
200
206
|
hestia_earth/models/haversineFormula/transport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
201
207
|
hestia_earth/models/haversineFormula/transport/distance.py,sha256=163KrmKzlEQuKYT1ZvpPgmKlv_-mmvxp0A1_uKya99w,4203
|
|
202
208
|
hestia_earth/models/hestia/__init__.py,sha256=o5vAmPzSaK9XPgL8GCne3-lugfCOgZhHELYolNgqyyY,407
|
|
203
|
-
hestia_earth/models/hestia/landCover.py,sha256=
|
|
209
|
+
hestia_earth/models/hestia/landCover.py,sha256=10wiHdIBhvWjK2ctHusgOcD2aqTNo8MmJVPW2_DQwu0,29409
|
|
204
210
|
hestia_earth/models/hestia/landTransformation100YearAverageDuringCycle.py,sha256=-7ToRvCVPD6AAcjxorPS5jSWio7JAglHrdSS9PPyPqQ,1551
|
|
205
211
|
hestia_earth/models/hestia/landTransformation20YearAverageDuringCycle.py,sha256=TCskVLhYXBMxdeZM-gN4Tdixk5ua7eVn-o5dfIT_H7o,1543
|
|
206
212
|
hestia_earth/models/hestia/resourceUse_utils.py,sha256=1ySn4d-qkDeU8Ss_80l-uOypPoWsmDsqnS6IM8wkI34,7113
|
|
@@ -284,6 +290,7 @@ hestia_earth/models/ipcc2019/pastureGrass_utils.py,sha256=nL31uS3c77PH_5nA2E2MvB
|
|
|
284
290
|
hestia_earth/models/ipcc2019/utils.py,sha256=MSDMu15D9DnilFUgi4_6jYXC0FaKso3OODauGTMB6hs,6229
|
|
285
291
|
hestia_earth/models/ipcc2019/animal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
286
292
|
hestia_earth/models/ipcc2019/animal/fatContent.py,sha256=T-wWzxzPdy4pexS8ivQSeH9Z6U6qRGYfCiEwQDujcww,1003
|
|
293
|
+
hestia_earth/models/ipcc2019/animal/hoursWorkedPerDay.py,sha256=f-zcslXkbIY9ef-pia2PFmxPEDWiMgp4wxJafSGFLe0,985
|
|
287
294
|
hestia_earth/models/ipcc2019/animal/liveweightGain.py,sha256=UElmAdB4yQEFAOT5RrURn0Yt7U3gB2qiCWvNXyLk8Hw,971
|
|
288
295
|
hestia_earth/models/ipcc2019/animal/liveweightPerHead.py,sha256=cq88VTxPYVPyEr2NLPb0Zmmppn_eMp9Xtw6Nxnta4-M,984
|
|
289
296
|
hestia_earth/models/ipcc2019/animal/milkYieldPerAnimal.py,sha256=XxgSvQLi1Xu6ZpUg1a-7OFZEkItkUK-nVPTDxApUnuY,2777
|
|
@@ -399,7 +406,7 @@ hestia_earth/models/linkedImpactAssessment/utils.py,sha256=S1zlux02gU2Lajrtoq-zQ
|
|
|
399
406
|
hestia_earth/models/mocking/__init__.py,sha256=9VX50c-grz-snfd-7MBS0KfF7AadtbKuj7kK6PqtsgE,687
|
|
400
407
|
hestia_earth/models/mocking/build_mock_search.py,sha256=p15ccEUmkmLp1RiGNznxMz3OFHbI8P1-29ExuohiQN8,1355
|
|
401
408
|
hestia_earth/models/mocking/mock_search.py,sha256=ccFe_WrI73JElFmxp4hPNLCX7eeU--lBC1JFR901KJY,1069
|
|
402
|
-
hestia_earth/models/mocking/search-results.json,sha256=
|
|
409
|
+
hestia_earth/models/mocking/search-results.json,sha256=D2Ule1jJAIeLu4ojLX0pXd4YmUDGxW1BduwqcDbpcUw,102056
|
|
403
410
|
hestia_earth/models/pooreNemecek2018/__init__.py,sha256=nPboL7ULJzL5nJD5q7q9VOZt_fxbKVm8fmn1Az5YkVY,417
|
|
404
411
|
hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py,sha256=Qt-mel4dkhK6N5uUOutNOinCTFjbjtGzITaaI0LvYc4,2396
|
|
405
412
|
hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py,sha256=JT0RybbvWVlo01FO8K0Yj41HrEaJT3Kj1xfayr2X-xw,2315
|
|
@@ -501,7 +508,7 @@ hestia_earth/models/site/brackishWater.py,sha256=vLEhIZv5PUKwzwvIuYrWi7K---fq7ZX
|
|
|
501
508
|
hestia_earth/models/site/cationExchangeCapacityPerKgSoil.py,sha256=0eH4A-tXJ0hvIkiYXWxlx8TfrdbIKUGYUDk97-yQJgg,3653
|
|
502
509
|
hestia_earth/models/site/flowingWater.py,sha256=v3g5722GIA4zQAUQI9yGFiZvFvI1QAVZqlQrY-6_B3A,1731
|
|
503
510
|
hestia_earth/models/site/freshWater.py,sha256=FXs3Vt8V4e-wn325_dwSTOKlZtn5ksNUpvYGDeLJShY,1255
|
|
504
|
-
hestia_earth/models/site/management.py,sha256=
|
|
511
|
+
hestia_earth/models/site/management.py,sha256=jZqcYxflJWsPef2NrQgPxoKNPKAL3gs616HeMMmQUDY,14503
|
|
505
512
|
hestia_earth/models/site/netPrimaryProduction.py,sha256=UIIQkYd911qVzrWjxBLrC37e-RARIVgDwLdARY9BuLw,1849
|
|
506
513
|
hestia_earth/models/site/organicCarbonPerHa.py,sha256=F2ShinHf0m9qKa1nCYBspsDkRY6jzOl0wM8mSDre22I,14916
|
|
507
514
|
hestia_earth/models/site/organicCarbonPerKgSoil.py,sha256=t--wAshiAKS-JvEKhLFRadGvgSBv5NFZ68jdyms_wh4,1945
|
|
@@ -568,7 +575,7 @@ hestia_earth/models/utils/blank_node.py,sha256=-IURt-nrVCJUk2Q51Ar46iEYv4Cn3aSdl
|
|
|
568
575
|
hestia_earth/models/utils/cache_sources.py,sha256=MBkrPpjwNiC4ApDjeYVHZjWBbpvAerXRDrMHpjasAZ0,377
|
|
569
576
|
hestia_earth/models/utils/completeness.py,sha256=2-GusD9UycobDZq8y5jar0ZcOjyqnSbzPRT_5XMc4YA,1259
|
|
570
577
|
hestia_earth/models/utils/constant.py,sha256=6wLx8xb2R8HtpEpVy5e-PbioOo7QCu2n-W72fs6OvgE,3411
|
|
571
|
-
hestia_earth/models/utils/crop.py,sha256=
|
|
578
|
+
hestia_earth/models/utils/crop.py,sha256=szbmQFIfKAgH18PXkwx4FcmSsYOzDM3AHN5z0aYK9OU,2696
|
|
572
579
|
hestia_earth/models/utils/cropResidue.py,sha256=_0Q35CrliJeo31xGHsPWe8A2oHxijdIsOrf3gBEqhlA,612
|
|
573
580
|
hestia_earth/models/utils/cropResidueManagement.py,sha256=nIDFjf39rDD10UHSVudfDyu-EiL261g8jyrgS-2aDKw,347
|
|
574
581
|
hestia_earth/models/utils/currency.py,sha256=f_ArJANb--pZq4LL49SXQ1AMX_oKroqwBXKRRQqZwsM,578
|
|
@@ -604,8 +611,26 @@ hestia_earth/models/utils/time_series.py,sha256=vuv033qUZ1gAw3T3wlLNG7vJmXCCsHEz
|
|
|
604
611
|
hestia_earth/models/utils/transformation.py,sha256=nyT5Mz4_VgFwhkL8JoNX9kxxow0zuxzsYl3W8xOu2p0,370
|
|
605
612
|
hestia_earth/models/webbEtAl2012AndSintermannEtAl2012/__init__.py,sha256=Niv7ZFMBCwThlbCKGOwA17QdkpOUDFrqrFItGNqnZAA,434
|
|
606
613
|
hestia_earth/models/webbEtAl2012AndSintermannEtAl2012/nh3ToAirOrganicFertiliser.py,sha256=TGXyusrRd9shT842iqbrI6MkQhICgw7uYdrl4jsDrg8,4193
|
|
614
|
+
hestia_earth/orchestrator/__init__.py,sha256=ntPWzdomHMdKejrnUlVPCUrLw0P2C9UIt3jRJD_Gwn4,1402
|
|
615
|
+
hestia_earth/orchestrator/log.py,sha256=rvuc221TZCXB1s_Qxme_lTPAI9cZWkmTvnZHGqSDtWY,2214
|
|
616
|
+
hestia_earth/orchestrator/utils.py,sha256=LAMUTyIQ-90TR6CUljWPbCNBsAMeukOhW4zoPy7LzuU,4111
|
|
617
|
+
hestia_earth/orchestrator/models/__init__.py,sha256=wVFqISTf8dKAjsvL9bcqxZx7szn8Gycvuey7Dkxg0fM,4126
|
|
618
|
+
hestia_earth/orchestrator/models/transformations.py,sha256=zJwfVXabudLXhdyz0Hsk4IV_2OjgMtaYEZbD9kuZtLk,4128
|
|
619
|
+
hestia_earth/orchestrator/models/emissions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
620
|
+
hestia_earth/orchestrator/models/emissions/deleted.py,sha256=KC6J1bdMJC1rBFlWW5SD1NhbN8kyBPFdncbtY9OfYBU,575
|
|
621
|
+
hestia_earth/orchestrator/strategies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
622
|
+
hestia_earth/orchestrator/strategies/merge/__init__.py,sha256=9fytXEII6aSbc0edEp0Dg1QMVayU3eMUXdwKYVky_24,1416
|
|
623
|
+
hestia_earth/orchestrator/strategies/merge/merge_append.py,sha256=5xJ8fqu2UqCDotVkSxj7yRDRdw0RM2tERsA4j_1Zlu8,915
|
|
624
|
+
hestia_earth/orchestrator/strategies/merge/merge_default.py,sha256=ssKq5ZIoQr4k2HHpkyPqHJSQQj-AGqu8zUzEQIRafv8,45
|
|
625
|
+
hestia_earth/orchestrator/strategies/merge/merge_list.py,sha256=JioJi4HajpiYHtYE7xbTWQHOQtu3pWIo512VtaxSsDw,4067
|
|
626
|
+
hestia_earth/orchestrator/strategies/merge/merge_node.py,sha256=iAgxHVVR7y2kXtR_pdNzS4Fq-iLmwaqNHXMfjIBG6eE,2622
|
|
627
|
+
hestia_earth/orchestrator/strategies/run/__init__.py,sha256=At0V8CI4vyiSY-Vh2PHMhTYfnp7vl31gq78RyCeIqJk,307
|
|
628
|
+
hestia_earth/orchestrator/strategies/run/add_blank_node_if_missing.py,sha256=dfmS2AC_d3LjlBT962grygvHK38I4y12K3bl_CT_zlo,3166
|
|
629
|
+
hestia_earth/orchestrator/strategies/run/add_key_if_missing.py,sha256=t3U-v87XpbtpsvjA_r0Ftm7MhNkGB0kcUSGFlKBIK_I,352
|
|
630
|
+
hestia_earth/orchestrator/strategies/run/always.py,sha256=D0In6_kr28s-fgqspawgvj5cgFClxGvepZYqtYsjWVE,217
|
|
607
631
|
tests/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
608
632
|
tests/models/test_cache_sites.py,sha256=vuEVZh_mkuI2cPotX2GB88lURJm2giOQ3yu2Cn4iLoI,2997
|
|
633
|
+
tests/models/test_config.py,sha256=WFz1OGhJE6kpcYe3kTPBpv4Jn59yeOCAvz1hqnbI_7o,3113
|
|
609
634
|
tests/models/test_ecoinventV3.py,sha256=_BqfWiYFaw-Y7A-EeabHEnja3d7yb4Ed7gGGvu3Srpw,1936
|
|
610
635
|
tests/models/test_ecoinventV3AndEmberClimate.py,sha256=_EOxdrdavXP6L5_LtvaVbXb_-56UJXSaiPhpGntmwVc,801
|
|
611
636
|
tests/models/test_emissionNotRelevant.py,sha256=YXTdRfcdR_JepHuj2P3Y3r0aFMKNOmsXQHY48tmLTQo,1316
|
|
@@ -630,7 +655,7 @@ tests/models/chaudharyBrooks2018/test_damageToTerrestrialEcosystemsLandOccupatio
|
|
|
630
655
|
tests/models/chaudharyBrooks2018/test_damageToTerrestrialEcosystemsLandTransformation.py,sha256=lcyMTaNMbIjzZrbPxejujfYyAEj2XOH5Ei9pmAQAi7k,1912
|
|
631
656
|
tests/models/chaudharyBrooks2018/test_damageToTerrestrialEcosystemsTotalLandUseEffects.py,sha256=NTc3PZZRc9ZqGpaARdbuzLWR5bB0HCPw5AMdGmwVsRg,704
|
|
632
657
|
tests/models/cml2001Baseline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
633
|
-
tests/models/cml2001Baseline/test_abioticResourceDepletionFossilFuels.py,sha256
|
|
658
|
+
tests/models/cml2001Baseline/test_abioticResourceDepletionFossilFuels.py,sha256=-913Bo7_IC8vz3Fi1tYqN0mSx6HzwWmHcQs-jpuRm80,8801
|
|
634
659
|
tests/models/cml2001Baseline/test_abioticResourceDepletionMineralsAndMetals.py,sha256=xBoSGZaNCSpfDdNFIbyJhJslDJD5A_eTywz01GDqFNM,4513
|
|
635
660
|
tests/models/cml2001Baseline/test_eutrophicationPotentialExcludingFate.py,sha256=ZIIx_EiYbUxUoAS7NuQrxqwTFS3rXQm9_1AsqF_bhB8,894
|
|
636
661
|
tests/models/cml2001Baseline/test_terrestrialAcidificationPotentialIncludingFateAverageEurope.py,sha256=t3WBdg_aTYSLfaqeXUDyvQJ8ZqbvKwv9RKaZyRzj61k,925
|
|
@@ -791,7 +816,7 @@ tests/models/haversineFormula/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
|
791
816
|
tests/models/haversineFormula/transport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
792
817
|
tests/models/haversineFormula/transport/test_distance.py,sha256=hqzIOA1nGao8uiBE16J0ou52McwV4w30ZLpEAqtfi9k,970
|
|
793
818
|
tests/models/hestia/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
794
|
-
tests/models/hestia/test_landCover.py,sha256=
|
|
819
|
+
tests/models/hestia/test_landCover.py,sha256=MP5sKjForlG1FGHl6W9zGEV5iQu4DoswrQa_ZhMqGDg,6078
|
|
795
820
|
tests/models/hestia/test_landTransformation100YearAverageDuringCycle.py,sha256=3qa4rWUFqP1VM5-vm_182rhiBYJDxPqJwWtBqJ5K028,956
|
|
796
821
|
tests/models/hestia/test_landTransformation20YearAverageDuringCycle.py,sha256=257nCGseM8IEc7i3c2lvx0AsJOpk5Cy633PlZZQYRGo,956
|
|
797
822
|
tests/models/hestia/test_seed_emissions.py,sha256=dCUuJBkhwNFBhhcypQN7eMqrWZ9iGCnypoidO5DfQYw,921
|
|
@@ -872,6 +897,7 @@ tests/models/ipcc2019/test_organicCarbonPerHa_utils.py,sha256=Zd2QlN_Q3k9djuByOH
|
|
|
872
897
|
tests/models/ipcc2019/test_pastureGrass.py,sha256=mKx8NnTtMT9TrXxRNLv73wD1TWBaiRZzA1xh2ukb-HI,2667
|
|
873
898
|
tests/models/ipcc2019/animal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
874
899
|
tests/models/ipcc2019/animal/test_fatContent.py,sha256=Emp8jGudRGA_dJaLMR5Jxsv3Gc57rMAnP0CDqswrmlM,775
|
|
900
|
+
tests/models/ipcc2019/animal/test_hoursWorkedPerDay.py,sha256=gFgCd5hXS_fBhu1f8hbZCci4uTGdpFLjIuER73LY_4A,782
|
|
875
901
|
tests/models/ipcc2019/animal/test_liveweightGain.py,sha256=KmRZyrjrXZcgff1QFtfu1WphNuJW_nHx1GguD8xB2ls,779
|
|
876
902
|
tests/models/ipcc2019/animal/test_liveweightPerHead.py,sha256=nfNAcUEIPQeKyjKYttI5W6hiHBMXLZ9Vbz0nfj81ZvA,782
|
|
877
903
|
tests/models/ipcc2019/animal/test_milkYieldPerAnimal.py,sha256=98rslTxLk92smiUfxRfxB6kjmQAm6085GV9NqWCGpVo,713
|
|
@@ -1160,8 +1186,26 @@ tests/models/utils/test_term.py,sha256=M5Sa26v2gzQYbZ4H_fo7DspnaCx__-WtL-MULGapC
|
|
|
1160
1186
|
tests/models/utils/test_time_series.py,sha256=LMhRPf8rp3nAriKAC-2K3FDkrMWntRTUUCERw7Lt68g,2686
|
|
1161
1187
|
tests/models/webbEtAl2012AndSintermannEtAl2012/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1162
1188
|
tests/models/webbEtAl2012AndSintermannEtAl2012/test_nh3ToAirOrganicFertiliser.py,sha256=qi2FNXS5Af2WDtm7nq_FsprH3BfCF0XxnE0XHmC4aIY,2244
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1189
|
+
tests/orchestrator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1190
|
+
tests/orchestrator/test_models.py,sha256=v5VnyELmrSEcTOtw4lyk2U0r016z8Xx34EFs0FJm5AA,1972
|
|
1191
|
+
tests/orchestrator/test_orchestrator.py,sha256=dlO4CKn04m__SZhDtvy1npvQUavVNhdcRe4Unj7wg6g,742
|
|
1192
|
+
tests/orchestrator/test_utils.py,sha256=Sqysl2ocifLUeSbgGUdeRn0Sof0xVEeH4dgoXfe18yw,3050
|
|
1193
|
+
tests/orchestrator/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1194
|
+
tests/orchestrator/models/test_transformations.py,sha256=cQdk8rEtSJJr27th8SmacsOpC7BP_YVXDrmFDDY4Iks,1080
|
|
1195
|
+
tests/orchestrator/models/emissions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1196
|
+
tests/orchestrator/models/emissions/test_deleted.py,sha256=55WOjXR2oeKxdRgXmJg4DgIY3f0asPMvez8b5fkT7LI,767
|
|
1197
|
+
tests/orchestrator/strategies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1198
|
+
tests/orchestrator/strategies/merge/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1199
|
+
tests/orchestrator/strategies/merge/test_merge_append.py,sha256=T6_y3qDb4ZmZixzSZMNCYD-dbkIHFfvpayXo1K9-lNA,800
|
|
1200
|
+
tests/orchestrator/strategies/merge/test_merge_default.py,sha256=iEia74Z7RflmxDZ3XzubN9yR8n5DR_CDSMyLIW1e8PU,198
|
|
1201
|
+
tests/orchestrator/strategies/merge/test_merge_list.py,sha256=KIObPP7AFT0oOE7669UUnYYMSCHX4fQSrb1VFevkQmk,9081
|
|
1202
|
+
tests/orchestrator/strategies/merge/test_merge_node.py,sha256=yCaIKFFdJcIANidQBJb95f50OPgm9wwTsuTEzhHumA0,3203
|
|
1203
|
+
tests/orchestrator/strategies/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1204
|
+
tests/orchestrator/strategies/run/test_add_blank_node_if_missing.py,sha256=lGqeebvgAwGathB8NLZ14Js5JV_-KyHueaD6I8IH8mU,3615
|
|
1205
|
+
tests/orchestrator/strategies/run/test_add_key_if_missing.py,sha256=hKwvk1ohcBVnQUCTiDhRW99J0xEa29BpwFi1KC0yWLE,329
|
|
1206
|
+
tests/orchestrator/strategies/run/test_always.py,sha256=w5-Dhp6yLzgZGAeMRz3OrqZbbAed9gZ1O266a3z9k7w,134
|
|
1207
|
+
hestia_earth_models-0.65.7.dist-info/LICENSE,sha256=TD25LoiRJsA5CPUNrcyt1PXlGcbUGFMAeZoBcfCrCNE,1154
|
|
1208
|
+
hestia_earth_models-0.65.7.dist-info/METADATA,sha256=WBcWi-w_mq-nLFKriqoNmPd5Gb2dbMDGRAttdzZIzn4,4046
|
|
1209
|
+
hestia_earth_models-0.65.7.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
1210
|
+
hestia_earth_models-0.65.7.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
|
|
1211
|
+
hestia_earth_models-0.65.7.dist-info/RECORD,,
|
|
@@ -195,7 +195,8 @@ def test_get_sums_of_crop_expansion():
|
|
|
195
195
|
"zimbabwe_example",
|
|
196
196
|
"brazil_empty_example",
|
|
197
197
|
"gbr_example",
|
|
198
|
-
"malaysia"
|
|
198
|
+
"malaysia",
|
|
199
|
+
"prior_landCover"
|
|
199
200
|
]
|
|
200
201
|
)
|
|
201
202
|
@patch(f"{CLASS_PATH}._new_management", side_effect=fake_new_management)
|