hestia-earth-models 0.75.0__py3-none-any.whl → 0.75.2__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.

Files changed (58) hide show
  1. hestia_earth/models/aware/scarcityWeightedWaterUse.py +2 -4
  2. hestia_earth/models/aware2_0/scarcityWeightedWaterUse.py +2 -5
  3. hestia_earth/models/chaudharyBrooks2018/utils.py +2 -2
  4. hestia_earth/models/cml2001Baseline/abioticResourceDepletionFossilFuels.py +3 -2
  5. hestia_earth/models/cml2001Baseline/abioticResourceDepletionMineralsAndMetals.py +13 -6
  6. hestia_earth/models/config/Cycle.json +15 -0
  7. hestia_earth/models/cycle/product/economicValueShare.py +4 -4
  8. hestia_earth/models/ecoalimV9/utils.py +3 -3
  9. hestia_earth/models/ecoinventV3/utils.py +2 -2
  10. hestia_earth/models/ecoinventV3AndEmberClimate/utils.py +2 -2
  11. hestia_earth/models/emissionNotRelevant/__init__.py +2 -2
  12. hestia_earth/models/environmentalFootprintV3_1/environmentalFootprintSingleOverallScore.py +1 -2
  13. hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandOccupation.py +8 -5
  14. hestia_earth/models/faostat2018/utils.py +3 -3
  15. hestia_earth/models/frischknechtEtAl2000/ionisingRadiationKbqU235Eq.py +5 -4
  16. hestia_earth/models/geospatialDatabase/ecoClimateZone.py +2 -2
  17. hestia_earth/models/geospatialDatabase/histosol.py +31 -11
  18. hestia_earth/models/hestia/aboveGroundCropResidueTotal.py +2 -2
  19. hestia_earth/models/hestia/landCover_utils.py +8 -12
  20. hestia_earth/models/hestia/management.py +3 -3
  21. hestia_earth/models/hestia/seed_emissions.py +2 -2
  22. hestia_earth/models/hestia/soilClassification.py +31 -13
  23. hestia_earth/models/ipcc2019/animal/pastureGrass.py +3 -1
  24. hestia_earth/models/ipcc2019/burning_utils.py +406 -4
  25. hestia_earth/models/ipcc2019/ch4ToAirEntericFermentation.py +12 -9
  26. hestia_earth/models/ipcc2019/ch4ToAirExcreta.py +28 -10
  27. hestia_earth/models/ipcc2019/ch4ToAirOrganicSoilCultivation.py +8 -11
  28. hestia_earth/models/ipcc2019/co2ToAirOrganicSoilCultivation.py +9 -12
  29. hestia_earth/models/ipcc2019/emissionsToAirOrganicSoilBurning.py +516 -0
  30. hestia_earth/models/ipcc2019/n2OToAirOrganicSoilCultivationDirect.py +10 -13
  31. hestia_earth/models/ipcc2019/nonCo2EmissionsToAirNaturalVegetationBurning.py +56 -433
  32. hestia_earth/models/ipcc2019/organicSoilCultivation_utils.py +2 -2
  33. hestia_earth/models/ipcc2019/pastureGrass.py +3 -1
  34. hestia_earth/models/ipcc2019/pastureGrass_utils.py +6 -3
  35. hestia_earth/models/ipcc2019/utils.py +3 -2
  36. hestia_earth/models/linkedImpactAssessment/emissions.py +2 -2
  37. hestia_earth/models/mocking/search-results.json +1 -1
  38. hestia_earth/models/requirements.py +2 -2
  39. hestia_earth/models/utils/aggregated.py +2 -2
  40. hestia_earth/models/utils/background_emissions.py +6 -5
  41. hestia_earth/models/utils/blank_node.py +68 -0
  42. hestia_earth/models/utils/ecoClimateZone.py +7 -8
  43. hestia_earth/models/utils/excretaManagement.py +3 -3
  44. hestia_earth/models/utils/feedipedia.py +7 -7
  45. hestia_earth/models/utils/impact_assessment.py +3 -0
  46. hestia_earth/models/utils/input.py +2 -2
  47. hestia_earth/models/utils/liveAnimal.py +4 -4
  48. hestia_earth/models/utils/lookup.py +15 -20
  49. hestia_earth/models/utils/property.py +3 -3
  50. hestia_earth/models/utils/term.py +5 -5
  51. hestia_earth/models/version.py +1 -1
  52. hestia_earth/orchestrator/models/transformations.py +2 -2
  53. hestia_earth/orchestrator/strategies/merge/merge_node.py +32 -2
  54. {hestia_earth_models-0.75.0.dist-info → hestia_earth_models-0.75.2.dist-info}/METADATA +2 -2
  55. {hestia_earth_models-0.75.0.dist-info → hestia_earth_models-0.75.2.dist-info}/RECORD +58 -57
  56. {hestia_earth_models-0.75.0.dist-info → hestia_earth_models-0.75.2.dist-info}/WHEEL +0 -0
  57. {hestia_earth_models-0.75.0.dist-info → hestia_earth_models-0.75.2.dist-info}/licenses/LICENSE +0 -0
  58. {hestia_earth_models-0.75.0.dist-info → hestia_earth_models-0.75.2.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  from hestia_earth.schema import TermTermType
2
2
  from hestia_earth.utils.api import download_hestia
3
- from hestia_earth.utils.lookup import download_lookup, get_table_value, column_name, extract_grouped_data
3
+ from hestia_earth.utils.lookup import download_lookup, get_table_value, extract_grouped_data
4
4
  from hestia_earth.utils.tools import list_sum, safe_parse_float
5
5
 
6
6
  from hestia_earth.models.log import debugValues
@@ -33,7 +33,7 @@ def _get_activityCoefficient(animal: dict, systems: list) -> float:
33
33
 
34
34
  values = [(
35
35
  safe_parse_float(
36
- get_table_value(lookup, 'termid', system.get('term', {}).get('@id'), column_name(term_id)),
36
+ get_table_value(lookup, 'term.id', system.get('term', {}).get('@id'), term_id),
37
37
  default=0
38
38
  ),
39
39
  list_sum(system.get('value', [0]))
@@ -153,7 +153,10 @@ def _get_pregnancy_ratio_per_birth(animal: dict, value: str) -> float:
153
153
  def _get_pregnancy_ratio(animal: dict) -> float:
154
154
  term = animal.get('term', {})
155
155
  value = get_lookup_value(term, 'ratioCPregnancyNetEnergyPregnancyIpcc2019', model=MODEL, model_key=MODEL_KEY)
156
- return _get_pregnancy_ratio_per_birth(animal, value) if ';' in value else safe_parse_float(value, default=0)
156
+ return (
157
+ _get_pregnancy_ratio_per_birth(animal, value) if isinstance(value, str) and ';' in value else
158
+ safe_parse_float(value, default=0)
159
+ )
157
160
 
158
161
 
159
162
  def _calculate_NEp(cycle: dict, animal: dict, NEm: float) -> float:
@@ -1,12 +1,12 @@
1
1
  from hestia_earth.schema import TermTermType
2
2
  from hestia_earth.utils.model import find_term_match, filter_list_term_type
3
3
  from hestia_earth.utils.tools import safe_parse_float
4
+ from hestia_earth.utils.lookup import download_lookup, get_table_value
4
5
 
5
6
  from hestia_earth.models.log import debugValues
6
7
  from hestia_earth.models.utils.input import get_total_irrigation_m3
7
8
  from hestia_earth.models.utils.cycle import get_ecoClimateZone
8
9
  from hestia_earth.models.utils.term import get_lookup_value, get_milkYield_terms
9
- from hestia_earth.models.utils.ecoClimateZone import get_ecoClimateZone_lookup_value
10
10
  from . import MODEL
11
11
 
12
12
  # From IPCC2019 Indirect N2O emission factor, in N [avg, min, max, std]
@@ -129,7 +129,8 @@ def _get_waterRegime_lookup(model_term_id: str, practice: dict, col: str):
129
129
 
130
130
 
131
131
  def _is_wet(ecoClimateZone: str = None):
132
- return get_ecoClimateZone_lookup_value(ecoClimateZone, 'wet') == 1 if ecoClimateZone else None
132
+ lookup = download_lookup('ecoClimateZone.csv')
133
+ return None if ecoClimateZone is None else get_table_value(lookup, 'ecoClimateZone', int(ecoClimateZone), 'wet')
133
134
 
134
135
 
135
136
  def ecoClimate_factors(factors: dict, input_term_type: TermTermType = None, ecoClimateZone: str = None):
@@ -1,6 +1,6 @@
1
1
  from functools import reduce
2
2
  from hestia_earth.schema import EmissionMethodTier
3
- from hestia_earth.utils.lookup import download_lookup, get_table_value, column_name
3
+ from hestia_earth.utils.lookup import download_lookup, get_table_value
4
4
  from hestia_earth.utils.tools import flatten, list_sum, pick
5
5
  from hestia_earth.utils.blank_node import group_by_keys
6
6
 
@@ -100,7 +100,7 @@ def _run_emission(cycle: dict, emission_term_id: str, data: dict):
100
100
 
101
101
  def _emission_group(term_id: str):
102
102
  lookup = download_lookup('emission.csv', True)
103
- return get_table_value(lookup, 'termid', term_id, column_name('inputProductionGroupId'))
103
+ return get_table_value(lookup, 'term.id', term_id, 'inputProductionGroupId')
104
104
 
105
105
 
106
106
  def _group_emissions(impact: dict):