hestia-earth-models 0.43.0__py3-none-any.whl → 0.44.1__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/cycle/completeness/__init__.py +2 -1
- hestia_earth/models/cycle/completeness/animalFeed.py +8 -6
- hestia_earth/models/cycle/completeness/cropResidue.py +24 -9
- hestia_earth/models/cycle/completeness/excreta.py +8 -6
- hestia_earth/models/cycle/completeness/material.py +12 -7
- hestia_earth/models/cycle/completeness/other.py +9 -6
- hestia_earth/models/cycle/completeness/soilAmendments.py +12 -6
- hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioCarbon.py +1 -1
- hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioDryMatter.py +1 -1
- hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioEnergy.py +1 -1
- hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioFedWeight.py +1 -1
- hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioNitrogen.py +1 -1
- hestia_earth/models/cycle/input/hestiaAggregatedData.py +4 -3
- hestia_earth/models/ipcc2019/ch4ToAirEntericFermentation.py +1 -1
- hestia_earth/models/ipcc2019/pastureGrass.py +20 -13
- hestia_earth/models/koble2014/cropResidueManagement.py +2 -2
- hestia_earth/models/mocking/search-results.json +140 -140
- hestia_earth/models/pooreNemecek2018/excretaKgN.py +1 -1
- hestia_earth/models/pooreNemecek2018/excretaKgVs.py +1 -1
- hestia_earth/models/utils/__init__.py +10 -0
- hestia_earth/models/utils/input.py +4 -7
- hestia_earth/models/utils/measurement.py +2 -2
- hestia_earth/models/utils/practice.py +2 -2
- hestia_earth/models/utils/product.py +2 -2
- hestia_earth/models/version.py +1 -1
- {hestia_earth_models-0.43.0.dist-info → hestia_earth_models-0.44.1.dist-info}/METADATA +3 -3
- {hestia_earth_models-0.43.0.dist-info → hestia_earth_models-0.44.1.dist-info}/RECORD +35 -35
- {hestia_earth_models-0.43.0.dist-info → hestia_earth_models-0.44.1.dist-info}/WHEEL +1 -1
- tests/models/haversineFormula/transport/test_distance.py +2 -2
- tests/models/utils/test_input.py +1 -1
- tests/models/utils/test_measurement.py +1 -1
- tests/models/utils/test_practice.py +1 -1
- tests/models/utils/test_product.py +1 -1
- {hestia_earth_models-0.43.0.dist-info → hestia_earth_models-0.44.1.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.43.0.dist-info → hestia_earth_models-0.44.1.dist-info}/top_level.txt +0 -0
|
@@ -20,7 +20,8 @@ MODELS = list(map(lambda m: {'key': m, 'run': getattr(import_module(f".{m}", pac
|
|
|
20
20
|
def _should_run_model(model, cycle: dict):
|
|
21
21
|
is_complete = cycle.get('completeness', {}).get(model.get('key'))
|
|
22
22
|
should_run = is_complete is False
|
|
23
|
-
|
|
23
|
+
if should_run:
|
|
24
|
+
logShouldRun(cycle, MODEL, None, should_run, key=model.get('key'))
|
|
24
25
|
return should_run
|
|
25
26
|
|
|
26
27
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Animal feed
|
|
2
|
+
Completeness Animal feed
|
|
3
3
|
|
|
4
|
-
This model checks if
|
|
4
|
+
This model checks if we have the requirements below and updates the
|
|
5
5
|
[Data Completeness](https://hestia.earth/schema/Completeness#animalFeed) value.
|
|
6
6
|
"""
|
|
7
7
|
from hestia_earth.schema import SiteSiteType
|
|
8
8
|
|
|
9
|
-
from hestia_earth.models.log import
|
|
9
|
+
from hestia_earth.models.log import logRequirements
|
|
10
10
|
from . import MODEL
|
|
11
11
|
|
|
12
12
|
REQUIREMENTS = {
|
|
@@ -33,6 +33,8 @@ ALLOWED_SITE_TYPES = [
|
|
|
33
33
|
def run(cycle: dict):
|
|
34
34
|
site_type = cycle.get('site', {}).get('siteType')
|
|
35
35
|
site_type_allowed = site_type in ALLOWED_SITE_TYPES
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
|
|
37
|
+
logRequirements(cycle, model=MODEL, term=None, key=MODEL_KEY,
|
|
38
|
+
site_type_allowed=site_type_allowed)
|
|
39
|
+
|
|
40
|
+
return all([site_type_allowed])
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Crop Residue
|
|
2
|
+
Completeness Crop Residue
|
|
3
3
|
|
|
4
|
-
This model checks if we have
|
|
5
|
-
|
|
4
|
+
This model checks if we have the requirements below and updates the
|
|
5
|
+
[Data Completeness](https://hestia.earth/schema/Completeness#cropResidue) value.
|
|
6
6
|
"""
|
|
7
7
|
from hestia_earth.utils.model import find_term_match
|
|
8
8
|
|
|
9
|
-
from hestia_earth.models.log import
|
|
9
|
+
from hestia_earth.models.log import logRequirements
|
|
10
10
|
from hestia_earth.models.utils.term import get_crop_residue_terms
|
|
11
11
|
from . import MODEL
|
|
12
12
|
|
|
@@ -44,11 +44,26 @@ def _optional_term_ids():
|
|
|
44
44
|
return [term for term in terms if term not in REQUIRED_TERM_IDS]
|
|
45
45
|
|
|
46
46
|
|
|
47
|
+
def _has_product(products):
|
|
48
|
+
def has_product(term_id: str):
|
|
49
|
+
return (term_id, find_term_match(products, term_id, None) is not None)
|
|
50
|
+
return has_product
|
|
51
|
+
|
|
52
|
+
|
|
47
53
|
def run(cycle: dict):
|
|
48
54
|
products = cycle.get('products', [])
|
|
49
55
|
# all required terms + at least one of the optional terms must be present
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
required_products_map = list(map(_has_product(products), REQUIRED_TERM_IDS))
|
|
57
|
+
optional_products_map = list(map(_has_product(products), _optional_term_ids()))
|
|
58
|
+
|
|
59
|
+
has_required_products = all([has_product for _term_id, has_product in required_products_map])
|
|
60
|
+
has_optional_product = any([has_product for _term_id, has_product in optional_products_map])
|
|
61
|
+
|
|
62
|
+
logRequirements(cycle, model=MODEL, term=None, key=MODEL_KEY,
|
|
63
|
+
**({
|
|
64
|
+
f'has_required_{term_id}': has_product for term_id, has_product in required_products_map
|
|
65
|
+
} | {
|
|
66
|
+
f'has_optional_{term_id}': has_product for term_id, has_product in optional_products_map
|
|
67
|
+
}))
|
|
68
|
+
|
|
69
|
+
return all([has_required_products, has_optional_product])
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Excreta
|
|
2
|
+
Completeness Excreta
|
|
3
3
|
|
|
4
|
-
This model checks if
|
|
4
|
+
This model checks if we have the requirements below and updates the
|
|
5
5
|
[Data Completeness](https://hestia.earth/schema/Completeness#excreta) value.
|
|
6
6
|
"""
|
|
7
7
|
from hestia_earth.schema import SiteSiteType
|
|
8
8
|
|
|
9
|
-
from hestia_earth.models.log import
|
|
9
|
+
from hestia_earth.models.log import logRequirements
|
|
10
10
|
from . import MODEL
|
|
11
11
|
|
|
12
12
|
REQUIREMENTS = {
|
|
@@ -33,6 +33,8 @@ ALLOWED_SITE_TYPES = [
|
|
|
33
33
|
def run(cycle: dict):
|
|
34
34
|
site_type = cycle.get('site', {}).get('siteType')
|
|
35
35
|
site_type_allowed = site_type in ALLOWED_SITE_TYPES
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
|
|
37
|
+
logRequirements(cycle, model=MODEL, term=None, key=MODEL_KEY,
|
|
38
|
+
site_type_allowed=site_type_allowed)
|
|
39
|
+
|
|
40
|
+
return all([site_type_allowed])
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Material
|
|
2
|
+
Completeness Material
|
|
3
3
|
|
|
4
|
-
This model checks if
|
|
4
|
+
This model checks if we have the requirements below and updates the
|
|
5
5
|
[Data Completeness](https://hestia.earth/schema/Completeness#material) value.
|
|
6
6
|
"""
|
|
7
7
|
from hestia_earth.schema import SiteSiteType
|
|
8
8
|
from hestia_earth.utils.model import find_term_match
|
|
9
9
|
|
|
10
|
-
from hestia_earth.models.log import
|
|
10
|
+
from hestia_earth.models.log import logRequirements
|
|
11
11
|
from . import MODEL
|
|
12
12
|
|
|
13
13
|
REQUIREMENTS = {
|
|
@@ -34,7 +34,12 @@ ALLOWED_SITE_TYPES = [
|
|
|
34
34
|
def run(cycle: dict):
|
|
35
35
|
site_type = cycle.get('site', {}).get('siteType')
|
|
36
36
|
site_type_allowed = site_type in ALLOWED_SITE_TYPES
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
has_machinery_input = find_term_match(
|
|
38
|
+
cycle.get('inputs', []), 'machineryInfrastructureDepreciatedAmountPerCycle', None
|
|
39
|
+
) is not None
|
|
40
|
+
|
|
41
|
+
logRequirements(cycle, model=MODEL, term=None, key=MODEL_KEY,
|
|
42
|
+
site_type_allowed=site_type_allowed,
|
|
43
|
+
has_machinery_input=has_machinery_input)
|
|
44
|
+
|
|
45
|
+
return all([site_type_allowed, has_machinery_input])
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Other
|
|
2
|
+
Completeness Other
|
|
3
3
|
|
|
4
|
-
This model checks if
|
|
4
|
+
This model checks if we have the requirements below and updates the
|
|
5
5
|
[Data Completeness](https://hestia.earth/schema/Completeness#other) value.
|
|
6
6
|
"""
|
|
7
7
|
from hestia_earth.schema import SiteSiteType
|
|
8
8
|
from hestia_earth.utils.model import find_term_match, find_primary_product
|
|
9
9
|
|
|
10
|
-
from hestia_earth.models.log import
|
|
10
|
+
from hestia_earth.models.log import logRequirements
|
|
11
11
|
from hestia_earth.models.utils.crop import is_orchard
|
|
12
12
|
from . import MODEL
|
|
13
13
|
|
|
@@ -48,6 +48,9 @@ def run(cycle: dict):
|
|
|
48
48
|
term_id = product.get('term', {}).get('@id')
|
|
49
49
|
has_saplings = find_term_match(cycle.get('inputs', []), 'saplings', None) and is_orchard(MODEL, term_id)
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
logRequirements(cycle, model=MODEL, term=None, key=MODEL_KEY,
|
|
52
|
+
site_type_allowed=site_type_allowed,
|
|
53
|
+
has_seed=has_seed,
|
|
54
|
+
has_saplings=has_saplings)
|
|
55
|
+
|
|
56
|
+
return all([site_type_allowed, has_seed or has_saplings])
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Soil Amendments
|
|
2
|
+
Completeness Soil Amendments
|
|
3
3
|
|
|
4
|
-
This model checks if
|
|
4
|
+
This model checks if we have the requirements below and updates the
|
|
5
5
|
[Data Completeness](https://hestia.earth/schema/Completeness#soilAmendments) value.
|
|
6
6
|
"""
|
|
7
|
-
from hestia_earth.models.log import
|
|
7
|
+
from hestia_earth.models.log import logRequirements
|
|
8
8
|
from hestia_earth.models.utils import is_from_model
|
|
9
9
|
from hestia_earth.models.utils.measurement import most_relevant_measurement, measurement_value
|
|
10
10
|
from . import MODEL
|
|
@@ -32,6 +32,12 @@ def run(cycle: dict):
|
|
|
32
32
|
measurements = cycle.get('site', {}).get('measurements', [])
|
|
33
33
|
soilPh_measurement = most_relevant_measurement(measurements, 'soilPh', end_date)
|
|
34
34
|
soilPh = measurement_value(soilPh_measurement)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
|
|
36
|
+
soilPh_added = is_from_model(soilPh_measurement)
|
|
37
|
+
soilPh_above_6_5 = soilPh > 6.5
|
|
38
|
+
|
|
39
|
+
logRequirements(cycle, model=MODEL, term=None, key=MODEL_KEY,
|
|
40
|
+
soilPh_added=soilPh_added,
|
|
41
|
+
soilPh_above_6_5=soilPh_above_6_5)
|
|
42
|
+
|
|
43
|
+
return all([soilPh_added, soilPh_above_6_5])
|
|
@@ -5,7 +5,7 @@ REQUIREMENTS = {
|
|
|
5
5
|
"term.units": "kg",
|
|
6
6
|
"term.termType": ["crop", "animalProduct", "feedFoodAdditive"],
|
|
7
7
|
"value": "> 0",
|
|
8
|
-
"
|
|
8
|
+
"isAnimalFeed": "True",
|
|
9
9
|
"properties": [{"@type": "Property", "value": "", "term.@id": "energyContentHigherHeatingValue"}]
|
|
10
10
|
}],
|
|
11
11
|
"products": [{
|
|
@@ -11,7 +11,7 @@ REQUIREMENTS = {
|
|
|
11
11
|
"term.units": "kg",
|
|
12
12
|
"term.termType": ["crop", "animalProduct", "feedFoodAdditive"],
|
|
13
13
|
"value": "> 0",
|
|
14
|
-
"
|
|
14
|
+
"isAnimalFeed": "True",
|
|
15
15
|
"properties": [
|
|
16
16
|
{"@type": "Property", "value": "", "term.@id": "energyContentHigherHeatingValue"},
|
|
17
17
|
{"@type": "Property", "value": "", "term.@id": "dryMatter"}
|
|
@@ -5,7 +5,7 @@ REQUIREMENTS = {
|
|
|
5
5
|
"term.units": "kg",
|
|
6
6
|
"term.termType": ["crop", "animalProduct", "feedFoodAdditive"],
|
|
7
7
|
"value": "> 0",
|
|
8
|
-
"
|
|
8
|
+
"isAnimalFeed": "True",
|
|
9
9
|
"properties": [{"@type": "Property", "value": "", "term.@id": "energyContentHigherHeatingValue"}]
|
|
10
10
|
}],
|
|
11
11
|
"products": [{
|
|
@@ -11,7 +11,7 @@ REQUIREMENTS = {
|
|
|
11
11
|
"term.units": "kg",
|
|
12
12
|
"term.termType": ["crop", "animalProduct", "feedFoodAdditive"],
|
|
13
13
|
"value": "> 0",
|
|
14
|
-
"
|
|
14
|
+
"isAnimalFeed": "True",
|
|
15
15
|
"properties": [{"@type": "Property", "value": "", "term.@id": "energyContentHigherHeatingValue"}]
|
|
16
16
|
}],
|
|
17
17
|
"products": [{
|
|
@@ -11,7 +11,7 @@ REQUIREMENTS = {
|
|
|
11
11
|
"term.units": "kg",
|
|
12
12
|
"term.termType": ["crop", "animalProduct", "feedFoodAdditive"],
|
|
13
13
|
"value": "> 0",
|
|
14
|
-
"
|
|
14
|
+
"isAnimalFeed": "True",
|
|
15
15
|
"properties": [
|
|
16
16
|
{"@type": "Property", "value": "", "term.@id": "energyContentHigherHeatingValue"},
|
|
17
17
|
{"@type": "Property", "value": "", "term.@id": "crudeProteinContent"}
|
|
@@ -50,7 +50,8 @@ REQUIREMENTS = {
|
|
|
50
50
|
}
|
|
51
51
|
RETURNS = {
|
|
52
52
|
"Input": [{
|
|
53
|
-
"impactAssessment": "added from Hestia"
|
|
53
|
+
"impactAssessment": "added from Hestia",
|
|
54
|
+
"impactAssessmentIsProxy": "True"
|
|
54
55
|
}]
|
|
55
56
|
}
|
|
56
57
|
MODEL_ID = 'hestiaAggregatedData'
|
|
@@ -117,7 +118,7 @@ def _run_seed(cycle: dict, primary_product: dict, seed_input: dict, end_date: st
|
|
|
117
118
|
impact = _find_closest_impact(cycle, date, primary_product, region, country, [
|
|
118
119
|
{'match': {'endDate': date - 10}}
|
|
119
120
|
]) or _find_closest_impact(cycle, date, {'term': get_generic_crop()}, region, country)
|
|
120
|
-
return [{**seed_input, MODEL_KEY: linked_node(impact)}] if impact else []
|
|
121
|
+
return [{**seed_input, MODEL_KEY: linked_node(impact), 'impactAssessmentIsProxy': True}] if impact else []
|
|
121
122
|
|
|
122
123
|
|
|
123
124
|
def _should_run_seed(cycle: dict):
|
|
@@ -150,7 +151,7 @@ def _run_input(cycle: dict, date: int):
|
|
|
150
151
|
logShouldRun(cycle, MODEL_ID, term_id, should_run)
|
|
151
152
|
logShouldRun(cycle, MODEL_ID, term_id, should_run, key=MODEL_KEY) # show specifically under Input
|
|
152
153
|
|
|
153
|
-
return {**input, MODEL_KEY: linked_node(impact)} if impact else None
|
|
154
|
+
return {**input, MODEL_KEY: linked_node(impact), 'impactAssessmentIsProxy': True} if impact else None
|
|
154
155
|
return run
|
|
155
156
|
|
|
156
157
|
|
|
@@ -17,7 +17,7 @@ REQUIREMENTS = {
|
|
|
17
17
|
"term.termType": ["crop", "animalProduct", "feedFoodAdditive", "forage", "liveAquaticSpecies"],
|
|
18
18
|
"term.units": "kg",
|
|
19
19
|
"value": "> 0",
|
|
20
|
-
"
|
|
20
|
+
"isAnimalFeed": "True",
|
|
21
21
|
"optional": {
|
|
22
22
|
"properties": [{
|
|
23
23
|
"@type": "Property",
|
|
@@ -5,7 +5,7 @@ This model estimates the energetic requirements of ruminants and can be used to
|
|
|
5
5
|
Source:
|
|
6
6
|
[IPCC 2019, Vol.4, Chapter 10](https://www.ipcc-nggip.iges.or.jp/public/2019rf/pdf/4_Volume4/19R_V4_Ch10_Livestock.pdf).
|
|
7
7
|
"""
|
|
8
|
-
from hestia_earth.schema import InputStatsDefinition, TermTermType, AnimalReferencePeriod
|
|
8
|
+
from hestia_earth.schema import InputStatsDefinition, TermTermType, AnimalReferencePeriod
|
|
9
9
|
from hestia_earth.utils.lookup import download_lookup, get_table_value, column_name, extract_grouped_data
|
|
10
10
|
from hestia_earth.utils.model import filter_list_term_type
|
|
11
11
|
from hestia_earth.utils.tools import list_sum, safe_parse_float
|
|
@@ -35,7 +35,7 @@ REQUIREMENTS = {
|
|
|
35
35
|
}],
|
|
36
36
|
"animals": [{
|
|
37
37
|
"@type": "Animal",
|
|
38
|
-
"value": "",
|
|
38
|
+
"value": "> 0",
|
|
39
39
|
"term.termType": "liveAnimal",
|
|
40
40
|
"referencePeriod": "average",
|
|
41
41
|
"properties": [{
|
|
@@ -389,24 +389,23 @@ def _pastureGrass_key_property_value(practice: dict, column: dict):
|
|
|
389
389
|
|
|
390
390
|
def _calculate_meanDE(cycle: dict, practices: list):
|
|
391
391
|
values = list(map(lambda p: _pastureGrass_key_property_value(p, 'energyDigestibilityRuminants'), practices))
|
|
392
|
-
|
|
392
|
+
total_weight = sum([weight/100 for _value, weight in values])
|
|
393
|
+
meanDE = sum([
|
|
393
394
|
value * weight/100 for value, weight in values
|
|
394
|
-
]) /
|
|
395
|
-
weight/100 for _value, weight in values
|
|
396
|
-
])
|
|
395
|
+
]) / total_weight if total_weight > 0 else 0
|
|
397
396
|
|
|
398
397
|
debugValues(cycle, model=MODEL_LOG, term=MODEL_KEY,
|
|
399
|
-
meanDE=
|
|
398
|
+
meanDE=meanDE)
|
|
400
399
|
|
|
401
|
-
return
|
|
400
|
+
return meanDE
|
|
402
401
|
|
|
403
402
|
|
|
404
403
|
def _calculate_REM(meanDE: float):
|
|
405
|
-
return 1.123 - (4.092/1000 * meanDE) + (1.126/100000 * pow(meanDE, 2)) - (25.4/meanDE)
|
|
404
|
+
return 1.123 - (4.092/1000 * meanDE) + (1.126/100000 * pow(meanDE, 2)) - (25.4/meanDE) if meanDE > 0 else 0
|
|
406
405
|
|
|
407
406
|
|
|
408
407
|
def _calculate_REG(meanDE: float):
|
|
409
|
-
return 1.164 - (5.16/1000 * meanDE) + (1.308/100000 * pow(meanDE, 2)) - (37.4/meanDE)
|
|
408
|
+
return 1.164 - (5.16/1000 * meanDE) + (1.308/100000 * pow(meanDE, 2)) - (37.4/meanDE) if meanDE > 0 else 0
|
|
410
409
|
|
|
411
410
|
|
|
412
411
|
def _calculate_feed_meanDE(cycle: dict, input: dict):
|
|
@@ -453,7 +452,7 @@ def _calculate_NEfeed_g(cycle: dict, input: dict, meanDE: float):
|
|
|
453
452
|
def _calculate_NEfeed(cycle: dict):
|
|
454
453
|
inputs = [i for i in cycle.get('inputs', []) if all([
|
|
455
454
|
len(i.get('value')) > 0,
|
|
456
|
-
i.get('
|
|
455
|
+
i.get('isAnimalFeed', False) is True
|
|
457
456
|
])]
|
|
458
457
|
# calculate meanDE for each input first
|
|
459
458
|
inputs = [(input, _calculate_feed_meanDE(cycle, input)) for input in inputs]
|
|
@@ -468,7 +467,11 @@ def _calculate_NEfeed(cycle: dict):
|
|
|
468
467
|
|
|
469
468
|
|
|
470
469
|
def _calculate_GE(cycle: dict, meanDE: float, system: dict):
|
|
471
|
-
animals = [
|
|
470
|
+
animals = [
|
|
471
|
+
a for a in cycle.get('animals', []) if all([
|
|
472
|
+
a.get('value') and a.get('referencePeriod') == AnimalReferencePeriod.AVERAGE.value
|
|
473
|
+
])
|
|
474
|
+
]
|
|
472
475
|
|
|
473
476
|
# calculate NEm first and re-use in other places
|
|
474
477
|
animals = [(animal, _calculate_NEm(cycle, animal)) for animal in animals]
|
|
@@ -557,6 +560,7 @@ def _should_run_practice(cycle: dict):
|
|
|
557
560
|
def _should_run(cycle: dict, practices: dict):
|
|
558
561
|
systems = filter_list_term_type(cycle.get('practices', []), TermTermType.SYSTEM)
|
|
559
562
|
animalFeed_incomplete = _is_term_type_incomplete(cycle, {'termType': 'animalFeed'})
|
|
563
|
+
all_animals_have_value = all([a.get('value', 0) > 0 for a in cycle.get('animals', [])])
|
|
560
564
|
|
|
561
565
|
meanDE = _calculate_meanDE(cycle, practices)
|
|
562
566
|
meanECHHV = _calculate_meanECHHV(cycle, practices)
|
|
@@ -564,11 +568,14 @@ def _should_run(cycle: dict, practices: dict):
|
|
|
564
568
|
|
|
565
569
|
logRequirements(cycle, model=MODEL_LOG, term_id=MODEL_KEY,
|
|
566
570
|
animalFeed_incomplete=animalFeed_incomplete,
|
|
571
|
+
all_animals_have_value=all_animals_have_value,
|
|
567
572
|
meanDE=meanDE,
|
|
568
573
|
meanECHHV=meanECHHV,
|
|
569
574
|
GE=GE)
|
|
570
575
|
|
|
571
|
-
should_run = all([
|
|
576
|
+
should_run = all([
|
|
577
|
+
animalFeed_incomplete, all_animals_have_value, len(systems) > 0, len(practices) > 0, GE > 0, meanECHHV > 0
|
|
578
|
+
])
|
|
572
579
|
logShouldRun(cycle, MODEL_LOG, MODEL_KEY, should_run)
|
|
573
580
|
return should_run, GE, meanECHHV
|
|
574
581
|
|
|
@@ -21,7 +21,7 @@ REQUIREMENTS = {
|
|
|
21
21
|
"@type": "Practice",
|
|
22
22
|
"term.@id": ["residueBurnt", "residueLeftOnField", "residueRemoved"],
|
|
23
23
|
"added": ["value"],
|
|
24
|
-
"
|
|
24
|
+
"model.@id": "koble2014"
|
|
25
25
|
}]
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -36,7 +36,7 @@ MODEL_LOG = '/'.join([MODEL, MODEL_KEY])
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
def _is_recalculated(practice: dict):
|
|
39
|
-
return practice.get('
|
|
39
|
+
return practice.get('model', {}).get('@id') == MODEL and is_from_model(practice)
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
def _run_practice(cycle: dict, ratio: float, practice: dict):
|
|
@@ -22,164 +22,164 @@
|
|
|
22
22
|
"codToWaterIndustrialProcesses",
|
|
23
23
|
"nToSurfaceWaterSoilFlux",
|
|
24
24
|
"dichlorodifluoromethaneToAirInputsProduction",
|
|
25
|
-
"bromochlorodifluoromethaneToAirInputsProduction",
|
|
26
|
-
"co2ToAirUreaHydrolysis",
|
|
27
|
-
"noToAirExcreta",
|
|
28
25
|
"nh3ToAirCropResidueDecomposition",
|
|
29
26
|
"po43ToSurfaceWaterInorganicFertiliser",
|
|
30
27
|
"bod5ToWaterInputsProduction",
|
|
31
|
-
"no3ToGroundwaterInorganicFertiliser",
|
|
32
|
-
"noToAirInorganicFertiliser",
|
|
33
|
-
"nh4ToGroundwaterExcreta",
|
|
34
28
|
"n2OToAirWasteTreatmentIndirect",
|
|
35
29
|
"n2ToAirWasteTreatment",
|
|
30
|
+
"noToAirInorganicFertiliser",
|
|
31
|
+
"nh4ToGroundwaterExcreta",
|
|
32
|
+
"bromochlorodifluoromethaneToAirInputsProduction",
|
|
36
33
|
"n2OToAirCropResidueDecompositionIndirect",
|
|
37
34
|
"nh3ToAirOrganicSoilCultivation",
|
|
38
35
|
"po43ToGroundwaterInorganicFertiliser",
|
|
36
|
+
"noToAirExcreta",
|
|
37
|
+
"no3ToGroundwaterInorganicFertiliser",
|
|
38
|
+
"co2ToAirUreaHydrolysis",
|
|
39
|
+
"n2OToAirInputsProduction",
|
|
39
40
|
"nmvocToAirSilageStorage",
|
|
40
41
|
"n2OToAirCropResidueBurningIndirect",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"n2ToAirExcreta",
|
|
42
|
+
"nh4ToGroundwaterInorganicFertiliser",
|
|
43
|
+
"ch4ToAirFuelCombustion",
|
|
44
44
|
"nmvocToAirAnimalHousing",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"noToAirWasteTreatment",
|
|
49
|
-
"n2OToAirFuelCombustionDirect",
|
|
45
|
+
"nh3ToAirFuelCombustion",
|
|
46
|
+
"po43ToSurfaceWaterInputsProduction",
|
|
47
|
+
"noxToAirCropResidueDecomposition",
|
|
50
48
|
"pToSurfaceWaterSoilFlux",
|
|
49
|
+
"noToAirSoilFlux",
|
|
51
50
|
"nh3ToAirInputsProduction",
|
|
52
|
-
"n2ToAirOrganicFertiliser",
|
|
53
51
|
"pm25ToAirAnimalHousing",
|
|
54
|
-
"pToGroundwaterSoilFlux",
|
|
55
|
-
"n2OToAirCropResidueDecompositionDirect",
|
|
56
52
|
"po43ToSurfaceWaterSoilFlux",
|
|
57
53
|
"noToAirAquacultureSystems",
|
|
58
54
|
"ch4ToAirOrganicSoilCultivation",
|
|
59
55
|
"co2ToAirSoilFlux",
|
|
60
|
-
"n2OToAirInputsProduction",
|
|
61
56
|
"nh4ToGroundwaterOrganicFertiliser",
|
|
62
57
|
"co2ToAirAboveGroundBiomassStockChange",
|
|
63
|
-
"
|
|
58
|
+
"noxToAirOrganicSoilCultivation",
|
|
59
|
+
"nToSurfaceWaterAquacultureSystems",
|
|
64
60
|
"noxToAirFuelCombustion",
|
|
65
|
-
"
|
|
61
|
+
"n2ToAirExcreta",
|
|
66
62
|
"nmvocToAirExcreta",
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
63
|
+
"noxToAirInorganicFertiliser",
|
|
64
|
+
"n2OToAirExcretaDirect",
|
|
65
|
+
"ch4ToAirWasteTreatment",
|
|
66
|
+
"noToAirWasteTreatment",
|
|
67
|
+
"n2OToAirFuelCombustionDirect",
|
|
68
|
+
"n2ToAirOrganicFertiliser",
|
|
69
|
+
"pToGroundwaterSoilFlux",
|
|
70
|
+
"n2OToAirCropResidueDecompositionDirect",
|
|
71
71
|
"co2ToAirNaturalVegetationBurning",
|
|
72
72
|
"noToAirCropResidueBurning",
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"pm25ToAirFuelCombustion",
|
|
77
|
-
"pm25ToAirInputsProduction",
|
|
78
|
-
"11DichlorotetrafluoroethaneToAirInputsProduction",
|
|
73
|
+
"bod5ToWaterIndustrialProcesses",
|
|
74
|
+
"n2OToAirCropResidueBurningDirect",
|
|
75
|
+
"co2ToAirInputsProduction",
|
|
79
76
|
"pToDrainageWaterInputsProduction",
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"n2OToAirInorganicFertiliserIndirect",
|
|
83
|
-
"ch4ToAirAquacultureSystems",
|
|
84
|
-
"noxToAirSoilFlux",
|
|
77
|
+
"n2OToAirOrganicSoilBurningDirect",
|
|
78
|
+
"noxToAirWasteTreatment",
|
|
85
79
|
"ch4ToAirOrganicSoilBurning",
|
|
86
80
|
"po43ToGroundwaterOrganicFertiliser",
|
|
87
81
|
"n2OToAirWasteTreatmentDirect",
|
|
88
82
|
"pErosionInputsProduction",
|
|
89
|
-
"
|
|
90
|
-
"
|
|
83
|
+
"nh4ToGroundwaterInputsProduction",
|
|
84
|
+
"nh4ToGroundwaterCropResidueDecomposition",
|
|
85
|
+
"nh3ToAirExcreta",
|
|
91
86
|
"nErosionInputsProduction",
|
|
92
87
|
"nh3ToAirInorganicFertiliser",
|
|
88
|
+
"pToSurfaceWaterInputsProduction",
|
|
89
|
+
"co2ToAirBelowGroundBiomassStockChange",
|
|
90
|
+
"nh3ToAirAquacultureSystems",
|
|
91
|
+
"n2OToAirFuelCombustionIndirect",
|
|
92
|
+
"nmvocToAirInputsProduction",
|
|
93
93
|
"nh3ToAirCropResidueBurning",
|
|
94
94
|
"co2ToAirOrganicSoilBurning",
|
|
95
|
-
"
|
|
95
|
+
"codToWaterInputsProduction",
|
|
96
96
|
"po43ToGroundwaterSoilFlux",
|
|
97
|
-
"
|
|
97
|
+
"noToAirCropResidueDecomposition",
|
|
98
98
|
"co2ToAirLimeHydrolysis",
|
|
99
|
-
"
|
|
99
|
+
"hexaneToAirIndustrialProcesses",
|
|
100
|
+
"so2ToAirInputsProduction",
|
|
101
|
+
"h2SToAirIndustrialProcesses",
|
|
102
|
+
"pm25ToAirFuelCombustion",
|
|
103
|
+
"pm25ToAirInputsProduction",
|
|
104
|
+
"11DichlorotetrafluoroethaneToAirInputsProduction",
|
|
100
105
|
"n2OToAirAquacultureSystemsIndirect",
|
|
101
|
-
"n2OToAirCropResidueBurningDirect",
|
|
102
|
-
"co2ToAirInputsProduction",
|
|
103
106
|
"po43ToSurfaceWaterOrganicFertiliser",
|
|
104
107
|
"n2OToAirOrganicFertiliserIndirect",
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
108
|
+
"no3ToSurfaceWaterAquacultureSystems",
|
|
109
|
+
"noToAirInputsProduction",
|
|
110
|
+
"n2OToAirInorganicFertiliserIndirect",
|
|
111
|
+
"ch4ToAirAquacultureSystems",
|
|
112
|
+
"noxToAirSoilFlux",
|
|
113
|
+
"ch4ToAirCropResidueBurning",
|
|
114
|
+
"ch4ToAirNaturalVegetationBurning",
|
|
115
|
+
"ch4ToAirSoilFlux",
|
|
116
|
+
"nh3ToAirNaturalVegetationBurning",
|
|
117
|
+
"n2OToAirOrganicSoilCultivationDirect",
|
|
118
|
+
"1112TetrafluoroethaneToAirInputsProduction",
|
|
119
|
+
"no3ToGroundwaterExcreta",
|
|
120
|
+
"n2OToAirOrganicSoilBurningIndirect",
|
|
121
|
+
"nmvocToAirFuelCombustion",
|
|
122
|
+
"pm10ToAirFuelCombustion",
|
|
123
|
+
"noxToAirCropResidueBurning",
|
|
124
|
+
"nh3ToAirOrganicSoilBurning",
|
|
125
|
+
"noToAirOrganicFertiliser",
|
|
126
|
+
"no3ToSurfaceWaterIndustrialProcesses",
|
|
127
|
+
"chlorodifluoromethaneToAirInputsProduction",
|
|
128
|
+
"n2OToAirSoilFlux",
|
|
129
|
+
"n2OToAirAquacultureSystemsDirect",
|
|
130
|
+
"n2OToAirOrganicSoilCultivationIndirect",
|
|
131
|
+
"nh4ToSurfaceWaterAquacultureSystems",
|
|
132
|
+
"nToSurfaceWaterInputsProduction",
|
|
133
|
+
"no3ToGroundwaterCropResidueDecomposition",
|
|
134
|
+
"no3ToGroundwaterSoilFlux",
|
|
135
|
+
"n2OToAirBackgroundSoilFluxDirect",
|
|
136
|
+
"noxToAirOrganicFertiliser",
|
|
137
|
+
"noxToAirNaturalVegetationBurning",
|
|
138
|
+
"nErosionSoilFlux",
|
|
139
|
+
"n2ToAirSoilFlux",
|
|
140
|
+
"no3ToGroundwaterWasteTreatment",
|
|
141
|
+
"co2ToAirSoilCarbonStockChange",
|
|
142
|
+
"n2ToAirAquacultureSystems",
|
|
143
|
+
"nh4ToGroundwaterWasteTreatment",
|
|
144
|
+
"so2ToAirFuelCombustion",
|
|
145
|
+
"ch4ToAirExcreta",
|
|
146
|
+
"noxToAirAquacultureSystems",
|
|
115
147
|
"n2ToAirCropResidueDecomposition",
|
|
116
148
|
"nmvocToAirWasteTreatment",
|
|
149
|
+
"pToGroundwaterInputsProduction",
|
|
150
|
+
"ch4ToAirEntericFermentation",
|
|
151
|
+
"nh3ToAirWasteTreatment",
|
|
152
|
+
"no3ToGroundwaterOrganicFertiliser",
|
|
153
|
+
"n2OToAirDiminishingSoilCarbonStocksDirect",
|
|
154
|
+
"no3ToSurfaceWaterInputsProduction",
|
|
155
|
+
"n2OToAirOrganicFertiliserDirect",
|
|
156
|
+
"no3ToGroundwaterInputsProduction",
|
|
157
|
+
"noxToAirOrganicSoilBurning",
|
|
158
|
+
"noxToAirInputsProduction",
|
|
159
|
+
"n2OToAirNaturalVegetationBurningDirect",
|
|
160
|
+
"h2SToAirInputsProduction",
|
|
161
|
+
"pToSurfaceWaterAquacultureSystems",
|
|
117
162
|
"co2ToAirFuelCombustion",
|
|
118
163
|
"pErosionSoilFlux",
|
|
119
164
|
"nmvocToAirSilageFeeding",
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
165
|
+
"ch4ToAirFloodedRice",
|
|
166
|
+
"nh3ToAirSoilFlux",
|
|
167
|
+
"hexaneToAirInputsProduction",
|
|
123
168
|
"nh4ToSurfaceWaterInputsProduction",
|
|
124
169
|
"ch4ToAirInputsProductionNonFossil",
|
|
170
|
+
"pm10ToAirInputsProduction",
|
|
125
171
|
"n2OToAirInorganicFertiliserDirect",
|
|
126
172
|
"ch4ToAirInputsProductionFossil",
|
|
127
173
|
"n2ToAirInorganicFertiliser",
|
|
128
|
-
"noxToAirInputsProduction",
|
|
129
|
-
"n2OToAirNaturalVegetationBurningDirect",
|
|
130
|
-
"h2SToAirInputsProduction",
|
|
131
174
|
"co2ToAirOrganicSoilCultivation",
|
|
175
|
+
"112TrichlorotrifluoroethaneToAirInputsProduction",
|
|
132
176
|
"nh3ToAirOrganicFertiliser",
|
|
177
|
+
"pm10ToAirAnimalHousing",
|
|
133
178
|
"n2OToAirExcretaIndirect",
|
|
134
179
|
"noxToAirExcreta",
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"nh3ToAirWasteTreatment",
|
|
139
|
-
"no3ToGroundwaterOrganicFertiliser",
|
|
140
|
-
"hexaneToAirInputsProduction",
|
|
141
|
-
"n2OToAirDiminishingSoilCarbonStocksDirect",
|
|
142
|
-
"no3ToSurfaceWaterInputsProduction",
|
|
143
|
-
"pm10ToAirInputsProduction",
|
|
144
|
-
"n2OToAirOrganicFertiliserDirect",
|
|
145
|
-
"no3ToGroundwaterInputsProduction",
|
|
146
|
-
"noxToAirOrganicSoilBurning",
|
|
147
|
-
"112TrichlorotrifluoroethaneToAirInputsProduction",
|
|
148
|
-
"pToSurfaceWaterAquacultureSystems",
|
|
149
|
-
"pm10ToAirAnimalHousing",
|
|
150
|
-
"ch4ToAirFloodedRice",
|
|
151
|
-
"nh4ToSurfaceWaterAquacultureSystems",
|
|
152
|
-
"nToSurfaceWaterInputsProduction",
|
|
153
|
-
"no3ToGroundwaterCropResidueDecomposition",
|
|
154
|
-
"no3ToGroundwaterSoilFlux",
|
|
155
|
-
"n2OToAirOrganicSoilCultivationDirect",
|
|
156
|
-
"n2OToAirBackgroundSoilFluxDirect",
|
|
157
|
-
"nmvocToAirFuelCombustion",
|
|
158
|
-
"pm10ToAirFuelCombustion",
|
|
159
|
-
"noxToAirCropResidueBurning",
|
|
160
|
-
"nErosionSoilFlux",
|
|
161
|
-
"n2ToAirSoilFlux",
|
|
162
|
-
"nh3ToAirOrganicSoilBurning",
|
|
163
|
-
"no3ToGroundwaterWasteTreatment",
|
|
164
|
-
"co2ToAirSoilCarbonStockChange",
|
|
165
|
-
"noToAirOrganicFertiliser",
|
|
166
|
-
"no3ToSurfaceWaterIndustrialProcesses",
|
|
167
|
-
"n2OToAirSoilFlux",
|
|
168
|
-
"n2ToAirAquacultureSystems",
|
|
169
|
-
"n2OToAirAquacultureSystemsDirect",
|
|
170
|
-
"noxToAirAquacultureSystems",
|
|
171
|
-
"ch4ToAirSoilFlux",
|
|
172
|
-
"nh3ToAirNaturalVegetationBurning",
|
|
173
|
-
"1112TetrafluoroethaneToAirInputsProduction",
|
|
174
|
-
"no3ToGroundwaterExcreta",
|
|
175
|
-
"noxToAirOrganicFertiliser",
|
|
176
|
-
"n2OToAirOrganicSoilBurningIndirect",
|
|
177
|
-
"noxToAirNaturalVegetationBurning",
|
|
178
|
-
"chlorodifluoromethaneToAirInputsProduction",
|
|
179
|
-
"n2OToAirOrganicSoilCultivationIndirect",
|
|
180
|
-
"nh4ToGroundwaterWasteTreatment",
|
|
181
|
-
"so2ToAirFuelCombustion",
|
|
182
|
-
"ch4ToAirExcreta"
|
|
180
|
+
"po43ToSurfaceWaterAquacultureSystems",
|
|
181
|
+
"nh4ToGroundwaterSoilFlux",
|
|
182
|
+
"n2OToAirNaturalVegetationBurningIndirect"
|
|
183
183
|
]
|
|
184
184
|
},
|
|
185
185
|
{
|
|
@@ -201,14 +201,14 @@
|
|
|
201
201
|
}
|
|
202
202
|
},
|
|
203
203
|
"results": [
|
|
204
|
-
"residueIncorporated",
|
|
205
204
|
"residueIncorporatedLessThan30DaysBeforeCultivation",
|
|
205
|
+
"residueIncorporated",
|
|
206
206
|
"residueRemoved",
|
|
207
207
|
"residueBurntBeforeAllowingForCombustionFactor",
|
|
208
208
|
"residueIncorporatedMoreThan30DaysBeforeCultivation",
|
|
209
|
-
"residueBurnt",
|
|
210
209
|
"residueLeftOnField",
|
|
211
|
-
"pastureRenewed"
|
|
210
|
+
"pastureRenewed",
|
|
211
|
+
"residueBurnt"
|
|
212
212
|
]
|
|
213
213
|
},
|
|
214
214
|
{
|
|
@@ -222,12 +222,12 @@
|
|
|
222
222
|
"discardedCropTotal",
|
|
223
223
|
"discardedCropIncorporated",
|
|
224
224
|
"aboveGroundCropResidueRemoved",
|
|
225
|
-
"aboveGroundCropResidueIncorporated",
|
|
226
225
|
"discardedCropRemoved",
|
|
227
226
|
"aboveGroundCropResidueTotal",
|
|
227
|
+
"aboveGroundCropResidueIncorporated",
|
|
228
|
+
"aboveGroundCropResidueBurnt",
|
|
228
229
|
"belowGroundCropResidue",
|
|
229
|
-
"aboveGroundCropResidueLeftOnField"
|
|
230
|
-
"aboveGroundCropResidueBurnt"
|
|
230
|
+
"aboveGroundCropResidueLeftOnField"
|
|
231
231
|
]
|
|
232
232
|
},
|
|
233
233
|
{
|
|
@@ -258,9 +258,9 @@
|
|
|
258
258
|
},
|
|
259
259
|
"results": [
|
|
260
260
|
"digestibleEnergyRabbits",
|
|
261
|
-
"digestibleEnergyPigs",
|
|
262
|
-
"digestibleEnergySalmonids",
|
|
263
261
|
"digestibleEnergyRuminants",
|
|
262
|
+
"digestibleEnergySalmonids",
|
|
263
|
+
"digestibleEnergyPigs",
|
|
264
264
|
"digestibleEnergyPoultry",
|
|
265
265
|
"digestibleEnergyAquaticSpecies",
|
|
266
266
|
"digestibleEnergyOtherAnimals"
|
|
@@ -293,13 +293,13 @@
|
|
|
293
293
|
}
|
|
294
294
|
},
|
|
295
295
|
"results": [
|
|
296
|
-
"energyDigestibilityRabbits",
|
|
297
296
|
"energyDigestibilityPigs",
|
|
298
|
-
"
|
|
299
|
-
"energyDigestibilityOtherAnimals",
|
|
300
|
-
"energyDigestibilityRuminants",
|
|
297
|
+
"energyDigestibilityRabbits",
|
|
301
298
|
"energyDigestibilitySalmonids",
|
|
302
|
-
"
|
|
299
|
+
"energyDigestibilityRuminants",
|
|
300
|
+
"energyDigestibilityPoultry",
|
|
301
|
+
"energyDigestibilityAquaticSpecies",
|
|
302
|
+
"energyDigestibilityOtherAnimals"
|
|
303
303
|
]
|
|
304
304
|
},
|
|
305
305
|
{
|
|
@@ -312,13 +312,13 @@
|
|
|
312
312
|
"excretaBeefCattleFeedlotFedKgN",
|
|
313
313
|
"excretaKgN",
|
|
314
314
|
"excretaGeeseKgN",
|
|
315
|
-
"excretaSolidAndLiquidFishCrustaceansKgN",
|
|
316
|
-
"excretaBuffaloKgN",
|
|
317
315
|
"excretaSolidFishCrustaceansKgN",
|
|
318
316
|
"excretaPoultryKgN",
|
|
319
317
|
"excretaSheepAndGoatsKgN",
|
|
320
318
|
"excretaDucksKgN",
|
|
321
319
|
"excretaBeefCattleExceptFeedlotFedKgN",
|
|
320
|
+
"excretaSolidAndLiquidFishCrustaceansKgN",
|
|
321
|
+
"excretaBuffaloKgN",
|
|
322
322
|
"excretaHorsesMulesAndAssesKgN",
|
|
323
323
|
"excretaPigsKgN",
|
|
324
324
|
"excretaCamelsKgN",
|
|
@@ -389,14 +389,14 @@
|
|
|
389
389
|
}
|
|
390
390
|
},
|
|
391
391
|
"results": [
|
|
392
|
-
"motorGasoline",
|
|
393
392
|
"diesel1D",
|
|
394
|
-
"
|
|
395
|
-
"diesel4D",
|
|
396
|
-
"en590Diesel",
|
|
397
|
-
"aviationGasoline",
|
|
393
|
+
"motorGasoline",
|
|
398
394
|
"gasolineTypeJetFuel",
|
|
399
|
-
"diesel"
|
|
395
|
+
"diesel",
|
|
396
|
+
"aviationGasoline",
|
|
397
|
+
"en590Diesel",
|
|
398
|
+
"diesel4D",
|
|
399
|
+
"diesel2D"
|
|
400
400
|
]
|
|
401
401
|
},
|
|
402
402
|
{
|
|
@@ -426,14 +426,14 @@
|
|
|
426
426
|
}
|
|
427
427
|
},
|
|
428
428
|
"results": [
|
|
429
|
+
"milkYieldPerCowRaw",
|
|
429
430
|
"milkYieldPerBuffaloFpcm",
|
|
430
|
-
"milkYieldPerSheepRaw",
|
|
431
431
|
"milkYieldPerGoatRaw",
|
|
432
|
-
"
|
|
433
|
-
"milkYieldPerBuffaloRaw",
|
|
434
|
-
"milkYieldPerCamelRaw",
|
|
432
|
+
"milkYieldPerSheepRaw",
|
|
435
433
|
"milkYieldPerCowFpcm",
|
|
436
|
-
"milkYieldPerSheepFpcm"
|
|
434
|
+
"milkYieldPerSheepFpcm",
|
|
435
|
+
"milkYieldPerCamelRaw",
|
|
436
|
+
"milkYieldPerBuffaloRaw"
|
|
437
437
|
]
|
|
438
438
|
},
|
|
439
439
|
{
|
|
@@ -465,8 +465,8 @@
|
|
|
465
465
|
}
|
|
466
466
|
},
|
|
467
467
|
"results": [
|
|
468
|
-
"
|
|
469
|
-
"
|
|
468
|
+
"riceGrainInHuskFlooded",
|
|
469
|
+
"ricePlantFlooded"
|
|
470
470
|
]
|
|
471
471
|
},
|
|
472
472
|
{
|
|
@@ -476,13 +476,13 @@
|
|
|
476
476
|
"name": "tillage"
|
|
477
477
|
},
|
|
478
478
|
"results": [
|
|
479
|
+
"mulchTillage",
|
|
480
|
+
"stripTillage",
|
|
481
|
+
"deepTillage",
|
|
479
482
|
"minimumTillage",
|
|
480
483
|
"fullTillage",
|
|
481
|
-
"noTillage",
|
|
482
484
|
"ridgeTillage",
|
|
483
|
-
"
|
|
484
|
-
"stripTillage",
|
|
485
|
-
"mulchTillage",
|
|
485
|
+
"noTillage",
|
|
486
486
|
"fullInversionTillage"
|
|
487
487
|
]
|
|
488
488
|
},
|
|
@@ -569,8 +569,8 @@
|
|
|
569
569
|
}
|
|
570
570
|
},
|
|
571
571
|
"results": [
|
|
572
|
-
"
|
|
573
|
-
"
|
|
572
|
+
"woolGoatGreasy",
|
|
573
|
+
"woolSheepGreasy"
|
|
574
574
|
]
|
|
575
575
|
}
|
|
576
576
|
]
|
|
@@ -33,7 +33,7 @@ REQUIREMENTS = {
|
|
|
33
33
|
"term.termType": ["crop", "animalProduct", "feedFoodAdditive"],
|
|
34
34
|
"term.units": "kg",
|
|
35
35
|
"value": "> 0",
|
|
36
|
-
"
|
|
36
|
+
"isAnimalFeed": "True",
|
|
37
37
|
"optional": {
|
|
38
38
|
"properties": [
|
|
39
39
|
{"@type": "Property", "value": "", "term.@id": "nitrogenContent"},
|
|
@@ -35,7 +35,7 @@ REQUIREMENTS = {
|
|
|
35
35
|
"term.termType": ["crop", "animalProduct", "feedFoodAdditive"],
|
|
36
36
|
"term.units": "kg",
|
|
37
37
|
"value": "> 0",
|
|
38
|
-
"
|
|
38
|
+
"isAnimalFeed": "True",
|
|
39
39
|
"optional": {
|
|
40
40
|
"properties": [
|
|
41
41
|
{"@type": "Property", "value": "", "term.@id": "carbonContent"},
|
|
@@ -19,6 +19,16 @@ def _term_id(term): return term.get('@id') if isinstance(term, dict) else term
|
|
|
19
19
|
def _omit(values: dict, keys: list): return {k: v for k, v in values.items() if k not in keys}
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
def _include_model(node: dict, term_id: str):
|
|
23
|
+
term = download_hestia(term_id) or {}
|
|
24
|
+
return {**node, **({} if term.get('@id') is None else {'model': linked_node(term)})}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _include_method(node: dict, term_id: str):
|
|
28
|
+
term = download_hestia(term_id) or {}
|
|
29
|
+
return {**node, **({} if term.get('@id') is None else {'method': linked_node(term)})}
|
|
30
|
+
|
|
31
|
+
|
|
22
32
|
def _include_methodModel(node: dict, term_id: str):
|
|
23
33
|
term = download_hestia(term_id) or {}
|
|
24
34
|
return {**node, **({} if term.get('@id') is None else {'methodModel': linked_node(term)})}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
from hestia_earth.schema import SchemaType, TermTermType
|
|
1
|
+
from hestia_earth.schema import SchemaType, TermTermType
|
|
2
2
|
from hestia_earth.utils.api import download_hestia
|
|
3
3
|
from hestia_earth.utils.model import find_term_match, linked_node, filter_list_term_type
|
|
4
4
|
from hestia_earth.utils.tools import list_sum, non_empty_list, list_average
|
|
5
5
|
from hestia_earth.utils.lookup import download_lookup, get_table_value, column_name
|
|
6
6
|
|
|
7
7
|
from ..log import debugValues, logger
|
|
8
|
-
from . import _term_id,
|
|
8
|
+
from . import _term_id, _include_model, _filter_list_term_unit, _load_calculated_node
|
|
9
9
|
from .constant import Units
|
|
10
10
|
from .property import get_node_property_value, get_node_property_value_converted
|
|
11
11
|
from .blank_node import get_total_value, get_total_value_converted
|
|
@@ -14,7 +14,7 @@ from .blank_node import get_total_value, get_total_value_converted
|
|
|
14
14
|
def _new_input(term, model=None):
|
|
15
15
|
node = {'@type': SchemaType.INPUT.value}
|
|
16
16
|
node['term'] = linked_node(term if isinstance(term, dict) else download_hestia(_term_id(term)))
|
|
17
|
-
return
|
|
17
|
+
return _include_model(node, model)
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
def load_impacts(inputs: list):
|
|
@@ -103,10 +103,7 @@ def _get_feed_inputs(inputs: list, termTypes: list = _FEED_DEFAULT_TERM_TYPES):
|
|
|
103
103
|
return [input for input in inputs if all([
|
|
104
104
|
input.get('term', {}).get('units') == Units.KG.value,
|
|
105
105
|
input.get('term', {}).get('termType') in termTypes,
|
|
106
|
-
input.get('
|
|
107
|
-
InputFate.FED_TO_ANIMALS.value,
|
|
108
|
-
InputFate.GRAZED.value
|
|
109
|
-
]
|
|
106
|
+
input.get('isAnimalFeed', False) is True
|
|
110
107
|
])]
|
|
111
108
|
|
|
112
109
|
|
|
@@ -4,7 +4,7 @@ from hestia_earth.schema import SchemaType
|
|
|
4
4
|
from hestia_earth.utils.api import download_hestia
|
|
5
5
|
from hestia_earth.utils.model import linked_node
|
|
6
6
|
|
|
7
|
-
from . import _term_id,
|
|
7
|
+
from . import _term_id, _include_method, _include_source
|
|
8
8
|
from .term import get_lookup_value
|
|
9
9
|
|
|
10
10
|
# TODO verify those values
|
|
@@ -21,7 +21,7 @@ MEASUREMENT_REDUCE = {
|
|
|
21
21
|
def _new_measurement(term, model=None, biblio_title=None):
|
|
22
22
|
node = {'@type': SchemaType.MEASUREMENT.value}
|
|
23
23
|
node['term'] = linked_node(term if isinstance(term, dict) else download_hestia(_term_id(term)))
|
|
24
|
-
return
|
|
24
|
+
return _include_method(_include_source(node, biblio_title), model)
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def measurement_value(measurement: dict, is_larger_unit: bool = False) -> float:
|
|
@@ -2,14 +2,14 @@ from hestia_earth.schema import SchemaType
|
|
|
2
2
|
from hestia_earth.utils.api import download_hestia
|
|
3
3
|
from hestia_earth.utils.model import linked_node
|
|
4
4
|
|
|
5
|
-
from . import _term_id,
|
|
5
|
+
from . import _term_id, _include_model
|
|
6
6
|
from .term import get_lookup_value
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def _new_practice(term, model=None):
|
|
10
10
|
node = {'@type': SchemaType.PRACTICE.value}
|
|
11
11
|
node['term'] = linked_node(term if isinstance(term, dict) else download_hestia(_term_id(term)))
|
|
12
|
-
return
|
|
12
|
+
return _include_model(node, model)
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
def is_model_enabled(model: str, term_id: str, practice: dict = None):
|
|
@@ -4,7 +4,7 @@ from hestia_earth.utils.model import filter_list_term_type, find_term_match, lin
|
|
|
4
4
|
from hestia_earth.utils.tools import flatten, list_sum
|
|
5
5
|
|
|
6
6
|
from hestia_earth.models.utils.blank_node import get_total_value, get_total_value_converted
|
|
7
|
-
from . import _term_id,
|
|
7
|
+
from . import _term_id, _include_model
|
|
8
8
|
from .constant import Units
|
|
9
9
|
from .currency import DEFAULT_CURRENCY
|
|
10
10
|
from .property import _get_nitrogen_content, get_node_property
|
|
@@ -19,7 +19,7 @@ def _new_product(term, value: float = 0, model=None):
|
|
|
19
19
|
node['economicValueShare'] = 0
|
|
20
20
|
node['revenue'] = 0
|
|
21
21
|
node['currency'] = DEFAULT_CURRENCY
|
|
22
|
-
return
|
|
22
|
+
return _include_model(node, model)
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
def has_flooded_rice(products: list):
|
hestia_earth/models/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
VERSION = '0.
|
|
1
|
+
VERSION = '0.44.1'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hestia-earth-models
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.44.1
|
|
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
|
|
@@ -11,8 +11,8 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.6
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist: hestia-earth.schema (
|
|
15
|
-
Requires-Dist: hestia-earth.utils (>=0.11.
|
|
14
|
+
Requires-Dist: hestia-earth.schema (~=18.0.1)
|
|
15
|
+
Requires-Dist: hestia-earth.utils (>=0.11.1)
|
|
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)
|
|
@@ -2,7 +2,7 @@ hestia_earth/__init__.py,sha256=G-d438vPx7m_ks5e9XTtM3u7LDRO5dSSukibukWmyPM,56
|
|
|
2
2
|
hestia_earth/models/__init__.py,sha256=qEFeq3yuf3lQKVseALmL8aPM8fpCS54B_5pry00M3hk,76
|
|
3
3
|
hestia_earth/models/log.py,sha256=rOgKa-gSrcS-Y1gO9eJXJaA3ofxcQW_45hGly2Lf00Y,2444
|
|
4
4
|
hestia_earth/models/requirements.py,sha256=znNZJAhwX2iYiKcAQXPftY7z_1MsNa0QxCXkXyHm_U0,17363
|
|
5
|
-
hestia_earth/models/version.py,sha256=
|
|
5
|
+
hestia_earth/models/version.py,sha256=_vVlCNH6wY4Hmj0gYEUhDwK6UFJdVkvCtP51PirWesQ,19
|
|
6
6
|
hestia_earth/models/agribalyse2016/__init__.py,sha256=WvK0qCQbnYtg9oZxrACd1wGormZyXibPtpCnIQeDqbw,415
|
|
7
7
|
hestia_earth/models/agribalyse2016/fuelElectricity.py,sha256=ztMnY6XTwsJD-lp62jJyzN2AUODvFHIs5d5CaFrlVGI,3567
|
|
8
8
|
hestia_earth/models/agribalyse2016/machineryInfrastructureDepreciatedAmountPerCycle.py,sha256=10XV1fz_yBYlqmNJ3cxmT2I2Vp_0w7nT4zMIuBw2wCY,3294
|
|
@@ -52,22 +52,22 @@ hestia_earth/models/cycle/residueLeftOnField.py,sha256=PkpiuOWYlPZzWYw2Oqu0yM1dQ
|
|
|
52
52
|
hestia_earth/models/cycle/residueRemoved.py,sha256=7_1pV0xWqp_IJSG-LSRPMksHaW9iUKzyynC7YI_dluM,2283
|
|
53
53
|
hestia_earth/models/cycle/siteDuration.py,sha256=Hox20n3Y-tJ4ydmkrOreWOXAENxOnd827B7qH7_66T0,1058
|
|
54
54
|
hestia_earth/models/cycle/transformation.py,sha256=06KTfVubh2I47dfnG9Iv6AbuUBbURM8BAVOkRu7XmHw,1255
|
|
55
|
-
hestia_earth/models/cycle/completeness/__init__.py,sha256=
|
|
56
|
-
hestia_earth/models/cycle/completeness/animalFeed.py,sha256=
|
|
57
|
-
hestia_earth/models/cycle/completeness/cropResidue.py,sha256=
|
|
58
|
-
hestia_earth/models/cycle/completeness/excreta.py,sha256=
|
|
59
|
-
hestia_earth/models/cycle/completeness/material.py,sha256=
|
|
60
|
-
hestia_earth/models/cycle/completeness/other.py,sha256=
|
|
61
|
-
hestia_earth/models/cycle/completeness/soilAmendments.py,sha256=
|
|
55
|
+
hestia_earth/models/cycle/completeness/__init__.py,sha256=rkwGtxIay_AleJCT7al_ngnix_xRqySVie7qvHXMQI0,1517
|
|
56
|
+
hestia_earth/models/cycle/completeness/animalFeed.py,sha256=8Fo1TqwSuiPudvd2vJ-LVxSyOdD8mDCOZMvjuj5W2uo,1012
|
|
57
|
+
hestia_earth/models/cycle/completeness/cropResidue.py,sha256=zSiu9h0NxEBDUWlaKBh1QcX4jDIklrs0BC2NWMCQQ80,2549
|
|
58
|
+
hestia_earth/models/cycle/completeness/excreta.py,sha256=2yVxcuWjAh4hoEukaMJ90VZpkCL7SfpwIgzigbjVaF4,996
|
|
59
|
+
hestia_earth/models/cycle/completeness/material.py,sha256=UQH2oRnUY-Q-_MVuOlTAYqQxc7wWDM5mi_iFmp9PlIQ,1362
|
|
60
|
+
hestia_earth/models/cycle/completeness/other.py,sha256=Hp3JbeapCvju1vSzdb1Dp9DIUiXSDf-ruRSY3fs4nlg,1652
|
|
61
|
+
hestia_earth/models/cycle/completeness/soilAmendments.py,sha256=fdnTT9mO-LMqJLovY5vxLP-o9GZWYg8QH27fxca_yw8,1338
|
|
62
62
|
hestia_earth/models/cycle/feedConversionRatio/__init__.py,sha256=boQFf5q4DszxQ_D1hnd4jscG2BIBfphDmZCA105ikM8,2491
|
|
63
|
-
hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioCarbon.py,sha256=
|
|
64
|
-
hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioDryMatter.py,sha256=
|
|
65
|
-
hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioEnergy.py,sha256=
|
|
66
|
-
hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioFedWeight.py,sha256=
|
|
67
|
-
hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioNitrogen.py,sha256=
|
|
63
|
+
hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioCarbon.py,sha256=Oh680JRn5XNtR-lfHeLGYVofwjxs95-IbkY0bwfZX0Q,1317
|
|
64
|
+
hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioDryMatter.py,sha256=qjAuU0Ug96Br5AxOL7HCBOGNSv1A_3c2DH13AYG50r4,1712
|
|
65
|
+
hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioEnergy.py,sha256=gRtqtRz5wyQSsNkX3CyLyeLiDmXGSWogy5tvLOHQ-v0,1309
|
|
66
|
+
hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioFedWeight.py,sha256=sm-3WfM7xb4cRH8C4-HLkJm7jgEjzhPZvpe5VwY5djQ,1572
|
|
67
|
+
hestia_earth/models/cycle/feedConversionRatio/feedConversionRatioNitrogen.py,sha256=E4fz8n0JuRXhSqIsHs8ZXskB3i7uofxKZTwEo0QQRLk,1829
|
|
68
68
|
hestia_earth/models/cycle/input/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
69
69
|
hestia_earth/models/cycle/input/ecoinventV3.py,sha256=DlhrS9pTQgy3d0WThZVNCCDLZ51dENYDNMBWIiaEW3o,5474
|
|
70
|
-
hestia_earth/models/cycle/input/hestiaAggregatedData.py,sha256=
|
|
70
|
+
hestia_earth/models/cycle/input/hestiaAggregatedData.py,sha256=b-kMRMFZO_CuWljUwTT2lVI_OjjXGfUd1Renvjt2Vno,7993
|
|
71
71
|
hestia_earth/models/cycle/input/properties.py,sha256=gwQEJiPbED-tOL5GkxqZRnaaOFH3UK1E0KsqX4OkqAs,1965
|
|
72
72
|
hestia_earth/models/cycle/input/value.py,sha256=kolH9Fc5GIn9OVH2DgHEaW8ksS4xisy0LerS3WkKK9E,1550
|
|
73
73
|
hestia_earth/models/cycle/post_checks/__init__.py,sha256=qCf8zID6j1Dv2GhSHzz6ZEYcWUyh_N8cjrechi0zfOg,318
|
|
@@ -202,7 +202,7 @@ hestia_earth/models/ipcc2013IncludingFeedbacks/gwp100.py,sha256=PTE0FEV5x7MZgWpA
|
|
|
202
202
|
hestia_earth/models/ipcc2019/__init__.py,sha256=LdRpu8KbEc-MroIwXfKDjfj-xbgmfUYgctjKVvtpRfQ,409
|
|
203
203
|
hestia_earth/models/ipcc2019/aboveGroundCropResidueTotal.py,sha256=wueXTY31eMDvc8wIYHgCVhsyXAe0EXpWIqOLTT1I3GQ,2998
|
|
204
204
|
hestia_earth/models/ipcc2019/belowGroundCropResidue.py,sha256=2GZbLexELODq96rPQecOfN3sWDRFhETUgRQFqmzcayU,3212
|
|
205
|
-
hestia_earth/models/ipcc2019/ch4ToAirEntericFermentation.py,sha256=
|
|
205
|
+
hestia_earth/models/ipcc2019/ch4ToAirEntericFermentation.py,sha256=Kk_QNMqZtmJpNWZvCqJYVddn0833x3zwT3Pa5KZVBdE,7281
|
|
206
206
|
hestia_earth/models/ipcc2019/ch4ToAirExcreta.py,sha256=hygInRO3bhwo3JgMwWT2pL0jCP0OrYU55Ntx3O3JyG0,6679
|
|
207
207
|
hestia_earth/models/ipcc2019/ch4ToAirFloodedRice.py,sha256=f-TJINDbpzK4puGW2Jfrv5-q3er5IL54wWk9O850RcE,6231
|
|
208
208
|
hestia_earth/models/ipcc2019/co2ToAirLimeHydrolysis.py,sha256=Q9CGcD1PizZJQ2qdeBQJXn3P_oIpAdbnn02re8HP0D4,2580
|
|
@@ -215,13 +215,13 @@ hestia_earth/models/ipcc2019/no3ToGroundwaterCropResidueDecomposition.py,sha256=
|
|
|
215
215
|
hestia_earth/models/ipcc2019/no3ToGroundwaterExcreta.py,sha256=WNfaopS9canZs5zePdijfD2HzTTYfqD1hiainuVfwmk,3004
|
|
216
216
|
hestia_earth/models/ipcc2019/no3ToGroundwaterInorganicFertiliser.py,sha256=X2WPGOiWi_1cQ5yiyjfrBU_rAm3EDsm4WnRJi8ea6g8,3007
|
|
217
217
|
hestia_earth/models/ipcc2019/no3ToGroundwaterOrganicFertiliser.py,sha256=Q6XLA-yUEJFQCrk1N4Tq2DiMSACI7XnsW_Mn595V1as,3102
|
|
218
|
-
hestia_earth/models/ipcc2019/pastureGrass.py,sha256=
|
|
218
|
+
hestia_earth/models/ipcc2019/pastureGrass.py,sha256=V9sKff32359jErhDHqqjaF0Uy8ZtpWQ72Pdl0t7e2_k,21332
|
|
219
219
|
hestia_earth/models/ipcc2019/utils.py,sha256=u-KBk8xVI0Rcn1_jwjGeSXpF83VHpAiNsjGD3DBrUfY,992
|
|
220
220
|
hestia_earth/models/ipcc2021/__init__.py,sha256=VTgGFKhwMmk_nuI1RRq0in27fHYVPBonlXlPK00K8no,409
|
|
221
221
|
hestia_earth/models/ipcc2021/gwp100.py,sha256=HEV4Misbe5h99qCqZeCaKNTs4FkFWmv6RdCty_U2pps,947
|
|
222
222
|
hestia_earth/models/koble2014/__init__.py,sha256=jRciLONEhGHtMLu2rlWXEEVwcJqA-URsfH1cCt-Qti4,410
|
|
223
223
|
hestia_earth/models/koble2014/aboveGroundCropResidue.py,sha256=_gjXqDFQl6C6xSnYqDeHkpWjaqVgOVqSb20iwMD8WqU,5256
|
|
224
|
-
hestia_earth/models/koble2014/cropResidueManagement.py,sha256=
|
|
224
|
+
hestia_earth/models/koble2014/cropResidueManagement.py,sha256=22guAEe6pyi7SS6pswz3H3lMzfygefB1Mlg3aL2k6PQ,2973
|
|
225
225
|
hestia_earth/models/koble2014/residueBurnt.py,sha256=eKvzC4HOj8t7c2-50guVhqQMapTuxcHNBB-_zElHILY,2285
|
|
226
226
|
hestia_earth/models/koble2014/residueLeftOnField.py,sha256=R3D6-21Za9CylMVFWePSUywL55d7n9ohlBHAJyXAwA4,421
|
|
227
227
|
hestia_earth/models/koble2014/residueRemoved.py,sha256=NqYXLr5Te7m6EcGMJOEeXTB_DDMFKoJslJuiTIQ16RM,2035
|
|
@@ -315,13 +315,13 @@ hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystems
|
|
|
315
315
|
hestia_earth/models/linkedImpactAssessment/__init__.py,sha256=x6xsPu-Rwh-7HKsvHuKmgM1YML6fQy2z9Hsy9_BeO2Y,3565
|
|
316
316
|
hestia_earth/models/mocking/__init__.py,sha256=Y39V6yj_3M1q8v9ShCHwPeJOstypOVIvb_FldMEbF7g,766
|
|
317
317
|
hestia_earth/models/mocking/mock_search.py,sha256=pJPIRn8zWtZvOay5Iq9Gc9TUHLiOIfQ2Mq0nnDb8-h4,1797
|
|
318
|
-
hestia_earth/models/mocking/search-results.json,sha256=
|
|
318
|
+
hestia_earth/models/mocking/search-results.json,sha256=JwfES0TxPyTByYf6yE7ExlrWDzNlw3Tl3Py7bcBWNqk,14690
|
|
319
319
|
hestia_earth/models/pooreNemecek2018/__init__.py,sha256=nPboL7ULJzL5nJD5q7q9VOZt_fxbKVm8fmn1Az5YkVY,417
|
|
320
320
|
hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py,sha256=trQBxjc8V77q96sxvK4Y9HfpD64zgyGuB5o5_o0lHts,2189
|
|
321
321
|
hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py,sha256=do9zHHR8VuqFcWNLnql5t3tV478SCVc7tC3mEs5cdUk,2184
|
|
322
322
|
hestia_earth/models/pooreNemecek2018/ch4ToAirAquacultureSystems.py,sha256=iPNQCPSF0oXzmR7KQqgySpeQAkPFgmBhbta6m6t6Y2U,6603
|
|
323
|
-
hestia_earth/models/pooreNemecek2018/excretaKgN.py,sha256=
|
|
324
|
-
hestia_earth/models/pooreNemecek2018/excretaKgVs.py,sha256=
|
|
323
|
+
hestia_earth/models/pooreNemecek2018/excretaKgN.py,sha256=fHPbi6D6GluKhjaRBZQTx4TtzNewvHdnWrPyuGZecE4,5677
|
|
324
|
+
hestia_earth/models/pooreNemecek2018/excretaKgVs.py,sha256=bsSZcyzBoVB6Ybk5CgElzPp7mTpQJXsPMdB3ROf6dcM,7751
|
|
325
325
|
hestia_earth/models/pooreNemecek2018/landOccupationDuringCycle.py,sha256=Zlq4gfVPrneqTaahtUiEtmjNqct75AoIag33gOZbC3E,2820
|
|
326
326
|
hestia_earth/models/pooreNemecek2018/longFallowPeriod.py,sha256=RHrkBR-U2VSGpwPBs9RCWVlZtHin5BXESKE9jienrRw,1374
|
|
327
327
|
hestia_earth/models/pooreNemecek2018/n2OToAirAquacultureSystemsDirect.py,sha256=BgxKSBSRdyNU1_q8Vf9GULkIewuXKmgfDQU9Thzxc1g,2724
|
|
@@ -445,7 +445,7 @@ hestia_earth/models/transformation/product/__init__.py,sha256=47DEQpj8HBSa-_TImW
|
|
|
445
445
|
hestia_earth/models/transformation/product/excreta.py,sha256=m0zg-GlfyB-R3epWhenJBpCpXaQuczHyJD77DHOQnwE,5623
|
|
446
446
|
hestia_earth/models/usetoxV2/__init__.py,sha256=pK37V3H-KvYcvRKw4Mv8CWrB2N0LFLzmv0jKLdhGGqs,409
|
|
447
447
|
hestia_earth/models/usetoxV2/freshwaterEcotoxicityPotentialPaf.py,sha256=prp0wzAtEInGN0P6kcMR7JsaWxuZHgVH-_N1h37B-Mk,898
|
|
448
|
-
hestia_earth/models/utils/__init__.py,sha256=
|
|
448
|
+
hestia_earth/models/utils/__init__.py,sha256=G_9czuomgBup9tTzQdBZ35H2zUZryE_PGg_b-bGVMkA,3896
|
|
449
449
|
hestia_earth/models/utils/animalProduct.py,sha256=JA-xGQiwsz-VPR_8UfI5hKa918bpQOWIok3--b_iVuM,681
|
|
450
450
|
hestia_earth/models/utils/aquacultureManagement.py,sha256=3uSTSMDNNPa26NTJGZCYwByv3QZVyxj6bh2aFCoBzHk,126
|
|
451
451
|
hestia_earth/models/utils/blank_node.py,sha256=jWLM1_s0Oarbby63Jhijv5RTr34d481MB4dE3y7XiGI,7763
|
|
@@ -461,13 +461,13 @@ hestia_earth/models/utils/fuel.py,sha256=CxzCM2fXfbW6n7sb8DLkJlVE77fY8yugh9vHv4_
|
|
|
461
461
|
hestia_earth/models/utils/impact_assessment.py,sha256=IntMGB2gTjJIFKOnAev1SmgWG8qSUTo2EykATSYW9zA,6969
|
|
462
462
|
hestia_earth/models/utils/indicator.py,sha256=fPq38ifd53xWbuOfoiVwiA0Nwa7jVPJLSAPpOMMil8Q,423
|
|
463
463
|
hestia_earth/models/utils/inorganicFertiliser.py,sha256=zJpNvDNaEsZ2T_V4APAQy4rmnLff4FvTiT-VfNFkKF4,1520
|
|
464
|
-
hestia_earth/models/utils/input.py,sha256=
|
|
464
|
+
hestia_earth/models/utils/input.py,sha256=CsoMC_Jjnifl5mjPWhWOBhiHmNI5IGWRfPjshOV1Ipg,6798
|
|
465
465
|
hestia_earth/models/utils/liveAnimal.py,sha256=u_Lym0hVinncCZMYF_KscCA3vuelWmlyHn4I-jVRDs4,1505
|
|
466
466
|
hestia_earth/models/utils/lookup.py,sha256=Y9ekB_AGpmZKZI7NnYodvvF2pFHlkFHkryMk1SVWp60,5307
|
|
467
|
-
hestia_earth/models/utils/measurement.py,sha256=
|
|
467
|
+
hestia_earth/models/utils/measurement.py,sha256=jeX82DPwVQHFBMe5V0yGvQEDDv4ymMtiMsMbOwgM9oU,2607
|
|
468
468
|
hestia_earth/models/utils/pesticideAI.py,sha256=KQNXos2oG-TbDARxg3ksJAfAAYeiaQIZ5e3V2S0A-fA,1329
|
|
469
|
-
hestia_earth/models/utils/practice.py,sha256=
|
|
470
|
-
hestia_earth/models/utils/product.py,sha256=
|
|
469
|
+
hestia_earth/models/utils/practice.py,sha256=tNadOzsrNlCEt801B815XaruJXzZ5yPASam7B3sWpXE,1091
|
|
470
|
+
hestia_earth/models/utils/product.py,sha256=OFzxe2mFdqUfhQ7tfXkhd-sYMqIxPLIgKJFq65oNrQE,8605
|
|
471
471
|
hestia_earth/models/utils/productivity.py,sha256=bUBVCZInGqHuHZvHDSYPQkjWXQxOtTjEk-1-f_BsFOo,594
|
|
472
472
|
hestia_earth/models/utils/property.py,sha256=X4DDQKHEVYqtW6nNxBhLZ40_avix2dLDxR22Ipeq0TA,4274
|
|
473
473
|
hestia_earth/models/utils/site.py,sha256=RZHcftsauPtvC7ma6ea31m3tIjyAR_VRBTcvYAC9v7s,2153
|
|
@@ -613,7 +613,7 @@ tests/models/globalCropWaterModel2008/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
613
613
|
tests/models/globalCropWaterModel2008/test_rootingDepth.py,sha256=dyhojeVM9ge1XOuuiUVSkNeLy--A2xW81hqGELNvEWY,2468
|
|
614
614
|
tests/models/haversineFormula/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
615
615
|
tests/models/haversineFormula/transport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
616
|
-
tests/models/haversineFormula/transport/test_distance.py,sha256=
|
|
616
|
+
tests/models/haversineFormula/transport/test_distance.py,sha256=hqzIOA1nGao8uiBE16J0ou52McwV4w30ZLpEAqtfi9k,970
|
|
617
617
|
tests/models/hyde32/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
618
618
|
tests/models/hyde32/test_landTransformationFromCropland100YearAverageDuringCycle.py,sha256=RKxRIxBg7MazL62Hf56ls-8uiyS1M-lk5mdvodgqqVE,706
|
|
619
619
|
tests/models/hyde32/test_landTransformationFromCropland20YearAverageDuringCycle.py,sha256=XoNrnnyqk7WpIT8S_-GPy8Hxbz6Ve1FH25XZ-JB4PEs,705
|
|
@@ -911,18 +911,18 @@ tests/models/utils/test_dataCompleteness.py,sha256=mW6rA7ddhtjZsLxwo5xDnvBdxmqTs
|
|
|
911
911
|
tests/models/utils/test_emission.py,sha256=8b2XnxrXajTlRGpHP_GnGXHrRHnPIi4m3SOT0mBlDbw,627
|
|
912
912
|
tests/models/utils/test_impact_assessment.py,sha256=EYnbauTQLBDYfjIzFo7EWBGnCCle7wXGaCQ4rMLH_sU,1459
|
|
913
913
|
tests/models/utils/test_indicator.py,sha256=GwYKV5N_yEPcJWz7FirRnK48rl62ofAn_TkAo0MioIM,639
|
|
914
|
-
tests/models/utils/test_input.py,sha256=
|
|
914
|
+
tests/models/utils/test_input.py,sha256=bSG6YKmT2ofY2oD5CGbNwR8-To-ihyNyr14Td5-jNRU,585
|
|
915
915
|
tests/models/utils/test_liveAnimal.py,sha256=UH9zRqunCIy2H3JkJArCGHzC8Hzq-oYQ7peqPn78fXM,926
|
|
916
|
-
tests/models/utils/test_measurement.py,sha256=
|
|
917
|
-
tests/models/utils/test_practice.py,sha256=
|
|
918
|
-
tests/models/utils/test_product.py,sha256=
|
|
916
|
+
tests/models/utils/test_measurement.py,sha256=k_L54NV97jKlPgTHQBPlo-IHP1cp-y-aGfuNrx0gpQE,2734
|
|
917
|
+
tests/models/utils/test_practice.py,sha256=ILaxkb3qICor9AquAGYiOtA-YKnq0hppmJQzNC_VNyA,612
|
|
918
|
+
tests/models/utils/test_product.py,sha256=heyd7zYUXaqiiPgBkWJr-OxMNcdVzC8jSRCfvMt4CQE,1726
|
|
919
919
|
tests/models/utils/test_property.py,sha256=t2npw86IK7C6G4ypiPtanFi0db4PB7G5VBR1GjRGl34,618
|
|
920
920
|
tests/models/utils/test_site.py,sha256=deEIYptl2MHEklSfHbZV9qA59YKqZLQr8y5rWYiD460,680
|
|
921
921
|
tests/models/utils/test_term.py,sha256=jcANyHzzLpkq7AQReFmTa16vtMlwgCNfhDbr9FLlYX4,1808
|
|
922
922
|
tests/models/webbEtAl2012AndSintermannEtAl2012/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
923
923
|
tests/models/webbEtAl2012AndSintermannEtAl2012/test_nh3ToAirOrganicFertiliser.py,sha256=qi2FNXS5Af2WDtm7nq_FsprH3BfCF0XxnE0XHmC4aIY,2244
|
|
924
|
-
hestia_earth_models-0.
|
|
925
|
-
hestia_earth_models-0.
|
|
926
|
-
hestia_earth_models-0.
|
|
927
|
-
hestia_earth_models-0.
|
|
928
|
-
hestia_earth_models-0.
|
|
924
|
+
hestia_earth_models-0.44.1.dist-info/LICENSE,sha256=EFSZhfUdZCTsCIYdHzTGewMKfRfp7X9t1s2aaKxm8O0,1154
|
|
925
|
+
hestia_earth_models-0.44.1.dist-info/METADATA,sha256=ORplFPloCt085BqrUYz_gmsCRPnPTzUqyobdot3UQp0,3192
|
|
926
|
+
hestia_earth_models-0.44.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
927
|
+
hestia_earth_models-0.44.1.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
|
|
928
|
+
hestia_earth_models-0.44.1.dist-info/RECORD,,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from unittest.mock import patch
|
|
2
2
|
import json
|
|
3
3
|
|
|
4
|
-
from tests.utils import fixtures_path,
|
|
4
|
+
from tests.utils import fixtures_path, _set_methodModel
|
|
5
5
|
from hestia_earth.models.haversineFormula.transport.distance import MODEL, MODEL_KEY, run
|
|
6
6
|
|
|
7
7
|
class_path = f"hestia_earth.models.{MODEL}.transport.{MODEL_KEY}"
|
|
@@ -16,7 +16,7 @@ def fake_download_hestia(id: str, *args):
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
@patch(f"{class_path}.download_hestia", side_effect=fake_download_hestia)
|
|
19
|
-
@patch(f"{class_path}._include_methodModel", side_effect=
|
|
19
|
+
@patch(f"{class_path}._include_methodModel", side_effect=_set_methodModel)
|
|
20
20
|
def test_run(*args):
|
|
21
21
|
with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
|
|
22
22
|
cycle = json.load(f)
|
tests/models/utils/test_input.py
CHANGED
|
@@ -6,7 +6,7 @@ from hestia_earth.models.utils.input import _new_input
|
|
|
6
6
|
class_path = 'hestia_earth.models.utils.input'
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
@patch(f"{class_path}.
|
|
9
|
+
@patch(f"{class_path}._include_model", side_effect=lambda n, x: n)
|
|
10
10
|
@patch(f"{class_path}.download_hestia", return_value=TERM)
|
|
11
11
|
def test_new_input(*args):
|
|
12
12
|
# with a Term as string
|
|
@@ -10,7 +10,7 @@ class_path = 'hestia_earth.models.utils.measurement'
|
|
|
10
10
|
fixtures_folder = f"{fixtures_path}/utils/measurement"
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
@patch(f"{class_path}.
|
|
13
|
+
@patch(f"{class_path}._include_method", side_effect=lambda n, x: n)
|
|
14
14
|
@patch(f"{class_path}._include_source", side_effect=lambda n, x: n)
|
|
15
15
|
@patch(f"{class_path}.download_hestia", return_value=TERM)
|
|
16
16
|
def test_new_measurement(*args):
|
|
@@ -4,7 +4,7 @@ from tests.utils import TERM
|
|
|
4
4
|
from hestia_earth.models.utils.practice import _new_practice
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
@patch('hestia_earth.models.utils.practice.
|
|
7
|
+
@patch('hestia_earth.models.utils.practice._include_model', side_effect=lambda n, x: n)
|
|
8
8
|
@patch('hestia_earth.models.utils.practice.download_hestia', return_value=TERM)
|
|
9
9
|
def test_new_practice(*args):
|
|
10
10
|
# with a Term as string
|
|
@@ -10,7 +10,7 @@ class_path = 'hestia_earth.models.utils.product'
|
|
|
10
10
|
fixtures_folder = f"{fixtures_path}/utils/product"
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
@patch(f"{class_path}.
|
|
13
|
+
@patch(f"{class_path}._include_model", side_effect=lambda n, x: n)
|
|
14
14
|
@patch(f"{class_path}.download_hestia", return_value=TERM)
|
|
15
15
|
def test_new_product(*args):
|
|
16
16
|
# with a Term as string
|
|
File without changes
|
|
File without changes
|