hestia-earth-models 0.64.8__py3-none-any.whl → 0.64.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of hestia-earth-models might be problematic. Click here for more details.
- hestia_earth/models/cycle/siteArea.py +2 -1
- hestia_earth/models/environmentalFootprintV3/soilQualityIndexLandOccupation.py +73 -82
- hestia_earth/models/environmentalFootprintV3/soilQualityIndexLandTransformation.py +102 -116
- hestia_earth/models/environmentalFootprintV3/soilQualityIndexTotalLandUseEffects.py +27 -16
- hestia_earth/models/faostat2018/landTransformationFromCropland100YearAverage.py +3 -2
- hestia_earth/models/faostat2018/landTransformationFromCropland20YearAverage.py +3 -2
- hestia_earth/models/frischknechtEtAl2000/ionisingRadiationKbqU235Eq.py +69 -37
- hestia_earth/models/ipcc2019/animal/fatContent.py +38 -0
- hestia_earth/models/ipcc2019/animal/liveweightGain.py +3 -54
- hestia_earth/models/ipcc2019/animal/liveweightPerHead.py +3 -54
- hestia_earth/models/ipcc2019/animal/pregnancyRateTotal.py +38 -0
- hestia_earth/models/ipcc2019/animal/trueProteinContent.py +38 -0
- hestia_earth/models/ipcc2019/animal/utils.py +87 -3
- hestia_earth/models/ipcc2019/animal/weightAtMaturity.py +4 -10
- hestia_earth/models/mocking/search-results.json +265 -259
- hestia_earth/models/poschEtAl2008/terrestrialAcidificationPotentialAccumulatedExceedance.py +4 -1
- hestia_earth/models/poschEtAl2008/terrestrialEutrophicationPotentialAccumulatedExceedance.py +4 -1
- hestia_earth/models/utils/__init__.py +5 -4
- hestia_earth/models/utils/impact_assessment.py +13 -4
- hestia_earth/models/version.py +1 -1
- {hestia_earth_models-0.64.8.dist-info → hestia_earth_models-0.64.9.dist-info}/METADATA +1 -1
- {hestia_earth_models-0.64.8.dist-info → hestia_earth_models-0.64.9.dist-info}/RECORD +37 -31
- tests/models/environmentalFootprintV3/test_soilQualityIndexLandOccupation.py +97 -66
- tests/models/environmentalFootprintV3/test_soilQualityIndexLandTransformation.py +137 -74
- tests/models/environmentalFootprintV3/test_soilQualityIndexTotalLandUseEffects.py +15 -10
- tests/models/frischknechtEtAl2000/test_ionisingRadiationKbqU235Eq.py +67 -44
- tests/models/ipcc2019/animal/test_fatContent.py +22 -0
- tests/models/ipcc2019/animal/test_liveweightGain.py +4 -2
- tests/models/ipcc2019/animal/test_liveweightPerHead.py +4 -2
- tests/models/ipcc2019/animal/test_pregnancyRateTotal.py +22 -0
- tests/models/ipcc2019/animal/test_trueProteinContent.py +22 -0
- tests/models/ipcc2019/animal/test_weightAtMaturity.py +2 -1
- tests/models/poschEtAl2008/test_terrestrialAcidificationPotentialAccumulatedExceedance.py +30 -17
- tests/models/poschEtAl2008/test_terrestrialEutrophicationPotentialAccumulatedExceedance.py +28 -14
- {hestia_earth_models-0.64.8.dist-info → hestia_earth_models-0.64.9.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.64.8.dist-info → hestia_earth_models-0.64.9.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.64.8.dist-info → hestia_earth_models-0.64.9.dist-info}/top_level.txt +0 -0
|
@@ -9,36 +9,50 @@ class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
|
|
|
9
9
|
fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
def fake_rounded_indicator(value: float):
|
|
13
|
+
indicator = fake_new_indicator(TERM_ID, MODEL)
|
|
14
|
+
indicator['value'] = round(value, 7)
|
|
15
|
+
return indicator
|
|
16
|
+
|
|
17
|
+
|
|
12
18
|
@patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
|
|
13
19
|
def test_run(*args):
|
|
14
20
|
with open(f"{fixtures_folder}/impact-assessment.jsonld", encoding='utf-8') as f:
|
|
15
|
-
|
|
21
|
+
impactassessment = json.load(f)
|
|
16
22
|
|
|
17
|
-
with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
|
|
23
|
+
with open(f"{fixtures_folder}/Belarus/result.jsonld", encoding='utf-8') as f:
|
|
18
24
|
expected = json.load(f)
|
|
19
25
|
|
|
20
|
-
value = run(
|
|
26
|
+
value = run(impactassessment)
|
|
21
27
|
assert value == expected
|
|
22
28
|
|
|
23
29
|
|
|
24
|
-
@patch(f"{class_path}.
|
|
30
|
+
@patch(f"{class_path}._indicator", side_effect=fake_rounded_indicator)
|
|
25
31
|
def test_lookup_to_bad_country(*args):
|
|
32
|
+
"""
|
|
33
|
+
Should default to region-world value
|
|
34
|
+
"""
|
|
26
35
|
with open(f"{fixtures_folder}/impact-assessment.jsonld", encoding='utf-8') as f:
|
|
27
|
-
|
|
28
|
-
cycle['country']['@id'] = "example-land-not-real"
|
|
36
|
+
impactassessment = json.load(f)
|
|
29
37
|
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
impactassessment['country']['@id'] = "example-land-not-real"
|
|
39
|
+
|
|
40
|
+
with open(f"{fixtures_folder}/region-world/result.jsonld", encoding='utf-8') as f:
|
|
41
|
+
expected = json.load(f)
|
|
42
|
+
|
|
43
|
+
value = run(impactassessment)
|
|
44
|
+
assert value == expected
|
|
32
45
|
|
|
33
46
|
|
|
34
47
|
@patch(f"{class_path}._new_indicator", side_effect=fake_new_indicator)
|
|
35
|
-
def
|
|
48
|
+
def test_run_no_emissions(*args):
|
|
36
49
|
"""
|
|
37
|
-
|
|
50
|
+
Impact assessment with no emissions should return a indicator of 0
|
|
38
51
|
"""
|
|
39
52
|
with open(f"{fixtures_folder}/impact-assessment.jsonld", encoding='utf-8') as f:
|
|
40
|
-
|
|
41
|
-
|
|
53
|
+
impactassessment = json.load(f)
|
|
54
|
+
|
|
55
|
+
del impactassessment['emissionsResourceUse']
|
|
42
56
|
|
|
43
|
-
value = run(
|
|
44
|
-
assert value['value'] ==
|
|
57
|
+
value = run(impactassessment)
|
|
58
|
+
assert value['value'] == 0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|