hestia-earth-models 0.64.14__py3-none-any.whl → 0.65.0__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/agribalyse2016/fuelElectricity.py +1 -1
- hestia_earth/models/cache_sites.py +15 -24
- hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsLandTransformation.py +6 -9
- hestia_earth/models/cycle/input/hestiaAggregatedData.py +46 -22
- hestia_earth/models/cycle/pre_checks/cache_sources.py +3 -25
- hestia_earth/models/cycle/product/economicValueShare.py +2 -2
- hestia_earth/models/environmentalFootprintV3/soilQualityIndexLandTransformation.py +11 -33
- hestia_earth/models/faostat2018/landTransformation100YearAverageDuringCycle.py +34 -0
- hestia_earth/models/faostat2018/landTransformation20YearAverageDuringCycle.py +34 -0
- hestia_earth/models/faostat2018/utils.py +47 -3
- hestia_earth/models/hestia/landCover.py +5 -5
- hestia_earth/models/hestia/seed_emissions.py +275 -0
- hestia_earth/models/ipcc2019/aboveGroundBiomass.py +2 -2
- hestia_earth/models/ipcc2019/belowGroundBiomass.py +8 -2
- hestia_earth/models/ipcc2019/biomass_utils.py +11 -4
- hestia_earth/models/ipcc2019/ch4ToAirEntericFermentation.py +19 -10
- hestia_earth/models/ipcc2019/co2ToAirAboveGroundBiomassStockChange.py +2 -1
- hestia_earth/models/ipcc2019/co2ToAirBelowGroundBiomassStockChange.py +2 -1
- hestia_earth/models/ipcc2019/co2ToAirCarbonStockChange_utils.py +8 -7
- hestia_earth/models/ipcc2019/co2ToAirSoilOrganicCarbonStockChange.py +2 -1
- hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_1_utils.py +28 -34
- hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_2_utils.py +8 -12
- hestia_earth/models/ipcc2019/organicCarbonPerHa_utils.py +13 -30
- hestia_earth/models/linkedImpactAssessment/{landTransformationFromCropland20YearAverageInputsProduction.py → landTransformation100YearAverageInputsProduction.py} +5 -2
- hestia_earth/models/linkedImpactAssessment/{landTransformationFromCropland100YearAverageInputsProduction.py → landTransformation20YearAverageInputsProduction.py} +5 -2
- hestia_earth/models/linkedImpactAssessment/utils.py +69 -12
- hestia_earth/models/mocking/search-results.json +444 -444
- hestia_earth/models/pooreNemecek2018/excretaKgN.py +45 -41
- hestia_earth/models/pooreNemecek2018/excretaKgVs.py +89 -63
- hestia_earth/models/pooreNemecek2018/saplingsDepreciatedAmountPerCycle.py +8 -8
- hestia_earth/models/pooreNemecek2018/utils.py +60 -19
- hestia_earth/models/schererPfister2015/nErosionSoilFlux.py +4 -3
- hestia_earth/models/schererPfister2015/pErosionSoilFlux.py +4 -3
- hestia_earth/models/schererPfister2015/utils.py +12 -9
- hestia_earth/models/site/management.py +70 -55
- hestia_earth/models/site/pre_checks/cache_sources.py +2 -20
- hestia_earth/models/utils/__init__.py +12 -1
- hestia_earth/models/utils/aggregated.py +1 -1
- hestia_earth/models/utils/blank_node.py +20 -12
- hestia_earth/models/utils/cache_sources.py +15 -0
- hestia_earth/models/utils/crop.py +5 -0
- hestia_earth/models/utils/indicator.py +3 -1
- hestia_earth/models/version.py +1 -1
- {hestia_earth_models-0.64.14.dist-info → hestia_earth_models-0.65.0.dist-info}/METADATA +2 -2
- {hestia_earth_models-0.64.14.dist-info → hestia_earth_models-0.65.0.dist-info}/RECORD +75 -104
- tests/models/cml2001Baseline/test_abioticResourceDepletionMineralsAndMetals.py +1 -1
- tests/models/cycle/input/test_hestiaAggregatedData.py +5 -2
- tests/models/environmentalFootprintV3/test_soilQualityIndexLandTransformation.py +39 -28
- tests/models/{hyde32/test_landTransformationFromForest20YearAverageDuringCycle.py → faostat2018/test_landTransformation100YearAverageDuringCycle.py} +5 -5
- tests/models/{hyde32/test_landTransformationFromForest100YearAverageDuringCycle.py → faostat2018/test_landTransformation20YearAverageDuringCycle.py} +5 -5
- tests/models/faostat2018/test_utils.py +28 -0
- tests/models/hestia/test_landCover.py +2 -1
- tests/models/hestia/test_seed_emissions.py +27 -0
- tests/models/ipcc2019/test_aboveGroundBiomass.py +40 -4
- tests/models/ipcc2019/test_belowGroundBiomass.py +40 -4
- tests/models/ipcc2019/test_co2ToAirAboveGroundBiomassStockChange.py +52 -15
- tests/models/ipcc2019/test_co2ToAirBelowGroundBiomassStockChange.py +50 -14
- tests/models/ipcc2019/test_co2ToAirSoilOrganicCarbonStockChange.py +53 -32
- tests/models/ipcc2019/test_organicCarbonPerHa.py +91 -108
- tests/models/ipcc2019/test_organicCarbonPerHa_tier_1_utils.py +33 -50
- tests/models/ipcc2019/test_organicCarbonPerHa_tier_2_utils.py +0 -52
- tests/models/linkedImpactAssessment/test_freshwaterWithdrawalsInputsProduction.py +6 -4
- tests/models/linkedImpactAssessment/test_landOccupationInputsProduction.py +6 -4
- tests/models/linkedImpactAssessment/{test_landTransformationFromForest100YearAverageInputsProduction.py → test_landTransformation100YearAverageInputsProduction.py} +7 -5
- tests/models/linkedImpactAssessment/{test_landTransformationFromForest20YearAverageInputsProduction.py → test_landTransformation20YearAverageInputsProduction.py} +7 -5
- tests/models/pooreNemecek2018/test_excretaKgN.py +2 -2
- tests/models/pooreNemecek2018/test_excretaKgVs.py +1 -1
- tests/models/pooreNemecek2018/test_utils.py +26 -0
- tests/models/site/test_management.py +10 -27
- tests/models/test_cache_sites.py +40 -12
- tests/models/utils/test_blank_node.py +0 -8
- tests/models/utils/test_cache_sources.py +21 -0
- hestia_earth/models/blonkConsultants2016/landTransformationFromForest20YearAverageDuringCycle.py +0 -90
- hestia_earth/models/faostat2018/landTransformationFromCropland100YearAverage.py +0 -74
- hestia_earth/models/faostat2018/landTransformationFromCropland20YearAverage.py +0 -74
- hestia_earth/models/hyde32/__init__.py +0 -13
- hestia_earth/models/hyde32/landTransformationFromCropland100YearAverageDuringCycle.py +0 -60
- hestia_earth/models/hyde32/landTransformationFromCropland20YearAverageDuringCycle.py +0 -60
- hestia_earth/models/hyde32/landTransformationFromForest100YearAverageDuringCycle.py +0 -60
- hestia_earth/models/hyde32/landTransformationFromForest20YearAverageDuringCycle.py +0 -60
- hestia_earth/models/hyde32/landTransformationFromOtherNaturalVegetation100YearAverageDuringCycle.py +0 -61
- hestia_earth/models/hyde32/landTransformationFromOtherNaturalVegetation20YearAverageDuringCycle.py +0 -61
- hestia_earth/models/hyde32/landTransformationFromPermanentPasture100YearAverageDuringCycle.py +0 -61
- hestia_earth/models/hyde32/landTransformationFromPermanentPasture20YearAverageDuringCycle.py +0 -61
- hestia_earth/models/hyde32/utils.py +0 -72
- hestia_earth/models/linkedImpactAssessment/landTransformationFromForest100YearAverageInputsProduction.py +0 -36
- hestia_earth/models/linkedImpactAssessment/landTransformationFromForest20YearAverageInputsProduction.py +0 -36
- hestia_earth/models/linkedImpactAssessment/landTransformationFromOtherNaturalVegetation100YearAverageInputsProduction.py +0 -36
- hestia_earth/models/linkedImpactAssessment/landTransformationFromOtherNaturalVegetation20YearAverageInputsProduction.py +0 -36
- hestia_earth/models/linkedImpactAssessment/landTransformationFromPermanentPasture100YearAverageInputsProduction.py +0 -36
- hestia_earth/models/linkedImpactAssessment/landTransformationFromPermanentPasture20YearAverageInputsProduction.py +0 -36
- tests/models/blonkConsultants2016/test_landTransformationFromForest20YearAverageDuringCycle.py +0 -36
- tests/models/cycle/pre_checks/test_cache_sources.py +0 -25
- tests/models/faostat2018/test_landTransformationFromCropland100YearAverage.py +0 -40
- tests/models/faostat2018/test_landTransformationFromCropland20YearAverage.py +0 -40
- tests/models/hyde32/__init__.py +0 -0
- tests/models/hyde32/test_landTransformationFromCropland100YearAverageDuringCycle.py +0 -21
- tests/models/hyde32/test_landTransformationFromCropland20YearAverageDuringCycle.py +0 -21
- tests/models/hyde32/test_landTransformationFromOtherNaturalVegetation100YearAverageDuringCycle.py +0 -23
- tests/models/hyde32/test_landTransformationFromOtherNaturalVegetation20YearAverageDuringCycle.py +0 -21
- tests/models/hyde32/test_landTransformationFromPermanentPasture100YearAverageDuringCycle.py +0 -21
- tests/models/hyde32/test_landTransformationFromPermanentPasture20YearAverageDuringCycle.py +0 -21
- tests/models/linkedImpactAssessment/test_landTransformationFromCropland100YearAverageInputsProduction.py +0 -23
- tests/models/linkedImpactAssessment/test_landTransformationFromCropland20YearAverageInputsProduction.py +0 -23
- tests/models/linkedImpactAssessment/test_landTransformationFromOtherNaturalVegetation100YearAverageInputsProduction.py +0 -23
- tests/models/linkedImpactAssessment/test_landTransformationFromOtherNaturalVegetation20YearAverageInputsProduction.py +0 -23
- tests/models/linkedImpactAssessment/test_landTransformationFromPermanentPasture100YearAverageInputsProduction.py +0 -24
- tests/models/linkedImpactAssessment/test_landTransformationFromPermanentPasture20YearAverageInputsProduction.py +0 -24
- tests/models/site/pre_checks/test_cache_sources.py +0 -21
- {hestia_earth_models-0.64.14.dist-info → hestia_earth_models-0.65.0.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.64.14.dist-info → hestia_earth_models-0.65.0.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.64.14.dist-info → hestia_earth_models-0.65.0.dist-info}/top_level.txt +0 -0
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from unittest.mock import patch
|
|
2
|
-
import json
|
|
3
|
-
from tests.utils import fixtures_path, fake_new_indicator, fake_load_impacts
|
|
4
|
-
|
|
5
|
-
from hestia_earth.models.linkedImpactAssessment.landTransformationFromOtherNaturalVegetation20YearAverageInputsProduction import ( # noqa: E501
|
|
6
|
-
TERM_ID, run
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
class_path = f"hestia_earth.models.linkedImpactAssessment.{TERM_ID}"
|
|
10
|
-
fixtures_folder = f"{fixtures_path}/linkedImpactAssessment/{TERM_ID}"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@patch('hestia_earth.models.utils.input.load_impacts', side_effect=fake_load_impacts)
|
|
14
|
-
@patch('hestia_earth.models.linkedImpactAssessment.utils._new_indicator', side_effect=fake_new_indicator)
|
|
15
|
-
def test_run(*args):
|
|
16
|
-
with open(f"{fixtures_folder}/impact-assessment.jsonld", encoding='utf-8') as f:
|
|
17
|
-
impact = json.load(f)
|
|
18
|
-
|
|
19
|
-
with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
|
|
20
|
-
expected = json.load(f)
|
|
21
|
-
|
|
22
|
-
value = run(impact)
|
|
23
|
-
assert value == expected
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
from unittest.mock import patch
|
|
2
|
-
import json
|
|
3
|
-
from tests.utils import fixtures_path, fake_new_indicator, fake_load_impacts
|
|
4
|
-
|
|
5
|
-
from hestia_earth.models.linkedImpactAssessment import (
|
|
6
|
-
landTransformationFromPermanentPasture100YearAverageInputsProduction
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
TERM_ID = landTransformationFromPermanentPasture100YearAverageInputsProduction.TERM_ID
|
|
10
|
-
class_path = f"hestia_earth.models.linkedImpactAssessment.{TERM_ID}"
|
|
11
|
-
fixtures_folder = f"{fixtures_path}/linkedImpactAssessment/{TERM_ID}"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@patch('hestia_earth.models.utils.input.load_impacts', side_effect=fake_load_impacts)
|
|
15
|
-
@patch('hestia_earth.models.linkedImpactAssessment.utils._new_indicator', side_effect=fake_new_indicator)
|
|
16
|
-
def test_run(*args):
|
|
17
|
-
with open(f"{fixtures_folder}/impact-assessment.jsonld", encoding='utf-8') as f:
|
|
18
|
-
impact = json.load(f)
|
|
19
|
-
|
|
20
|
-
with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
|
|
21
|
-
expected = json.load(f)
|
|
22
|
-
|
|
23
|
-
value = landTransformationFromPermanentPasture100YearAverageInputsProduction.run(impact)
|
|
24
|
-
assert value == expected
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
from unittest.mock import patch
|
|
2
|
-
import json
|
|
3
|
-
from tests.utils import fixtures_path, fake_new_indicator, fake_load_impacts
|
|
4
|
-
|
|
5
|
-
from hestia_earth.models.linkedImpactAssessment import (
|
|
6
|
-
landTransformationFromPermanentPasture20YearAverageInputsProduction
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
TERM_ID = landTransformationFromPermanentPasture20YearAverageInputsProduction.TERM_ID
|
|
10
|
-
class_path = f"hestia_earth.models.linkedImpactAssessment.{TERM_ID}"
|
|
11
|
-
fixtures_folder = f"{fixtures_path}/linkedImpactAssessment/{TERM_ID}"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@patch('hestia_earth.models.utils.input.load_impacts', side_effect=fake_load_impacts)
|
|
15
|
-
@patch('hestia_earth.models.linkedImpactAssessment.utils._new_indicator', side_effect=fake_new_indicator)
|
|
16
|
-
def test_run(*args):
|
|
17
|
-
with open(f"{fixtures_folder}/impact-assessment.jsonld", encoding='utf-8') as f:
|
|
18
|
-
impact = json.load(f)
|
|
19
|
-
|
|
20
|
-
with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
|
|
21
|
-
expected = json.load(f)
|
|
22
|
-
|
|
23
|
-
value = landTransformationFromPermanentPasture20YearAverageInputsProduction.run(impact)
|
|
24
|
-
assert value == expected
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
from unittest.mock import patch
|
|
2
|
-
|
|
3
|
-
from hestia_earth.models.site.pre_checks.cache_sources import CACHE_KEY, CACHE_SOURCES_KEY, run, _should_run
|
|
4
|
-
|
|
5
|
-
class_path = 'hestia_earth.models.site.pre_checks.cache_sources'
|
|
6
|
-
sources = {'source a': {'@type': 'Source', '@id': 'source-1'}}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def test_should_run():
|
|
10
|
-
# no existing cache => run
|
|
11
|
-
assert _should_run({CACHE_KEY: {}}) is True
|
|
12
|
-
assert _should_run({CACHE_KEY: {CACHE_SOURCES_KEY: {}}}) is True
|
|
13
|
-
|
|
14
|
-
# with existing cache => no run
|
|
15
|
-
assert not _should_run({CACHE_KEY: {CACHE_SOURCES_KEY: {'sample': 'a'}}})
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@patch(f"{class_path}.find_sources", return_value=sources)
|
|
19
|
-
def test_run(*args):
|
|
20
|
-
result = run({})
|
|
21
|
-
assert result.get(CACHE_KEY).get(CACHE_SOURCES_KEY) == sources
|
|
File without changes
|
|
File without changes
|
{hestia_earth_models-0.64.14.dist-info → hestia_earth_models-0.65.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|