hestia-earth-models 0.64.10__py3-none-any.whl → 0.64.12__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/eutrophicationPotentialExcludingFate.py +2 -2
- hestia_earth/models/cml2001Baseline/terrestrialAcidificationPotentialIncludingFateAverageEurope.py +2 -2
- hestia_earth/models/cml2001NonBaseline/eutrophicationPotentialIncludingFateAverageEurope.py +2 -2
- hestia_earth/models/cml2001NonBaseline/terrestrialAcidificationPotentialExcludingFate.py +2 -2
- hestia_earth/models/cycle/completeness/cropResidue.py +15 -10
- hestia_earth/models/cycle/completeness/freshForage.py +60 -0
- hestia_earth/models/cycle/concentrateFeed.py +31 -19
- hestia_earth/models/edip2003/ozoneDepletionPotential.py +2 -2
- hestia_earth/models/fantkeEtAl2016/damageToHumanHealthParticulateMatterFormation.py +7 -17
- hestia_earth/models/faostat2018/utils.py +72 -12
- hestia_earth/models/hestia/__init__.py +13 -0
- hestia_earth/models/hestia/landCover.py +725 -0
- hestia_earth/models/ipcc2013ExcludingFeedbacks/gwp100.py +2 -2
- hestia_earth/models/ipcc2013IncludingFeedbacks/gwp100.py +2 -2
- hestia_earth/models/ipcc2019/animal/fatContent.py +1 -1
- hestia_earth/models/ipcc2019/animal/milkYieldPerAnimal.py +91 -0
- hestia_earth/models/ipcc2019/animal/trueProteinContent.py +1 -1
- hestia_earth/models/ipcc2019/animal/utils.py +17 -12
- hestia_earth/models/ipcc2019/co2ToAirAboveGroundBiomassStockChange.py +8 -4
- hestia_earth/models/ipcc2019/co2ToAirBelowGroundBiomassStockChange.py +7 -3
- hestia_earth/models/ipcc2019/co2ToAirCarbonStockChange_utils.py +45 -3
- hestia_earth/models/ipcc2019/co2ToAirSoilOrganicCarbonStockChange.py +7 -3
- hestia_earth/models/ipcc2021/gwp100.py +2 -2
- hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsClimateChange.py +2 -2
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthClimateChange.py +2 -2
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthStratosphericOzoneDepletion.py +2 -2
- hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsClimateChange.py +2 -2
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsClimateChange.py +2 -2
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthClimateChange.py +2 -2
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthStratosphericOzoneDepletion.py +2 -2
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsClimateChange.py +2 -2
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthClimateChange.py +2 -2
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthStratosphericOzoneDepletion.py +2 -2
- hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsClimateChange.py +2 -2
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthClimateChange.py +2 -2
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthStratosphericOzoneDepletion.py +2 -2
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsClimateChange.py +2 -2
- hestia_earth/models/mocking/search-results.json +335 -335
- hestia_earth/models/recipe2016Egalitarian/ecosystemDamageOzoneFormation.py +2 -2
- hestia_earth/models/recipe2016Egalitarian/freshwaterEutrophicationPotential.py +2 -2
- hestia_earth/models/recipe2016Egalitarian/humanDamageOzoneFormation.py +2 -2
- hestia_earth/models/recipe2016Egalitarian/marineEutrophicationPotential.py +2 -2
- hestia_earth/models/recipe2016Egalitarian/ozoneDepletionPotential.py +2 -2
- hestia_earth/models/recipe2016Egalitarian/terrestrialAcidificationPotential.py +2 -2
- hestia_earth/models/recipe2016Hierarchist/ecosystemDamageOzoneFormation.py +2 -2
- hestia_earth/models/recipe2016Hierarchist/freshwaterEutrophicationPotential.py +2 -2
- hestia_earth/models/recipe2016Hierarchist/humanDamageOzoneFormation.py +2 -2
- hestia_earth/models/recipe2016Hierarchist/marineEutrophicationPotential.py +2 -2
- hestia_earth/models/recipe2016Hierarchist/ozoneDepletionPotential.py +2 -2
- hestia_earth/models/recipe2016Hierarchist/terrestrialAcidificationPotential.py +2 -2
- hestia_earth/models/recipe2016Individualist/ecosystemDamageOzoneFormation.py +2 -2
- hestia_earth/models/recipe2016Individualist/freshwaterEutrophicationPotential.py +2 -2
- hestia_earth/models/recipe2016Individualist/humanDamageOzoneFormation.py +2 -2
- hestia_earth/models/recipe2016Individualist/marineEutrophicationPotential.py +2 -2
- hestia_earth/models/recipe2016Individualist/ozoneDepletionPotential.py +2 -2
- hestia_earth/models/recipe2016Individualist/terrestrialAcidificationPotential.py +2 -2
- hestia_earth/models/utils/impact_assessment.py +18 -8
- hestia_earth/models/utils/lookup.py +2 -1
- hestia_earth/models/version.py +1 -1
- {hestia_earth_models-0.64.10.dist-info → hestia_earth_models-0.64.12.dist-info}/METADATA +2 -2
- {hestia_earth_models-0.64.10.dist-info → hestia_earth_models-0.64.12.dist-info}/RECORD +71 -62
- tests/models/cycle/completeness/test_freshForage.py +21 -0
- tests/models/faostat2018/test_faostat_utils.py +84 -0
- tests/models/hestia/__init__.py +0 -0
- tests/models/hestia/test_landCover.py +209 -0
- tests/models/ipcc2019/animal/test_milkYieldPerAnimal.py +21 -0
- tests/models/ipcc2019/test_co2ToAirSoilOrganicCarbonStockChange.py +48 -1
- tests/models/utils/test_impact_assessment.py +3 -3
- {hestia_earth_models-0.64.10.dist-info → hestia_earth_models-0.64.12.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.64.10.dist-info → hestia_earth_models-0.64.12.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.64.10.dist-info → hestia_earth_models-0.64.12.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils import sum_values
|
|
3
3
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
4
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
4
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
5
5
|
from hestia_earth.models.utils.pesticideAI import impact_lookup_value as pesticides_lookup_value
|
|
6
6
|
from . import MODEL
|
|
7
7
|
|
|
@@ -34,7 +34,7 @@ def _indicator(value: float):
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def run(impact_assessment: dict):
|
|
37
|
-
emissions_value =
|
|
37
|
+
emissions_value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
38
38
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
39
39
|
emissions_value=emissions_value)
|
|
40
40
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
3
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
3
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
4
4
|
from . import MODEL
|
|
5
5
|
|
|
6
6
|
REQUIREMENTS = {
|
|
@@ -26,7 +26,7 @@ def _indicator(value: float):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def run(impact_assessment: dict):
|
|
29
|
-
value =
|
|
29
|
+
value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
30
30
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
31
31
|
value=value)
|
|
32
32
|
logShouldRun(impact_assessment, MODEL, TERM_ID, True)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils import sum_values
|
|
3
3
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
4
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
4
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
5
5
|
from hestia_earth.models.utils.pesticideAI import impact_lookup_value as pesticides_lookup_value
|
|
6
6
|
from . import MODEL
|
|
7
7
|
|
|
@@ -34,7 +34,7 @@ def _indicator(value: float):
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def run(impact_assessment: dict):
|
|
37
|
-
emissions_value =
|
|
37
|
+
emissions_value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
38
38
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
39
39
|
emissions_value=emissions_value)
|
|
40
40
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
3
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
3
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
4
4
|
from . import MODEL
|
|
5
5
|
|
|
6
6
|
REQUIREMENTS = {
|
|
@@ -26,7 +26,7 @@ def _indicator(value: float):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def run(impact_assessment: dict):
|
|
29
|
-
value =
|
|
29
|
+
value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
30
30
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
31
31
|
value=value)
|
|
32
32
|
logShouldRun(impact_assessment, MODEL, TERM_ID, True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
3
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
3
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
4
4
|
from . import MODEL
|
|
5
5
|
|
|
6
6
|
REQUIREMENTS = {
|
|
@@ -26,7 +26,7 @@ def _indicator(value: float):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def run(impact_assessment: dict):
|
|
29
|
-
value =
|
|
29
|
+
value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
30
30
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
31
31
|
value=value)
|
|
32
32
|
logShouldRun(impact_assessment, MODEL, TERM_ID, True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
3
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
3
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
4
4
|
from . import MODEL
|
|
5
5
|
|
|
6
6
|
REQUIREMENTS = {
|
|
@@ -26,7 +26,7 @@ def _indicator(value: float):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def run(impact_assessment: dict):
|
|
29
|
-
value =
|
|
29
|
+
value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
30
30
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
31
31
|
value=value)
|
|
32
32
|
logShouldRun(impact_assessment, MODEL, TERM_ID, True)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils import sum_values
|
|
3
3
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
4
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
4
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
5
5
|
from hestia_earth.models.utils.pesticideAI import impact_lookup_value as pesticides_lookup_value
|
|
6
6
|
from . import MODEL
|
|
7
7
|
|
|
@@ -34,7 +34,7 @@ def _indicator(value: float):
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def run(impact_assessment: dict):
|
|
37
|
-
emissions_value =
|
|
37
|
+
emissions_value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
38
38
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
39
39
|
emissions_value=emissions_value)
|
|
40
40
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
3
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
3
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
4
4
|
from . import MODEL
|
|
5
5
|
|
|
6
6
|
REQUIREMENTS = {
|
|
@@ -26,7 +26,7 @@ def _indicator(value: float):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def run(impact_assessment: dict):
|
|
29
|
-
value =
|
|
29
|
+
value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
30
30
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
31
31
|
value=value)
|
|
32
32
|
logShouldRun(impact_assessment, MODEL, TERM_ID, True)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils import sum_values
|
|
3
3
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
4
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
4
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
5
5
|
from hestia_earth.models.utils.pesticideAI import impact_lookup_value as pesticides_lookup_value
|
|
6
6
|
from . import MODEL
|
|
7
7
|
|
|
@@ -34,7 +34,7 @@ def _indicator(value: float):
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def run(impact_assessment: dict):
|
|
37
|
-
emissions_value =
|
|
37
|
+
emissions_value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
38
38
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
39
39
|
emissions_value=emissions_value)
|
|
40
40
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
3
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
3
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
4
4
|
from . import MODEL
|
|
5
5
|
|
|
6
6
|
REQUIREMENTS = {
|
|
@@ -26,7 +26,7 @@ def _indicator(value: float):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def run(impact_assessment: dict):
|
|
29
|
-
value =
|
|
29
|
+
value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
30
30
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
31
31
|
value=value)
|
|
32
32
|
logShouldRun(impact_assessment, MODEL, TERM_ID, True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
3
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
3
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
4
4
|
from . import MODEL
|
|
5
5
|
|
|
6
6
|
REQUIREMENTS = {
|
|
@@ -26,7 +26,7 @@ def _indicator(value: float):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def run(impact_assessment: dict):
|
|
29
|
-
value =
|
|
29
|
+
value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
30
30
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
31
31
|
value=value)
|
|
32
32
|
logShouldRun(impact_assessment, MODEL, TERM_ID, True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
3
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
3
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
4
4
|
from . import MODEL
|
|
5
5
|
|
|
6
6
|
REQUIREMENTS = {
|
|
@@ -26,7 +26,7 @@ def _indicator(value: float):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def run(impact_assessment: dict):
|
|
29
|
-
value =
|
|
29
|
+
value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
30
30
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
31
31
|
value=value)
|
|
32
32
|
logShouldRun(impact_assessment, MODEL, TERM_ID, True)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils import sum_values
|
|
3
3
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
4
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
4
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
5
5
|
from hestia_earth.models.utils.pesticideAI import impact_lookup_value as pesticides_lookup_value
|
|
6
6
|
from . import MODEL
|
|
7
7
|
|
|
@@ -34,7 +34,7 @@ def _indicator(value: float):
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def run(impact_assessment: dict):
|
|
37
|
-
emissions_value =
|
|
37
|
+
emissions_value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
38
38
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
39
39
|
emissions_value=emissions_value)
|
|
40
40
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
3
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
3
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
4
4
|
from . import MODEL
|
|
5
5
|
|
|
6
6
|
REQUIREMENTS = {
|
|
@@ -26,7 +26,7 @@ def _indicator(value: float):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def run(impact_assessment: dict):
|
|
29
|
-
value =
|
|
29
|
+
value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
30
30
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
31
31
|
value=value)
|
|
32
32
|
logShouldRun(impact_assessment, MODEL, TERM_ID, True)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils import sum_values
|
|
3
3
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
4
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
4
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
5
5
|
from hestia_earth.models.utils.pesticideAI import impact_lookup_value as pesticides_lookup_value
|
|
6
6
|
from . import MODEL
|
|
7
7
|
|
|
@@ -34,7 +34,7 @@ def _indicator(value: float):
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def run(impact_assessment: dict):
|
|
37
|
-
emissions_value =
|
|
37
|
+
emissions_value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
38
38
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
39
39
|
emissions_value=emissions_value)
|
|
40
40
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
3
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
3
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
4
4
|
from . import MODEL
|
|
5
5
|
|
|
6
6
|
REQUIREMENTS = {
|
|
@@ -26,7 +26,7 @@ def _indicator(value: float):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def run(impact_assessment: dict):
|
|
29
|
-
value =
|
|
29
|
+
value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
30
30
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
31
31
|
value=value)
|
|
32
32
|
logShouldRun(impact_assessment, MODEL, TERM_ID, True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
3
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
3
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
4
4
|
from . import MODEL
|
|
5
5
|
|
|
6
6
|
REQUIREMENTS = {
|
|
@@ -26,7 +26,7 @@ def _indicator(value: float):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def run(impact_assessment: dict):
|
|
29
|
-
value =
|
|
29
|
+
value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
30
30
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
31
31
|
value=value)
|
|
32
32
|
logShouldRun(impact_assessment, MODEL, TERM_ID, True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from hestia_earth.models.log import logRequirements, logShouldRun
|
|
2
2
|
from hestia_earth.models.utils.indicator import _new_indicator
|
|
3
|
-
from hestia_earth.models.utils.impact_assessment import
|
|
3
|
+
from hestia_earth.models.utils.impact_assessment import impact_emission_lookup_value
|
|
4
4
|
from . import MODEL
|
|
5
5
|
|
|
6
6
|
REQUIREMENTS = {
|
|
@@ -26,7 +26,7 @@ def _indicator(value: float):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def run(impact_assessment: dict):
|
|
29
|
-
value =
|
|
29
|
+
value = impact_emission_lookup_value(MODEL, TERM_ID, impact_assessment, LOOKUPS['emission'])
|
|
30
30
|
logRequirements(impact_assessment, model=MODEL, term=TERM_ID,
|
|
31
31
|
value=value)
|
|
32
32
|
logShouldRun(impact_assessment, MODEL, TERM_ID, True)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
|
-
|
|
2
|
+
from hestia_earth.schema import TermTermType
|
|
3
3
|
from hestia_earth.utils.lookup import download_lookup
|
|
4
|
-
from hestia_earth.utils.model import find_term_match
|
|
4
|
+
from hestia_earth.utils.model import find_term_match, filter_list_term_type
|
|
5
5
|
from hestia_earth.utils.tools import list_sum, safe_parse_date
|
|
6
6
|
|
|
7
7
|
from hestia_earth.models.log import logRequirements, debugValues, log_as_table
|
|
@@ -88,8 +88,9 @@ def get_country_id(impact_assessment: dict) -> str:
|
|
|
88
88
|
return impact_assessment.get('country', get_site(impact_assessment).get('country', {})).get('@id')
|
|
89
89
|
|
|
90
90
|
|
|
91
|
-
def
|
|
92
|
-
|
|
91
|
+
def impact_emission_lookup_value(
|
|
92
|
+
model: str, term_id: str, impact: dict, lookup_col: str, grouped_key: Optional[str] = None
|
|
93
|
+
) -> float:
|
|
93
94
|
"""
|
|
94
95
|
Calculate the value of the impact based on lookup factors and emissions value.
|
|
95
96
|
|
|
@@ -105,6 +106,7 @@ def impact_lookup_value(model: str, term_id: str, impact: dict, lookup_col: str,
|
|
|
105
106
|
The lookup column to fetch the factors from.
|
|
106
107
|
grouped_key : str
|
|
107
108
|
key of grouped data to extract in a lookup table
|
|
109
|
+
|
|
108
110
|
Returns
|
|
109
111
|
-------
|
|
110
112
|
int
|
|
@@ -116,13 +118,19 @@ def impact_lookup_value(model: str, term_id: str, impact: dict, lookup_col: str,
|
|
|
116
118
|
node=impact,
|
|
117
119
|
lookup_name='emission.csv',
|
|
118
120
|
lookup_col=lookup_col,
|
|
119
|
-
blank_nodes=impact.get('emissionsResourceUse', []),
|
|
121
|
+
blank_nodes=filter_list_term_type(impact.get('emissionsResourceUse', []), TermTermType.EMISSION),
|
|
120
122
|
grouped_key=grouped_key
|
|
121
123
|
)
|
|
122
124
|
|
|
123
125
|
|
|
124
|
-
def impact_country_value(
|
|
125
|
-
|
|
126
|
+
def impact_country_value(
|
|
127
|
+
model: str,
|
|
128
|
+
term_id: str,
|
|
129
|
+
impact: dict,
|
|
130
|
+
lookup: str,
|
|
131
|
+
group_key: str = None,
|
|
132
|
+
country_fallback: bool = False,
|
|
133
|
+
) -> float:
|
|
126
134
|
"""
|
|
127
135
|
Calculate the value of the impact based on lookup factors and `site.country.@id`.
|
|
128
136
|
|
|
@@ -147,7 +155,9 @@ def impact_country_value(model: str, term_id: str, impact: dict, lookup: str, gr
|
|
|
147
155
|
int
|
|
148
156
|
The impact total value.
|
|
149
157
|
"""
|
|
150
|
-
|
|
158
|
+
term_type = TermTermType.RESOURCEUSE.value if 'resourceUse' in lookup else TermTermType.EMISSION.value
|
|
159
|
+
nodes = filter_list_term_type(impact.get('emissionsResourceUse', []), term_type)
|
|
160
|
+
|
|
151
161
|
country_id = get_country_id(impact)
|
|
152
162
|
country_id = fallback_country(country_id, [download_lookup(lookup)]) if country_fallback else country_id
|
|
153
163
|
|
|
@@ -104,7 +104,8 @@ def _aware_factor_value(model: str, term_id: str, lookup_name: str, aware_id: st
|
|
|
104
104
|
_ALLOW_ALL = 'all'
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
def _is_site(site: dict):
|
|
107
|
+
def _is_site(site: dict):
|
|
108
|
+
return site.get('@type', site.get('type')) == SchemaType.SITE.value if site else None
|
|
108
109
|
|
|
109
110
|
|
|
110
111
|
def _get_sites(node: dict):
|
hestia_earth/models/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
VERSION = '0.64.
|
|
1
|
+
VERSION = '0.64.12'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hestia-earth-models
|
|
3
|
-
Version: 0.64.
|
|
3
|
+
Version: 0.64.12
|
|
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.10
|
|
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
|