hestia-earth-models 0.61.2__py3-none-any.whl → 0.61.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.

Files changed (53) hide show
  1. hestia_earth/models/cycle/startDateDefinition.py +0 -1
  2. hestia_earth/models/ecoinventV3/__init__.py +6 -2
  3. hestia_earth/models/ecoinventV3AndEmberClimate/__init__.py +125 -0
  4. hestia_earth/models/ecoinventV3AndEmberClimate/utils.py +125 -0
  5. hestia_earth/models/emepEea2019/nh3ToAirInorganicFertiliser.py +10 -4
  6. hestia_earth/models/ipcc2006/n2OToAirInorganicFertiliserDirect.py +16 -8
  7. hestia_earth/models/ipcc2006/n2OToAirInorganicFertiliserIndirect.py +16 -8
  8. hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserDirect.py +15 -7
  9. hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserIndirect.py +15 -7
  10. hestia_earth/models/ipcc2019/animal/pastureGrass.py +1 -1
  11. hestia_earth/models/ipcc2019/animal/weightAtMaturity.py +104 -0
  12. hestia_earth/models/ipcc2019/ch4ToAirFloodedRice.py +15 -2
  13. hestia_earth/models/ipcc2019/n2OToAirInorganicFertiliserDirect.py +16 -8
  14. hestia_earth/models/ipcc2019/n2OToAirOrganicFertiliserDirect.py +16 -9
  15. hestia_earth/models/ipcc2019/nh3ToAirInorganicFertiliser.py +6 -0
  16. hestia_earth/models/ipcc2019/nh3ToAirOrganicFertiliser.py +9 -3
  17. hestia_earth/models/ipcc2019/no3ToGroundwaterInorganicFertiliser.py +16 -8
  18. hestia_earth/models/ipcc2019/no3ToGroundwaterOrganicFertiliser.py +6 -0
  19. hestia_earth/models/ipcc2019/noxToAirInorganicFertiliser.py +6 -0
  20. hestia_earth/models/ipcc2019/noxToAirOrganicFertiliser.py +9 -3
  21. hestia_earth/models/mocking/search-results.json +165 -114
  22. hestia_earth/models/pooreNemecek2018/no3ToGroundwaterInorganicFertiliser.py +16 -8
  23. hestia_earth/models/pooreNemecek2018/no3ToGroundwaterOrganicFertiliser.py +16 -8
  24. hestia_earth/models/schererPfister2015/pToDrainageWaterSoilFlux.py +13 -1
  25. hestia_earth/models/schererPfister2015/pToSurfaceWaterSoilFlux.py +13 -1
  26. hestia_earth/models/schererPfister2015/utils.py +3 -3
  27. hestia_earth/models/site/management.py +13 -6
  28. hestia_earth/models/site/organicCarbonPerHa.py +6 -4
  29. hestia_earth/models/stehfestBouwman2006/n2OToAirInorganicFertiliserDirect.py +16 -8
  30. hestia_earth/models/stehfestBouwman2006/n2OToAirOrganicFertiliserDirect.py +16 -8
  31. hestia_earth/models/stehfestBouwman2006/noxToAirInorganicFertiliser.py +16 -8
  32. hestia_earth/models/stehfestBouwman2006/noxToAirOrganicFertiliser.py +16 -8
  33. hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirInorganicFertiliser.py +16 -8
  34. hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirOrganicFertiliser.py +16 -8
  35. hestia_earth/models/utils/blank_node.py +29 -0
  36. hestia_earth/models/utils/cycle.py +6 -4
  37. hestia_earth/models/utils/fertiliser.py +14 -0
  38. hestia_earth/models/utils/inorganicFertiliser.py +7 -0
  39. hestia_earth/models/utils/organicFertiliser.py +9 -0
  40. hestia_earth/models/utils/pesticideAI.py +6 -17
  41. hestia_earth/models/utils/term.py +22 -0
  42. hestia_earth/models/version.py +1 -1
  43. hestia_earth/models/webbEtAl2012AndSintermannEtAl2012/nh3ToAirOrganicFertiliser.py +17 -9
  44. {hestia_earth_models-0.61.2.dist-info → hestia_earth_models-0.61.4.dist-info}/METADATA +2 -2
  45. {hestia_earth_models-0.61.2.dist-info → hestia_earth_models-0.61.4.dist-info}/RECORD +53 -46
  46. tests/models/ipcc2019/animal/test_weightAtMaturity.py +20 -0
  47. tests/models/ipcc2019/test_ch4ToAirEntericFermentation.py +0 -5
  48. tests/models/site/test_management.py +8 -4
  49. tests/models/test_ecoinventV3.py +1 -1
  50. tests/models/test_ecoinventV3AndEmberClimate.py +93 -0
  51. {hestia_earth_models-0.61.2.dist-info → hestia_earth_models-0.61.4.dist-info}/LICENSE +0 -0
  52. {hestia_earth_models-0.61.2.dist-info → hestia_earth_models-0.61.4.dist-info}/WHEEL +0 -0
  53. {hestia_earth_models-0.61.2.dist-info → hestia_earth_models-0.61.4.dist-info}/top_level.txt +0 -0
@@ -12,15 +12,23 @@ from . import MODEL
12
12
  REQUIREMENTS = {
13
13
  "Cycle": {
14
14
  "completeness.fertiliser": "True",
15
- "inputs": [{
16
- "@type": "Input",
17
- "value": "",
18
- "term.units": ["kg", "kg N"],
19
- "term.termType": "organicFertiliser",
20
- "optional": {
21
- "properties": [{"@type": "Property", "value": "", "term.@id": "nitrogenContent"}]
15
+ "inputs": [
16
+ {
17
+ "@type": "Input",
18
+ "value": "",
19
+ "term.units": ["kg", "kg N"],
20
+ "term.termType": "organicFertiliser",
21
+ "optional": {
22
+ "properties": [{"@type": "Property", "value": "", "term.@id": "nitrogenContent"}]
23
+ }
24
+ },
25
+ {
26
+ "@type": "Input",
27
+ "value": "",
28
+ "term.termType": "fertiliserBrandName",
29
+ "properties": [{"@type": "Property", "value": "", "key.termType": "organicFertiliser"}]
22
30
  }
23
- }],
31
+ ],
24
32
  "optional": {
25
33
  "endDate": "",
26
34
  "site": {
@@ -74,7 +82,6 @@ def _run(cycle: dict, N_total: float, ecoClimateZone: str = None, flooded_rice:
74
82
  factors_used=log_as_table(factors),
75
83
  aggregated=aggregated)
76
84
 
77
- print(N_total, get_atomic_conversion(Units.KG_N2O, Units.TO_N), factors['value'])
78
85
  value = converted_N_total * factors['value']
79
86
  min = converted_N_total * factors['min']
80
87
  max = converted_N_total * factors['max']
@@ -22,6 +22,12 @@ REQUIREMENTS = {
22
22
  "optional": {
23
23
  "properties": [{"@type": "Property", "value": "", "term.@id": "nitrogenContent"}]
24
24
  }
25
+ },
26
+ {
27
+ "@type": "Input",
28
+ "value": "",
29
+ "term.termType": "fertiliserBrandName",
30
+ "properties": [{"@type": "Property", "value": "", "key.termType": "inorganicFertiliser"}]
25
31
  }
26
32
  ]
27
33
  }
@@ -1,5 +1,4 @@
1
- from hestia_earth.schema import EmissionMethodTier, EmissionStatsDefinition, TermTermType
2
- from hestia_earth.utils.model import filter_list_term_type
1
+ from hestia_earth.schema import EmissionMethodTier, EmissionStatsDefinition
3
2
  from hestia_earth.utils.tools import list_sum
4
3
 
5
4
  from hestia_earth.models.log import logRequirements, logShouldRun, debugValues, log_as_table
@@ -9,6 +8,7 @@ from hestia_earth.models.utils.completeness import _is_term_type_complete
9
8
  from hestia_earth.models.utils.emission import _new_emission
10
9
  from hestia_earth.models.utils.cycle import get_organic_fertiliser_N_total
11
10
  from hestia_earth.models.utils.term import get_lookup_value
11
+ from hestia_earth.models.utils.organicFertiliser import get_cycle_inputs as get_organicFertiliser_inputs
12
12
  from . import MODEL
13
13
 
14
14
  REQUIREMENTS = {
@@ -22,6 +22,12 @@ REQUIREMENTS = {
22
22
  "optional": {
23
23
  "properties": [{"@type": "Property", "value": "", "term.@id": "nitrogenContent"}]
24
24
  }
25
+ },
26
+ {
27
+ "@type": "Input",
28
+ "value": "",
29
+ "term.termType": "fertiliserBrandName",
30
+ "properties": [{"@type": "Property", "value": "", "key.termType": "organicFertiliser"}]
25
31
  }
26
32
  ]
27
33
  }
@@ -70,7 +76,7 @@ def _filter_input_values(values: list, key: str): return [value for value in val
70
76
 
71
77
 
72
78
  def _run(cycle: dict):
73
- inputs = filter_list_term_type(cycle.get('inputs', []), TermTermType.ORGANICFERTILISER)
79
+ inputs = get_organicFertiliser_inputs(cycle)
74
80
  input_values = list(map(_input_values, inputs))
75
81
 
76
82
  debugValues(cycle, model=MODEL, term=TERM_ID,
@@ -12,15 +12,23 @@ REQUIREMENTS = {
12
12
  "Cycle": {
13
13
  "completeness.fertiliser": "True",
14
14
  "completeness.water": "True",
15
- "inputs": [{
16
- "@type": "Input",
17
- "value": "",
18
- "term.units": ["kg", "kg N"],
19
- "term.termType": "inorganicFertiliser",
20
- "optional": {
21
- "properties": [{"@type": "Property", "value": "", "term.@id": "nitrogenContent"}]
15
+ "inputs": [
16
+ {
17
+ "@type": "Input",
18
+ "value": "",
19
+ "term.units": ["kg", "kg N"],
20
+ "term.termType": "inorganicFertiliser",
21
+ "optional": {
22
+ "properties": [{"@type": "Property", "value": "", "term.@id": "nitrogenContent"}]
23
+ }
24
+ },
25
+ {
26
+ "@type": "Input",
27
+ "value": "",
28
+ "term.termType": "fertiliserBrandName",
29
+ "properties": [{"@type": "Property", "value": "", "key.termType": "inorganicFertiliser"}]
22
30
  }
23
- }],
31
+ ],
24
32
  "site": {
25
33
  "@type": "Site",
26
34
  "measurements": [{"@type": "Measurement", "value": "", "term.@id": "ecoClimateZone"}]
@@ -20,6 +20,12 @@ REQUIREMENTS = {
20
20
  "optional": {
21
21
  "properties": [{"@type": "Property", "value": "", "term.@id": "nitrogenContent"}]
22
22
  }
23
+ },
24
+ {
25
+ "@type": "Input",
26
+ "value": "",
27
+ "term.termType": "fertiliserBrandName",
28
+ "properties": [{"@type": "Property", "value": "", "key.termType": "organicFertiliser"}]
23
29
  }
24
30
  ],
25
31
  "site": {
@@ -22,6 +22,12 @@ REQUIREMENTS = {
22
22
  "optional": {
23
23
  "properties": [{"@type": "Property", "value": "", "term.@id": "nitrogenContent"}]
24
24
  }
25
+ },
26
+ {
27
+ "@type": "Input",
28
+ "value": "",
29
+ "term.termType": "fertiliserBrandName",
30
+ "properties": [{"@type": "Property", "value": "", "key.termType": "inorganicFertiliser"}]
25
31
  }
26
32
  ]
27
33
  }
@@ -1,5 +1,4 @@
1
- from hestia_earth.schema import EmissionMethodTier, EmissionStatsDefinition, TermTermType
2
- from hestia_earth.utils.model import filter_list_term_type
1
+ from hestia_earth.schema import EmissionMethodTier, EmissionStatsDefinition
3
2
  from hestia_earth.utils.tools import list_sum
4
3
 
5
4
  from hestia_earth.models.log import logRequirements, logShouldRun, debugValues, log_as_table
@@ -9,6 +8,7 @@ from hestia_earth.models.utils.completeness import _is_term_type_complete
9
8
  from hestia_earth.models.utils.emission import _new_emission
10
9
  from hestia_earth.models.utils.cycle import get_organic_fertiliser_N_total
11
10
  from hestia_earth.models.utils.term import get_lookup_value
11
+ from hestia_earth.models.utils.organicFertiliser import get_cycle_inputs as get_organicFertiliser_inputs
12
12
  from . import MODEL
13
13
 
14
14
  REQUIREMENTS = {
@@ -22,6 +22,12 @@ REQUIREMENTS = {
22
22
  "optional": {
23
23
  "properties": [{"@type": "Property", "value": "", "term.@id": "nitrogenContent"}]
24
24
  }
25
+ },
26
+ {
27
+ "@type": "Input",
28
+ "value": "",
29
+ "term.termType": "fertiliserBrandName",
30
+ "properties": [{"@type": "Property", "value": "", "key.termType": "organicFertiliser"}]
25
31
  }
26
32
  ]
27
33
  }
@@ -70,7 +76,7 @@ def _filter_input_values(values: list, key: str): return [value for value in val
70
76
 
71
77
 
72
78
  def _run(cycle: dict):
73
- inputs = filter_list_term_type(cycle.get('inputs', []), TermTermType.ORGANICFERTILISER)
79
+ inputs = get_organicFertiliser_inputs(cycle)
74
80
  input_values = list(map(_input_values, inputs))
75
81
 
76
82
  debugValues(cycle, model=MODEL, term=TERM_ID,