hestia-earth-models 0.68.1__py3-none-any.whl → 0.69.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.
Files changed (189) hide show
  1. hestia_earth/models/agribalyse2016/fuelElectricity.py +0 -5
  2. hestia_earth/models/agribalyse2016/machineryInfrastructureDepreciatedAmountPerCycle.py +0 -11
  3. hestia_earth/models/aware/scarcityWeightedWaterUse.py +0 -4
  4. hestia_earth/models/cml2001Baseline/abioticResourceDepletionFossilFuels.py +0 -18
  5. hestia_earth/models/cml2001Baseline/abioticResourceDepletionMineralsAndMetals.py +0 -12
  6. hestia_earth/models/cml2001Baseline/resourceUseEnergyDepletionDuringCycle.py +0 -5
  7. hestia_earth/models/cml2001Baseline/resourceUseMineralsAndMetalsDuringCycle.py +0 -4
  8. hestia_earth/models/config/Cycle.json +23 -30
  9. hestia_earth/models/cycle/aboveGroundCropResidueTotal.py +0 -6
  10. hestia_earth/models/cycle/animal/input/hestiaAggregatedData.py +0 -8
  11. hestia_earth/models/cycle/animal/input/properties.py +0 -9
  12. hestia_earth/models/cycle/animal/milkYield.py +0 -6
  13. hestia_earth/models/cycle/animal/properties.py +0 -6
  14. hestia_earth/models/cycle/completeness/animalFeed.py +0 -6
  15. hestia_earth/models/cycle/completeness/cropResidue.py +0 -6
  16. hestia_earth/models/cycle/completeness/electricityFuel.py +0 -6
  17. hestia_earth/models/cycle/completeness/excreta.py +0 -6
  18. hestia_earth/models/cycle/completeness/freshForage.py +0 -6
  19. hestia_earth/models/cycle/completeness/material.py +0 -6
  20. hestia_earth/models/cycle/completeness/seed.py +0 -6
  21. hestia_earth/models/cycle/completeness/soilAmendment.py +0 -6
  22. hestia_earth/models/cycle/concentrateFeed.py +0 -6
  23. hestia_earth/models/cycle/cropResidueManagement.py +0 -5
  24. hestia_earth/models/cycle/cycleDuration.py +0 -8
  25. hestia_earth/models/cycle/endDate.py +0 -7
  26. hestia_earth/models/cycle/excretaKgMass.py +0 -5
  27. hestia_earth/models/cycle/excretaKgN.py +0 -5
  28. hestia_earth/models/cycle/excretaKgVs.py +0 -5
  29. hestia_earth/models/cycle/inorganicFertiliser.py +0 -6
  30. hestia_earth/models/cycle/input/hestiaAggregatedData.py +0 -13
  31. hestia_earth/models/cycle/input/properties.py +0 -9
  32. hestia_earth/models/cycle/input/value.py +0 -6
  33. hestia_earth/models/cycle/liveAnimal.py +0 -5
  34. hestia_earth/models/cycle/materialAndSubstrate.py +1 -6
  35. hestia_earth/models/cycle/milkYield.py +0 -10
  36. hestia_earth/models/cycle/otherSitesArea.py +0 -6
  37. hestia_earth/models/cycle/otherSitesUnusedDuration.py +0 -6
  38. hestia_earth/models/cycle/pastureSystem.py +0 -6
  39. hestia_earth/models/cycle/post_checks/cache.py +0 -5
  40. hestia_earth/models/cycle/post_checks/otherSites.py +0 -7
  41. hestia_earth/models/cycle/post_checks/site.py +0 -7
  42. hestia_earth/models/cycle/practice/value.py +0 -7
  43. hestia_earth/models/cycle/pre_checks/cache_sources.py +0 -5
  44. hestia_earth/models/cycle/pre_checks/otherSites.py +0 -7
  45. hestia_earth/models/cycle/pre_checks/site.py +0 -6
  46. hestia_earth/models/cycle/product/currency.py +0 -5
  47. hestia_earth/models/cycle/product/economicValueShare.py +0 -14
  48. hestia_earth/models/cycle/product/price.py +0 -5
  49. hestia_earth/models/cycle/product/primary.py +0 -5
  50. hestia_earth/models/cycle/product/properties.py +0 -7
  51. hestia_earth/models/cycle/product/revenue.py +0 -9
  52. hestia_earth/models/cycle/product/value.py +0 -6
  53. hestia_earth/models/cycle/siteArea.py +0 -6
  54. hestia_earth/models/cycle/siteDuration.py +0 -10
  55. hestia_earth/models/cycle/siteUnusedDuration.py +0 -6
  56. hestia_earth/models/cycle/startDate.py +0 -8
  57. hestia_earth/models/cycle/startDateDefinition.py +0 -6
  58. hestia_earth/models/cycle/transformation.py +0 -5
  59. hestia_earth/models/dammgen2009/noxToAirExcreta.py +2 -2
  60. hestia_earth/models/ecoinventV3/__init__.py +0 -15
  61. hestia_earth/models/ecoinventV3AndEmberClimate/__init__.py +0 -11
  62. hestia_earth/models/emepEea2019/nh3ToAirExcreta.py +14 -40
  63. hestia_earth/models/emepEea2019/pm10ToAirAnimalHousing.py +0 -4
  64. hestia_earth/models/emepEea2019/pm25ToAirAnimalHousing.py +0 -4
  65. hestia_earth/models/emepEea2019/tspToAirAnimalHousing.py +0 -4
  66. hestia_earth/models/emissionNotRelevant/__init__.py +0 -5
  67. hestia_earth/models/environmentalFootprintV3_1/environmentalFootprintSingleOverallScore.py +0 -9
  68. hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandOccupation.py +0 -6
  69. hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandTransformation.py +0 -6
  70. hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexTotalLandUseEffects.py +0 -6
  71. hestia_earth/models/epa2014/no3ToGroundwaterExcreta.py +2 -2
  72. hestia_earth/models/faostat2018/product/price.py +0 -5
  73. hestia_earth/models/geospatialDatabase/awareWaterBasinId.py +0 -5
  74. hestia_earth/models/geospatialDatabase/ecoClimateZone.py +1 -20
  75. hestia_earth/models/geospatialDatabase/ecoregion.py +0 -7
  76. hestia_earth/models/geospatialDatabase/potentialEvapotranspirationAnnual.py +0 -4
  77. hestia_earth/models/geospatialDatabase/potentialEvapotranspirationMonthly.py +0 -4
  78. hestia_earth/models/geospatialDatabase/precipitationAnnual.py +0 -4
  79. hestia_earth/models/geospatialDatabase/precipitationMonthly.py +0 -4
  80. hestia_earth/models/geospatialDatabase/region.py +0 -5
  81. hestia_earth/models/geospatialDatabase/temperatureAnnual.py +0 -4
  82. hestia_earth/models/geospatialDatabase/temperatureMonthly.py +0 -4
  83. hestia_earth/models/haversineFormula/transport/distance.py +0 -7
  84. hestia_earth/models/hestia/landCover.py +31 -18
  85. hestia_earth/models/hestia/landTransformation100YearAverageDuringCycle.py +0 -11
  86. hestia_earth/models/hestia/landTransformation20YearAverageDuringCycle.py +0 -11
  87. hestia_earth/models/hestia/nh3ToSurfaceWaterAquacultureSystems.py +64 -0
  88. hestia_earth/models/hestia/residueRemoved.py +0 -4
  89. hestia_earth/models/hestia/resourceUse_utils.py +0 -5
  90. hestia_earth/models/hestia/seed_emissions.py +0 -13
  91. hestia_earth/models/impact_assessment/allocationMethod.py +0 -6
  92. hestia_earth/models/impact_assessment/emissions.py +0 -9
  93. hestia_earth/models/impact_assessment/irrigated.py +0 -5
  94. hestia_earth/models/impact_assessment/organic.py +0 -5
  95. hestia_earth/models/impact_assessment/post_checks/cycle.py +0 -7
  96. hestia_earth/models/impact_assessment/post_checks/site.py +0 -7
  97. hestia_earth/models/impact_assessment/pre_checks/cycle.py +0 -6
  98. hestia_earth/models/impact_assessment/pre_checks/site.py +0 -6
  99. hestia_earth/models/impact_assessment/product/economicValueShare.py +0 -6
  100. hestia_earth/models/impact_assessment/product/value.py +0 -5
  101. hestia_earth/models/ipcc2019/aboveGroundBiomass.py +9 -2
  102. hestia_earth/models/ipcc2019/animal/milkYieldPerAnimal.py +0 -6
  103. hestia_earth/models/ipcc2019/animal/pastureGrass.py +0 -10
  104. hestia_earth/models/ipcc2019/animal/weightAtMaturity.py +0 -4
  105. hestia_earth/models/ipcc2019/belowGroundBiomass.py +9 -2
  106. hestia_earth/models/ipcc2019/co2ToAirSoilOrganicCarbonStockChange.py +1 -1
  107. hestia_earth/models/ipcc2019/croppingDuration.py +0 -5
  108. hestia_earth/models/ipcc2019/n2OToAirExcretaDirect.py +1 -1
  109. hestia_earth/models/ipcc2019/no3ToGroundwaterExcreta.py +51 -15
  110. hestia_earth/models/ipcc2019/nonCo2EmissionsToAirNaturalVegetationBurning.py +0 -12
  111. hestia_earth/models/ipcc2019/organicCarbonPerHa.py +2 -15
  112. hestia_earth/models/ipcc2019/{organicCarbonPerHa_tier_1_utils.py → organicCarbonPerHa_tier_1.py} +3 -15
  113. hestia_earth/models/ipcc2019/{organicCarbonPerHa_tier_2_utils.py → organicCarbonPerHa_tier_2.py} +3 -13
  114. hestia_earth/models/ipcc2019/pastureGrass.py +0 -10
  115. hestia_earth/models/koble2014/aboveGroundCropResidue.py +0 -9
  116. hestia_earth/models/koble2014/cropResidueManagement.py +0 -6
  117. hestia_earth/models/linkedImpactAssessment/emissions.py +0 -5
  118. hestia_earth/models/mocking/search-results.json +1202 -1146
  119. hestia_earth/models/pooreNemecek2018/ch4ToAirAquacultureSystems.py +14 -15
  120. hestia_earth/models/pooreNemecek2018/excretaKgN.py +12 -17
  121. hestia_earth/models/pooreNemecek2018/excretaKgVs.py +22 -23
  122. hestia_earth/models/pooreNemecek2018/n2OToAirAquacultureSystemsDirect.py +6 -9
  123. hestia_earth/models/pooreNemecek2018/n2ToAirAquacultureSystems.py +6 -9
  124. hestia_earth/models/pooreNemecek2018/nh3ToAirAquacultureSystems.py +11 -15
  125. hestia_earth/models/pooreNemecek2018/noxToAirAquacultureSystems.py +6 -9
  126. hestia_earth/models/pooreNemecek2018/utils.py +2 -2
  127. hestia_earth/models/site/defaultMethodClassification.py +0 -7
  128. hestia_earth/models/site/defaultMethodClassificationDescription.py +0 -7
  129. hestia_earth/models/site/flowingWater.py +0 -5
  130. hestia_earth/models/site/management.py +0 -21
  131. hestia_earth/models/site/measurement/value.py +0 -6
  132. hestia_earth/models/site/post_checks/country.py +0 -5
  133. hestia_earth/models/site/potentialEvapotranspirationAnnual.py +0 -3
  134. hestia_earth/models/site/potentialEvapotranspirationMonthly.py +0 -3
  135. hestia_earth/models/site/pre_checks/cache_geospatialDatabase.py +0 -5
  136. hestia_earth/models/site/pre_checks/cache_sources.py +0 -5
  137. hestia_earth/models/site/pre_checks/cache_years.py +0 -5
  138. hestia_earth/models/site/pre_checks/country.py +0 -5
  139. hestia_earth/models/site/precipitationAnnual.py +0 -3
  140. hestia_earth/models/site/precipitationMonthly.py +0 -3
  141. hestia_earth/models/site/rainfallAnnual.py +0 -3
  142. hestia_earth/models/site/rainfallMonthly.py +0 -3
  143. hestia_earth/models/site/soilMeasurement.py +0 -5
  144. hestia_earth/models/site/temperatureAnnual.py +0 -3
  145. hestia_earth/models/site/temperatureMonthly.py +0 -3
  146. hestia_earth/models/transformation/input/excreta.py +0 -5
  147. hestia_earth/models/transformation/input/max.py +0 -8
  148. hestia_earth/models/transformation/input/min.py +0 -8
  149. hestia_earth/models/transformation/input/properties.py +0 -6
  150. hestia_earth/models/transformation/input/sd.py +0 -8
  151. hestia_earth/models/transformation/input/value.py +0 -8
  152. hestia_earth/models/transformation/product/excreta.py +0 -7
  153. hestia_earth/models/utils/excretaManagement.py +37 -0
  154. hestia_earth/models/utils/lookup.py +2 -0
  155. hestia_earth/models/utils/practice.py +1 -27
  156. hestia_earth/models/utils/source.py +29 -9
  157. hestia_earth/models/version.py +1 -1
  158. hestia_earth/orchestrator/strategies/run/add_blank_node_if_missing.py +12 -8
  159. {hestia_earth_models-0.68.1.dist-info → hestia_earth_models-0.69.1.dist-info}/METADATA +2 -2
  160. {hestia_earth_models-0.68.1.dist-info → hestia_earth_models-0.69.1.dist-info}/RECORD +179 -187
  161. tests/models/emepEea2019/test_nh3ToAirExcreta.py +6 -17
  162. tests/models/hestia/test_nh3ToSurfaceWaterAquacultureSystems.py +51 -0
  163. tests/models/ipcc2019/test_aboveGroundBiomass.py +4 -0
  164. tests/models/ipcc2019/test_belowGroundBiomass.py +4 -0
  165. tests/models/ipcc2019/test_co2ToAirSoilOrganicCarbonStockChange.py +1 -1
  166. tests/models/ipcc2019/test_no3ToGroundwaterExcreta.py +24 -9
  167. tests/models/ipcc2019/test_organicCarbonPerHa.py +2 -2
  168. tests/models/ipcc2019/{test_organicCarbonPerHa_tier_1_utils.py → test_organicCarbonPerHa_tier_1.py} +2 -2
  169. tests/models/ipcc2019/{test_organicCarbonPerHa_tier_2_utils.py → test_organicCarbonPerHa_tier_2.py} +2 -2
  170. tests/models/pooreNemecek2018/test_ch4ToAirAquacultureSystems.py +1 -7
  171. tests/models/pooreNemecek2018/test_n2OToAirAquacultureSystemsDirect.py +1 -7
  172. tests/models/pooreNemecek2018/test_n2ToAirAquacultureSystems.py +1 -7
  173. tests/models/pooreNemecek2018/test_nh3ToAirAquacultureSystems.py +1 -7
  174. tests/models/pooreNemecek2018/test_noxToAirAquacultureSystems.py +1 -7
  175. tests/models/utils/test_source.py +6 -1
  176. tests/orchestrator/strategies/run/test_add_blank_node_if_missing.py +1 -1
  177. hestia_earth/models/blonkConsultants2016/__init__.py +0 -13
  178. hestia_earth/models/blonkConsultants2016/ch4ToAirNaturalVegetationBurning.py +0 -78
  179. hestia_earth/models/blonkConsultants2016/co2ToAirAboveGroundBiomassStockChangeLandUseChange.py +0 -78
  180. hestia_earth/models/blonkConsultants2016/n2OToAirNaturalVegetationBurningDirect.py +0 -78
  181. hestia_earth/models/blonkConsultants2016/utils.py +0 -30
  182. tests/models/blonkConsultants2016/__init__.py +0 -0
  183. tests/models/blonkConsultants2016/test_ch4ToAirNaturalVegetationBurning.py +0 -34
  184. tests/models/blonkConsultants2016/test_co2ToAirAboveGroundBiomassStockChangeLandUseChange.py +0 -36
  185. tests/models/blonkConsultants2016/test_n2OToAirNaturalVegetationBurningDirect.py +0 -34
  186. tests/models/blonkConsultants2016/test_utils.py +0 -9
  187. {hestia_earth_models-0.68.1.dist-info → hestia_earth_models-0.69.1.dist-info}/LICENSE +0 -0
  188. {hestia_earth_models-0.68.1.dist-info → hestia_earth_models-0.69.1.dist-info}/WHEEL +0 -0
  189. {hestia_earth_models-0.68.1.dist-info → hestia_earth_models-0.69.1.dist-info}/top_level.txt +0 -0
@@ -1,30 +0,0 @@
1
- from hestia_earth.utils.model import find_primary_product
2
- from hestia_earth.utils.lookup import extract_grouped_data
3
- from hestia_earth.utils.tools import safe_parse_float
4
-
5
- from hestia_earth.models.log import logger
6
- from hestia_earth.models.utils.crop import FAOSTAT_AREA_LOOKUP_COLUMN, get_crop_grouping_faostat_area
7
- from hestia_earth.models.utils.lookup import get_region_lookup_value
8
- from . import MODEL
9
-
10
-
11
- def get_emission_factor(term_id: str, cycle: dict, factor: str):
12
- site = cycle.get('site', {})
13
- country_id = site.get('country', {}).get('@id')
14
- product = find_primary_product(cycle) or {}
15
- product_id = product.get('term', {}).get('@id')
16
- crop_grouping = get_crop_grouping_faostat_area(MODEL, term_id, product.get('term', {}))
17
-
18
- logger.debug('model=%s, country=%s, product=%s, crop_grouping=%s',
19
- MODEL, country_id, product_id, f"'{crop_grouping}'")
20
-
21
- lookup_name = f"region-crop-{FAOSTAT_AREA_LOOKUP_COLUMN}-{factor}.csv"
22
- value = get_region_lookup_value(
23
- lookup_name, country_id, crop_grouping, model=MODEL, term=term_id
24
- ) if crop_grouping else get_region_lookup_value(
25
- lookup_name, country_id, 'NONE', model=MODEL, term=term_id
26
- )
27
-
28
- data = safe_parse_float(value, None)
29
- # fallback to site.siteType data if possible
30
- return data if data is not None else safe_parse_float(extract_grouped_data(value, site.get('siteType')), None)
File without changes
@@ -1,34 +0,0 @@
1
- from unittest.mock import patch
2
- import json
3
- from tests.utils import fixtures_path, fake_new_emission
4
-
5
- from hestia_earth.models.blonkConsultants2016.ch4ToAirNaturalVegetationBurning import MODEL, TERM_ID, run, _should_run
6
-
7
- class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
- fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
9
-
10
-
11
- @patch(f"{class_path}.land_occupation_per_ha", return_value=None)
12
- @patch(f"{class_path}.get_emission_factor", return_value=None)
13
- def test_should_run(mock_factor, mock_landOccupation):
14
- # with land occupation => no run
15
- mock_landOccupation.return_value = 10
16
- should_run, *args = _should_run({'functionalUnit': '1 ha'})
17
- assert not should_run
18
-
19
- # with emission factor => run
20
- mock_factor.return_value = 10
21
- should_run, *args = _should_run({'functionalUnit': '1 ha'})
22
- assert should_run is True
23
-
24
-
25
- @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
26
- def test_run(*args):
27
- with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
28
- cycle = json.load(f)
29
-
30
- with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
31
- expected = json.load(f)
32
-
33
- value = run(cycle)
34
- assert value == expected
@@ -1,36 +0,0 @@
1
- from unittest.mock import patch
2
- import json
3
- from tests.utils import fixtures_path, fake_new_emission
4
-
5
- from hestia_earth.models.blonkConsultants2016.co2ToAirAboveGroundBiomassStockChangeLandUseChange import (
6
- MODEL, TERM_ID, run, _should_run
7
- )
8
-
9
- class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
10
- fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
11
-
12
-
13
- @patch(f"{class_path}.land_occupation_per_ha", return_value=None)
14
- @patch(f"{class_path}.get_emission_factor", return_value=None)
15
- def test_should_run(mock_factor, mock_landOccupation):
16
- # with land occupation => no run
17
- mock_landOccupation.return_value = 10
18
- should_run, *args = _should_run({'functionalUnit': '1 ha'})
19
- assert not should_run
20
-
21
- # with emission factor => run
22
- mock_factor.return_value = 10
23
- should_run, *args = _should_run({'functionalUnit': '1 ha'})
24
- assert should_run is True
25
-
26
-
27
- @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
28
- def test_run(*args):
29
- with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
30
- cycle = json.load(f)
31
-
32
- with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
33
- expected = json.load(f)
34
-
35
- value = run(cycle)
36
- assert value == expected
@@ -1,34 +0,0 @@
1
- from unittest.mock import patch
2
- import json
3
- from tests.utils import fixtures_path, fake_new_emission
4
-
5
- from hestia_earth.models.blonkConsultants2016.n2OToAirNaturalVegetationBurningDirect import TERM_ID, run, _should_run
6
-
7
- class_path = f"hestia_earth.models.blonkConsultants2016.{TERM_ID}"
8
- fixtures_folder = f"{fixtures_path}/blonkConsultants2016/{TERM_ID}"
9
-
10
-
11
- @patch(f"{class_path}.land_occupation_per_ha", return_value=None)
12
- @patch(f"{class_path}.get_emission_factor", return_value=None)
13
- def test_should_run(mock_factor, mock_landOccupation):
14
- # with land occupation => no run
15
- mock_landOccupation.return_value = 10
16
- should_run, *args = _should_run({'functionalUnit': '1 ha'})
17
- assert not should_run
18
-
19
- # with emission factor => run
20
- mock_factor.return_value = 10
21
- should_run, *args = _should_run({'functionalUnit': '1 ha'})
22
- assert should_run is True
23
-
24
-
25
- @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
26
- def test_run(*args):
27
- with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
28
- cycle = json.load(f)
29
-
30
- with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
31
- expected = json.load(f)
32
-
33
- value = run(cycle)
34
- assert value == expected
@@ -1,9 +0,0 @@
1
- from hestia_earth.models.blonkConsultants2016.utils import get_emission_factor
2
-
3
-
4
- def test_get_emission_factor_no_product_match():
5
- cycle = {'site': {'country': {'@id': 'GADM-ALB'}, 'siteType': 'permanent pasture'}}
6
-
7
- assert get_emission_factor('', cycle, 'co2LandUseChange') == 566.523273292322
8
- assert get_emission_factor('', cycle, 'ch4forestBiomassBurning') == 0.29
9
- assert get_emission_factor('', cycle, 'n2oforestBiomassBurning') == 0.016