hestia-earth-models 0.73.2__py3-none-any.whl → 0.73.4__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/akagiEtAl2011/utils.py +12 -13
- hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandOccupation.py +3 -2
- hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandTransformation.py +1 -1
- hestia_earth/models/frischknechtEtAl2000/ionisingRadiationKbqU235Eq.py +10 -6
- hestia_earth/models/geospatialDatabase/utils.py +20 -7
- hestia_earth/models/hestia/default_emissions.py +1 -0
- hestia_earth/models/hestia/default_resourceUse.py +3 -2
- hestia_earth/models/hestia/excretaKgMass.py +1 -1
- hestia_earth/models/hestia/excretaKgN.py +1 -1
- hestia_earth/models/hestia/excretaKgVs.py +1 -1
- hestia_earth/models/hestia/landCover.py +1 -1
- hestia_earth/models/hestia/waterSalinity.py +13 -6
- hestia_earth/models/ipcc2019/n2OToAirCropResidueBurningDirect.py +7 -12
- hestia_earth/models/mocking/search-results.json +1565 -1565
- hestia_earth/models/schmidt2007/utils.py +2 -2
- hestia_earth/models/utils/__init__.py +1 -1
- hestia_earth/models/utils/cropResidue.py +2 -2
- hestia_earth/models/utils/cycle.py +2 -2
- hestia_earth/models/utils/impact_assessment.py +14 -14
- hestia_earth/models/utils/lookup.py +30 -10
- hestia_earth/models/version.py +1 -1
- {hestia_earth_models-0.73.2.dist-info → hestia_earth_models-0.73.4.dist-info}/METADATA +1 -1
- {hestia_earth_models-0.73.2.dist-info → hestia_earth_models-0.73.4.dist-info}/RECORD +31 -31
- tests/models/akagiEtAl2011/test_utils.py +3 -2
- tests/models/environmentalFootprintV3_1/test_soilQualityIndexLandOccupation.py +3 -3
- tests/models/frischknechtEtAl2000/test_ionisingRadiationKbqU235Eq.py +85 -31
- tests/models/ipcc2019/test_n2OToAirCropResidueBurningDirect.py +3 -2
- tests/models/utils/test_cropResidue.py +4 -4
- {hestia_earth_models-0.73.2.dist-info → hestia_earth_models-0.73.4.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.73.2.dist-info → hestia_earth_models-0.73.4.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.73.2.dist-info → hestia_earth_models-0.73.4.dist-info}/top_level.txt +0 -0
|
@@ -8,15 +8,16 @@ class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
|
|
|
8
8
|
fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
@patch(f"{class_path}.get_lookup_value", return_value=10)
|
|
11
12
|
@patch(f"{class_path}.get_crop_residue_burnt_value")
|
|
12
13
|
def test_should_run(mock_product_value, *args):
|
|
13
14
|
# no products => no run
|
|
14
|
-
mock_product_value.return_value =
|
|
15
|
+
mock_product_value.return_value = None
|
|
15
16
|
should_run, *args = _should_run({})
|
|
16
17
|
assert not should_run
|
|
17
18
|
|
|
18
19
|
# with products => run
|
|
19
|
-
mock_product_value.return_value =
|
|
20
|
+
mock_product_value.return_value = 10
|
|
20
21
|
should_run, *args = _should_run({})
|
|
21
22
|
assert should_run is True
|
|
22
23
|
|
|
@@ -7,20 +7,20 @@ class_path = 'hestia_earth.models.utils.cropResidue'
|
|
|
7
7
|
|
|
8
8
|
@patch(f"{class_path}.find_term_match", return_value=None)
|
|
9
9
|
@patch(f"{class_path}._is_term_type_complete", return_value=False)
|
|
10
|
-
def
|
|
10
|
+
def test_get_crop_residue_burnt_value(mock_data_complete, mock_find_product):
|
|
11
11
|
# product not found no data complete
|
|
12
12
|
mock_data_complete.return_value = False
|
|
13
13
|
mock_find_product.return_value = {}
|
|
14
14
|
value = get_crop_residue_burnt_value({})
|
|
15
|
-
assert value
|
|
15
|
+
assert value is None
|
|
16
16
|
|
|
17
17
|
# product not found and data complete
|
|
18
18
|
mock_data_complete.return_value = True
|
|
19
19
|
mock_find_product.return_value = {}
|
|
20
20
|
value = get_crop_residue_burnt_value({})
|
|
21
|
-
assert value ==
|
|
21
|
+
assert value == 0
|
|
22
22
|
|
|
23
23
|
# product found
|
|
24
24
|
mock_find_product.return_value = {'value': [100]}
|
|
25
25
|
value = get_crop_residue_burnt_value({})
|
|
26
|
-
assert value ==
|
|
26
|
+
assert value == 200
|
|
File without changes
|
|
File without changes
|
|
File without changes
|