hestia-earth-models 0.70.4__py3-none-any.whl → 0.70.6__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.
@@ -118,6 +118,7 @@ def _run_input(cycle: dict):
118
118
  has_ecoinvent_mappings=has_mappings,
119
119
  ecoinvent_mappings=';'.join([v[0] for v in mappings]),
120
120
  has_no_gap_filled_background_emissions=has_no_gap_filled_background_emissions,
121
+ termType_electricityFuel_complete=electricity_complete,
121
122
  input_value=input_value)
122
123
 
123
124
  should_run = all([electricity_complete, has_mappings, has_no_gap_filled_background_emissions, input_value])
@@ -1,8 +1,8 @@
1
1
  from hestia_earth.schema import EmissionMethodTier
2
- from hestia_earth.utils.tools import list_sum
3
2
 
4
- from hestia_earth.models.log import logRequirements, logShouldRun
5
- from .utils import get_fuel_values, _emission
3
+ from hestia_earth.models.log import logRequirements, logShouldRun, log_as_table
4
+ from hestia_earth.models.utils.completeness import _is_term_type_complete
5
+ from .utils import get_fuel_inputs, group_fuel_inputs, _emission, _run_inputs
6
6
  from . import MODEL
7
7
 
8
8
  REQUIREMENTS = {
@@ -20,6 +20,8 @@ REQUIREMENTS = {
20
20
  RETURNS = {
21
21
  "Emission": [{
22
22
  "value": "",
23
+ "inputs": "",
24
+ "operation": "",
23
25
  "methodTier": "tier 1"
24
26
  }]
25
27
  }
@@ -31,23 +33,26 @@ TERM_ID = 'co2ToAirFuelCombustion'
31
33
  TIER = EmissionMethodTier.TIER_1.value
32
34
 
33
35
 
34
- def _run(fuel_values: list):
35
- value = list_sum(fuel_values)
36
- return [_emission(value=value, tier=TIER, term_id=TERM_ID)]
37
-
38
-
39
36
  def _should_run(cycle: dict):
40
- fuel_values = get_fuel_values(TERM_ID, cycle, LOOKUPS['fuel'])
41
- has_fuel = len(fuel_values) > 0
37
+ electricity_complete = _is_term_type_complete(cycle, 'electricityFuel')
38
+ fuel_inputs, valid_inputs = get_fuel_inputs(TERM_ID, cycle, LOOKUPS['fuel'])
42
39
 
43
40
  logRequirements(cycle, model=MODEL, term=TERM_ID,
44
- has_fuel=has_fuel)
41
+ termType_electricityFuel_complete=electricity_complete,
42
+ fuel_inputs=log_as_table(fuel_inputs))
45
43
 
46
- should_run = any([has_fuel])
44
+ should_run = any([bool(valid_inputs), electricity_complete])
47
45
  logShouldRun(cycle, MODEL, TERM_ID, should_run, methodTier=TIER)
48
- return should_run, fuel_values
46
+ return should_run, group_fuel_inputs(valid_inputs)
49
47
 
50
48
 
51
49
  def run(cycle: dict):
52
- should_run, fuel_values = _should_run(cycle)
53
- return _run(fuel_values) if should_run else []
50
+ should_run, fuel_inputs = _should_run(cycle)
51
+ return (
52
+ [
53
+ _run_inputs(inputs, tier=TIER, term_id=TERM_ID)
54
+ for inputs in fuel_inputs.values()
55
+ ] if fuel_inputs else [
56
+ _emission(value=0, tier=TIER, term_id=TERM_ID)
57
+ ]
58
+ ) if should_run else []
@@ -1,8 +1,8 @@
1
1
  from hestia_earth.schema import EmissionMethodTier
2
- from hestia_earth.utils.tools import list_sum
3
2
 
4
- from hestia_earth.models.log import logRequirements, logShouldRun
5
- from .utils import get_fuel_values, _emission
3
+ from hestia_earth.models.log import logRequirements, logShouldRun, log_as_table
4
+ from hestia_earth.models.utils.completeness import _is_term_type_complete
5
+ from .utils import get_fuel_inputs, group_fuel_inputs, _emission, _run_inputs
6
6
  from . import MODEL
7
7
 
8
8
  REQUIREMENTS = {
@@ -10,7 +10,7 @@ REQUIREMENTS = {
10
10
  "or": {
11
11
  "inputs": [
12
12
  {"@type": "Input", "value": "", "term.termType": "fuel", "optional": {
13
- "operation": ""
13
+ "operation": ""
14
14
  }}
15
15
  ],
16
16
  "completeness.electricityFuel": "True"
@@ -20,6 +20,8 @@ REQUIREMENTS = {
20
20
  RETURNS = {
21
21
  "Emission": [{
22
22
  "value": "",
23
+ "inputs": "",
24
+ "operation": "",
23
25
  "methodTier": "tier 1"
24
26
  }]
25
27
  }
@@ -31,23 +33,26 @@ TERM_ID = 'n2OToAirFuelCombustionDirect'
31
33
  TIER = EmissionMethodTier.TIER_1.value
32
34
 
33
35
 
34
- def _run(fuel_values: list):
35
- value = list_sum(fuel_values)
36
- return [_emission(value=value, tier=TIER, term_id=TERM_ID)]
37
-
38
-
39
36
  def _should_run(cycle: dict):
40
- fuel_values = get_fuel_values(TERM_ID, cycle, LOOKUPS['fuel'])
41
- has_fuel = len(fuel_values) > 0
37
+ electricity_complete = _is_term_type_complete(cycle, 'electricityFuel')
38
+ fuel_inputs, valid_inputs = get_fuel_inputs(TERM_ID, cycle, LOOKUPS['fuel'])
42
39
 
43
40
  logRequirements(cycle, model=MODEL, term=TERM_ID,
44
- has_fuel=has_fuel)
41
+ termType_electricityFuel_complete=electricity_complete,
42
+ fuel_inputs=log_as_table(fuel_inputs))
45
43
 
46
- should_run = any([has_fuel])
44
+ should_run = any([bool(valid_inputs), electricity_complete])
47
45
  logShouldRun(cycle, MODEL, TERM_ID, should_run, methodTier=TIER)
48
- return should_run, fuel_values
46
+ return should_run, group_fuel_inputs(valid_inputs)
49
47
 
50
48
 
51
49
  def run(cycle: dict):
52
- should_run, fuel_values = _should_run(cycle)
53
- return _run(fuel_values) if should_run else []
50
+ should_run, fuel_inputs = _should_run(cycle)
51
+ return (
52
+ [
53
+ _run_inputs(inputs, tier=TIER, term_id=TERM_ID)
54
+ for inputs in fuel_inputs.values()
55
+ ] if fuel_inputs else [
56
+ _emission(value=0, tier=TIER, term_id=TERM_ID)
57
+ ]
58
+ ) if should_run else []
@@ -1,8 +1,8 @@
1
1
  from hestia_earth.schema import EmissionMethodTier
2
- from hestia_earth.utils.tools import list_sum
3
2
 
4
- from hestia_earth.models.log import logRequirements, logShouldRun
5
- from .utils import get_fuel_values, _emission
3
+ from hestia_earth.models.log import logRequirements, logShouldRun, log_as_table
4
+ from hestia_earth.models.utils.completeness import _is_term_type_complete
5
+ from .utils import get_fuel_inputs, group_fuel_inputs, _emission, _run_inputs
6
6
  from . import MODEL
7
7
 
8
8
  REQUIREMENTS = {
@@ -20,6 +20,8 @@ REQUIREMENTS = {
20
20
  RETURNS = {
21
21
  "Emission": [{
22
22
  "value": "",
23
+ "inputs": "",
24
+ "operation": "",
23
25
  "methodTier": "tier 1"
24
26
  }]
25
27
  }
@@ -31,23 +33,26 @@ TERM_ID = 'noxToAirFuelCombustion'
31
33
  TIER = EmissionMethodTier.TIER_1.value
32
34
 
33
35
 
34
- def _run(fuel_values: list):
35
- value = list_sum(fuel_values)
36
- return [_emission(value=value, tier=TIER, term_id=TERM_ID)]
37
-
38
-
39
36
  def _should_run(cycle: dict):
40
- fuel_values = get_fuel_values(TERM_ID, cycle, LOOKUPS['fuel'])
41
- has_fuel = len(fuel_values) > 0
37
+ electricity_complete = _is_term_type_complete(cycle, 'electricityFuel')
38
+ fuel_inputs, valid_inputs = get_fuel_inputs(TERM_ID, cycle, LOOKUPS['fuel'])
42
39
 
43
40
  logRequirements(cycle, model=MODEL, term=TERM_ID,
44
- has_fuel=has_fuel)
41
+ termType_electricityFuel_complete=electricity_complete,
42
+ fuel_inputs=log_as_table(fuel_inputs))
45
43
 
46
- should_run = any([has_fuel])
44
+ should_run = any([bool(valid_inputs), electricity_complete])
47
45
  logShouldRun(cycle, MODEL, TERM_ID, should_run, methodTier=TIER)
48
- return should_run, fuel_values
46
+ return should_run, group_fuel_inputs(valid_inputs)
49
47
 
50
48
 
51
49
  def run(cycle: dict):
52
- should_run, fuel_values = _should_run(cycle)
53
- return _run(fuel_values) if should_run else []
50
+ should_run, fuel_inputs = _should_run(cycle)
51
+ return (
52
+ [
53
+ _run_inputs(inputs, tier=TIER, term_id=TERM_ID)
54
+ for inputs in fuel_inputs.values()
55
+ ] if fuel_inputs else [
56
+ _emission(value=0, tier=TIER, term_id=TERM_ID)
57
+ ]
58
+ ) if should_run else []
@@ -1,8 +1,8 @@
1
1
  from hestia_earth.schema import EmissionMethodTier
2
- from hestia_earth.utils.tools import list_sum
3
2
 
4
- from hestia_earth.models.log import logRequirements, logShouldRun
5
- from .utils import get_fuel_values, _emission
3
+ from hestia_earth.models.log import logRequirements, logShouldRun, log_as_table
4
+ from hestia_earth.models.utils.completeness import _is_term_type_complete
5
+ from .utils import get_fuel_inputs, group_fuel_inputs, _emission, _run_inputs
6
6
  from . import MODEL
7
7
 
8
8
  REQUIREMENTS = {
@@ -20,6 +20,8 @@ REQUIREMENTS = {
20
20
  RETURNS = {
21
21
  "Emission": [{
22
22
  "value": "",
23
+ "inputs": "",
24
+ "operation": "",
23
25
  "methodTier": "tier 1"
24
26
  }]
25
27
  }
@@ -31,23 +33,26 @@ TERM_ID = 'so2ToAirFuelCombustion'
31
33
  TIER = EmissionMethodTier.TIER_1.value
32
34
 
33
35
 
34
- def _run(fuel_values: list):
35
- value = list_sum(fuel_values)
36
- return [_emission(value=value, tier=TIER, term_id=TERM_ID)]
37
-
38
-
39
36
  def _should_run(cycle: dict):
40
- fuel_values = get_fuel_values(TERM_ID, cycle, LOOKUPS['fuel'])
41
- has_fuel = len(fuel_values) > 0
37
+ electricity_complete = _is_term_type_complete(cycle, 'electricityFuel')
38
+ fuel_inputs, valid_inputs = get_fuel_inputs(TERM_ID, cycle, LOOKUPS['fuel'])
42
39
 
43
40
  logRequirements(cycle, model=MODEL, term=TERM_ID,
44
- has_fuel=has_fuel)
41
+ termType_electricityFuel_complete=electricity_complete,
42
+ fuel_inputs=log_as_table(fuel_inputs))
45
43
 
46
- should_run = any([has_fuel])
44
+ should_run = any([bool(valid_inputs), electricity_complete])
47
45
  logShouldRun(cycle, MODEL, TERM_ID, should_run, methodTier=TIER)
48
- return should_run, fuel_values
46
+ return should_run, group_fuel_inputs(valid_inputs)
49
47
 
50
48
 
51
49
  def run(cycle: dict):
52
- should_run, fuel_values = _should_run(cycle)
53
- return _run(fuel_values) if should_run else []
50
+ should_run, fuel_inputs = _should_run(cycle)
51
+ return (
52
+ [
53
+ _run_inputs(inputs, tier=TIER, term_id=TERM_ID)
54
+ for inputs in fuel_inputs.values()
55
+ ] if fuel_inputs else [
56
+ _emission(value=0, tier=TIER, term_id=TERM_ID)
57
+ ]
58
+ ) if should_run else []
@@ -1,48 +1,96 @@
1
+ from functools import reduce
1
2
  from hestia_earth.schema import TermTermType, SiteSiteType
2
3
  from hestia_earth.utils.model import filter_list_term_type
3
4
  from hestia_earth.utils.lookup import extract_grouped_data
4
- from hestia_earth.utils.tools import list_sum, safe_parse_float, non_empty_list
5
+ from hestia_earth.utils.tools import list_sum, safe_parse_float
5
6
 
6
7
  from hestia_earth.models.log import logRequirements, logShouldRun
7
8
  from hestia_earth.models.utils.completeness import _is_term_type_complete
9
+ from hestia_earth.models.utils.blank_node import group_by_keys
8
10
  from hestia_earth.models.utils.term import get_lookup_value
9
11
  from hestia_earth.models.utils.cycle import get_animals_by_period
10
12
  from hestia_earth.models.utils.emission import _new_emission
11
13
  from . import MODEL
12
14
 
13
15
 
14
- def _emission(value: float, tier: str, term_id: str):
16
+ def _emission(value: float, tier: str, term_id: str, input: dict = None, operation: dict = None):
15
17
  emission = _new_emission(term_id, MODEL)
16
18
  emission['value'] = [value]
17
19
  emission['methodTier'] = tier
20
+ if input:
21
+ emission['inputs'] = [input]
22
+ if operation:
23
+ emission['operation'] = operation
18
24
  return emission
19
25
 
20
26
 
21
- def _get_fuel_input_value(term_id: str, lookup_col: str):
22
- def get_value(input: dict):
23
- input_term = input.get('term', {})
24
- input_term_id = input_term.get('@id')
25
- operation_term = input.get('operation', {})
26
- input_value = list_sum(input.get('value', []))
27
-
28
- operation_factor = extract_grouped_data(
29
- get_lookup_value(operation_term, lookup_col, model=MODEL, term=term_id), input_term_id
30
- ) if operation_term else None
31
- input_factor = operation_factor or get_lookup_value(input_term, lookup_col, model=MODEL, term=term_id)
32
- factor = safe_parse_float(input_factor, None)
33
-
34
- return input_value * factor if factor is not None else None
35
- return get_value
36
-
27
+ def _run_inputs(inputs: list, tier: str, term_id: str):
28
+ total_value = list_sum([
29
+ (i.get('input-value') or 0) * (i.get('operation-factor') or i.get('input-default-factor') or 0)
30
+ for i in inputs
31
+ ])
32
+ input_term = {
33
+ '@type': 'Term',
34
+ '@id': inputs[0].get('input-id'),
35
+ 'termType': inputs[0].get('input-termType'),
36
+ 'units': inputs[0].get('input-units'),
37
+ }
38
+ operation_term = {
39
+ '@type': 'Term',
40
+ '@id': inputs[0].get('operation-id'),
41
+ 'termType': inputs[0].get('operation-termType'),
42
+ 'units': inputs[0].get('operation-units'),
43
+ } if inputs[0].get('operation-id') else None
44
+ return _emission(
45
+ value=total_value,
46
+ tier=tier,
47
+ term_id=term_id,
48
+ input=input_term,
49
+ operation=operation_term
50
+ )
37
51
 
38
- def get_fuel_values(term_id: str, cycle: dict, lookup_col: str):
39
- inputs = filter_list_term_type(cycle.get('inputs', []), TermTermType.FUEL)
40
- values = non_empty_list(map(_get_fuel_input_value(term_id, lookup_col), inputs))
41
52
 
42
- return [0] if all([
43
- len(values) == 0,
44
- _is_term_type_complete(cycle, 'electricityFuel')
45
- ]) else values
53
+ def _fuel_input_data(term_id: str, lookup_col: str, input: dict):
54
+ input_term = input.get('term', {})
55
+ input_term_id = input_term.get('@id')
56
+ operation_term = input.get('operation', {})
57
+ input_value = list_sum(input.get('value', []), None)
58
+
59
+ operation_factor = extract_grouped_data(
60
+ data=get_lookup_value(operation_term, lookup_col, model=MODEL, term=term_id),
61
+ key=input_term_id
62
+ ) if operation_term else None
63
+ input_factor = get_lookup_value(input_term, lookup_col, model=MODEL, term=term_id)
64
+
65
+ return {
66
+ 'input-id': input_term_id,
67
+ 'input-termType': input_term.get('termType'),
68
+ 'input-units': input_term.get('units'),
69
+ 'input-value': input_value,
70
+ 'input-default-factor': safe_parse_float(input_factor, default=None),
71
+ 'operation-id': operation_term.get('@id'),
72
+ 'operation-termType': operation_term.get('termType'),
73
+ 'operation-units': operation_term.get('units'),
74
+ 'operation-factor': safe_parse_float(operation_factor, default=None)
75
+ }
76
+
77
+
78
+ def get_fuel_inputs(term_id: str, cycle: dict, lookup_col: str):
79
+ inputs = [
80
+ _fuel_input_data(term_id, lookup_col, i)
81
+ for i in filter_list_term_type(cycle.get('inputs', []), TermTermType.FUEL)
82
+ ]
83
+ valid_inputs = [
84
+ i for i in inputs if all([
85
+ i.get('input-value') is not None,
86
+ (i.get('operation-factor') or i.get('input-default-factor')) is not None
87
+ ])
88
+ ]
89
+ return inputs, valid_inputs
90
+
91
+
92
+ def group_fuel_inputs(inputs: list):
93
+ return reduce(group_by_keys(['input-id', 'operation-id']), inputs, {}) if len(inputs) > 0 else None
46
94
 
47
95
 
48
96
  def _get_emissions_factor(animal: dict, lookup_col: str) -> float:
@@ -31,6 +31,7 @@ REQUIREMENTS = {
31
31
  "tillage",
32
32
  "cropResidueManagement",
33
33
  "landUseManagement",
34
+ "pastureManagement",
34
35
  "system",
35
36
  "landCover"
36
37
  ],
@@ -81,6 +82,7 @@ _PRACTICES_TERM_TYPES = [
81
82
  TermTermType.TILLAGE,
82
83
  TermTermType.CROPRESIDUEMANAGEMENT,
83
84
  TermTermType.LANDUSEMANAGEMENT,
85
+ TermTermType.PASTUREMANAGEMENT,
84
86
  TermTermType.SYSTEM,
85
87
  TermTermType.LANDCOVER
86
88
  ]
@@ -133,9 +135,9 @@ def management(data: dict):
133
135
  return node
134
136
 
135
137
 
136
- def _get_cycle_duration(cycle: dict, land_cover_id: str):
138
+ def _get_cycle_duration(cycle: dict, land_cover_id: str = None):
137
139
  cycle_duration = cycle.get('cycleDuration')
138
- lookup_value = None if cycle_duration else safe_parse_float(get_table_value(
140
+ lookup_value = None if cycle_duration or not land_cover_id else safe_parse_float(get_table_value(
139
141
  download_lookup("crop.csv"),
140
142
  column_name('landCoverTermId'),
141
143
  land_cover_id,
@@ -155,7 +157,7 @@ def _gap_filled_date_obj(date_str: str, mode: str = DatestrGapfillMode.END) -> d
155
157
  )
156
158
 
157
159
 
158
- def _gap_filled_start_date(land_cover_id: str, end_date: str, cycle: dict) -> dict:
160
+ def _gap_filled_start_date(cycle: dict, end_date: str, land_cover_id: str = None) -> dict:
159
161
  """If possible, gap-fill the startDate based on the endDate - cycleDuration"""
160
162
  cycle_duration = _get_cycle_duration(cycle, land_cover_id)
161
163
  return {
@@ -214,9 +216,9 @@ def _get_relevant_items(cycle: dict, item_name: str, term_types: List[TermTermTy
214
216
  _include_with_date_gap_fill(cycle, ["startDate", "endDate"]) |
215
217
  _include(
216
218
  _gap_filled_start_date(
217
- land_cover_id=get_landCover_term_id(item.get('term', {})),
219
+ cycle=cycle,
218
220
  end_date=item.get("endDate") if "endDate" in item else cycle.get("endDate", ""),
219
- cycle=cycle
221
+ land_cover_id=get_landCover_term_id(item.get('term', {})),
220
222
  ) if "startDate" not in item else {},
221
223
  "startDate"
222
224
  ) |
@@ -253,12 +255,17 @@ def _run_from_siteType(site: dict, cycle: dict):
253
255
  site_type = site.get('siteType')
254
256
  site_type_id = get_landCover_term_id_from_site_type(site_type) if site_type not in _SKIP_LAND_COVER_SITE_TYPES \
255
257
  else None
258
+ start_date = cycle.get('startDate') or _gap_filled_start_date(
259
+ cycle=cycle,
260
+ end_date=cycle.get('endDate'),
261
+ land_cover_id=site_type_id
262
+ ).get('startDate')
256
263
 
257
- should_run = all([site_type_id])
264
+ should_run = all([site_type_id, start_date])
258
265
  return [{
259
266
  'id': site_type_id,
260
267
  'value': 100,
261
- 'startDate': cycle.get('startDate'),
268
+ 'startDate': start_date,
262
269
  'endDate': cycle.get('endDate')
263
270
  }] if should_run else []
264
271
 
@@ -3714,11 +3714,11 @@
3714
3714
  "results": [
3715
3715
  {
3716
3716
  "@type": "Term",
3717
- "@id": "residueIncorporatedLessThan30DaysBeforeCultivation"
3717
+ "@id": "residueIncorporated"
3718
3718
  },
3719
3719
  {
3720
3720
  "@type": "Term",
3721
- "@id": "residueIncorporated"
3721
+ "@id": "residueIncorporatedLessThan30DaysBeforeCultivation"
3722
3722
  },
3723
3723
  {
3724
3724
  "@type": "Term",
@@ -3770,27 +3770,27 @@
3770
3770
  },
3771
3771
  {
3772
3772
  "@type": "Term",
3773
- "@id": "aboveGroundCropResidueIncorporated"
3773
+ "@id": "aboveGroundCropResidueBurnt"
3774
3774
  },
3775
3775
  {
3776
3776
  "@type": "Term",
3777
- "@id": "aboveGroundCropResidueTotal"
3777
+ "@id": "belowGroundCropResidue"
3778
3778
  },
3779
3779
  {
3780
3780
  "@type": "Term",
3781
- "@id": "discardedCropRemoved"
3781
+ "@id": "aboveGroundCropResidueLeftOnField"
3782
3782
  },
3783
3783
  {
3784
3784
  "@type": "Term",
3785
- "@id": "aboveGroundCropResidueBurnt"
3785
+ "@id": "aboveGroundCropResidueIncorporated"
3786
3786
  },
3787
3787
  {
3788
3788
  "@type": "Term",
3789
- "@id": "belowGroundCropResidue"
3789
+ "@id": "aboveGroundCropResidueTotal"
3790
3790
  },
3791
3791
  {
3792
3792
  "@type": "Term",
3793
- "@id": "aboveGroundCropResidueLeftOnField"
3793
+ "@id": "discardedCropRemoved"
3794
3794
  }
3795
3795
  ]
3796
3796
  },
@@ -3824,15 +3824,15 @@
3824
3824
  },
3825
3825
  {
3826
3826
  "@type": "Term",
3827
- "@id": "digestibleEnergyPigs"
3827
+ "@id": "digestibleEnergyPoultry"
3828
3828
  },
3829
3829
  {
3830
3830
  "@type": "Term",
3831
- "@id": "digestibleEnergySalmonids"
3831
+ "@id": "digestibleEnergyPigs"
3832
3832
  },
3833
3833
  {
3834
3834
  "@type": "Term",
3835
- "@id": "digestibleEnergyPoultry"
3835
+ "@id": "digestibleEnergySalmonids"
3836
3836
  },
3837
3837
  {
3838
3838
  "@type": "Term",
@@ -3954,43 +3954,43 @@
3954
3954
  },
3955
3955
  {
3956
3956
  "@type": "Term",
3957
- "@id": "excretaPoultryKgN"
3957
+ "@id": "excretaDeerKgN"
3958
3958
  },
3959
3959
  {
3960
3960
  "@type": "Term",
3961
- "@id": "excretaBeefCattleExceptFeedlotFedKgN"
3961
+ "@id": "excretaSolidFishCrustaceansKgN"
3962
3962
  },
3963
3963
  {
3964
3964
  "@type": "Term",
3965
- "@id": "excretaDucksKgN"
3965
+ "@id": "excretaGoatsKgN"
3966
3966
  },
3967
3967
  {
3968
3968
  "@type": "Term",
3969
- "@id": "excretaDeerKgN"
3969
+ "@id": "excretaPoultryKgN"
3970
3970
  },
3971
3971
  {
3972
3972
  "@type": "Term",
3973
- "@id": "excretaSolidFishCrustaceansKgN"
3973
+ "@id": "excretaBeefCattleExceptFeedlotFedKgN"
3974
3974
  },
3975
3975
  {
3976
3976
  "@type": "Term",
3977
- "@id": "excretaGoatsKgN"
3977
+ "@id": "excretaDucksKgN"
3978
3978
  },
3979
3979
  {
3980
3980
  "@type": "Term",
3981
- "@id": "excretaKgN"
3981
+ "@id": "excretaBeefCattleFeedlotFedKgN"
3982
3982
  },
3983
3983
  {
3984
3984
  "@type": "Term",
3985
- "@id": "excretaGeeseKgN"
3985
+ "@id": "excretaKgN"
3986
3986
  },
3987
3987
  {
3988
3988
  "@type": "Term",
3989
- "@id": "excretaInsectsKgN"
3989
+ "@id": "excretaGeeseKgN"
3990
3990
  },
3991
3991
  {
3992
3992
  "@type": "Term",
3993
- "@id": "excretaBeefCattleFeedlotFedKgN"
3993
+ "@id": "excretaInsectsKgN"
3994
3994
  },
3995
3995
  {
3996
3996
  "@type": "Term",
@@ -4067,15 +4067,15 @@
4067
4067
  },
4068
4068
  {
4069
4069
  "@type": "Term",
4070
- "@id": "excretaCamelsKgVs"
4070
+ "@id": "excretaPigsKgVs"
4071
4071
  },
4072
4072
  {
4073
4073
  "@type": "Term",
4074
- "@id": "excretaPigsKgVs"
4074
+ "@id": "excretaDucksKgVs"
4075
4075
  },
4076
4076
  {
4077
4077
  "@type": "Term",
4078
- "@id": "excretaDucksKgVs"
4078
+ "@id": "excretaCamelsKgVs"
4079
4079
  },
4080
4080
  {
4081
4081
  "@type": "Term",
@@ -4111,19 +4111,19 @@
4111
4111
  },
4112
4112
  {
4113
4113
  "@type": "Term",
4114
- "@id": "excretaBeefCattleExceptFeedlotFedKgVs"
4114
+ "@id": "excretaBeefCattleFeedlotFedKgVs"
4115
4115
  },
4116
4116
  {
4117
4117
  "@type": "Term",
4118
- "@id": "excretaDeerKgVs"
4118
+ "@id": "excretaBeefCattleExceptFeedlotFedKgVs"
4119
4119
  },
4120
4120
  {
4121
4121
  "@type": "Term",
4122
- "@id": "excretaBeefCattleFeedlotFedKgVs"
4122
+ "@id": "excretaKgVs"
4123
4123
  },
4124
4124
  {
4125
4125
  "@type": "Term",
4126
- "@id": "excretaKgVs"
4126
+ "@id": "excretaDeerKgVs"
4127
4127
  }
4128
4128
  ]
4129
4129
  },
@@ -4180,7 +4180,7 @@
4180
4180
  "@type": "Term",
4181
4181
  "name": "Generic crop, seed",
4182
4182
  "@id": "genericCropSeed",
4183
- "_score": 22.501667
4183
+ "_score": 22.555262
4184
4184
  }
4185
4185
  ]
4186
4186
  },
@@ -4462,139 +4462,139 @@
4462
4462
  "@type": "Term",
4463
4463
  "name": "Glass or high accessible cover",
4464
4464
  "@id": "glassOrHighAccessibleCover",
4465
- "_score": 60.218697
4465
+ "_score": 59.47878
4466
4466
  },
4467
4467
  {
4468
4468
  "@type": "Term",
4469
4469
  "name": "Sea or ocean",
4470
4470
  "@id": "seaOrOcean",
4471
- "_score": 51.201225
4471
+ "_score": 50.576153
4472
4472
  },
4473
4473
  {
4474
4474
  "@type": "Term",
4475
4475
  "name": "River or stream",
4476
4476
  "@id": "riverOrStream",
4477
- "_score": 47.790024
4477
+ "_score": 47.491074
4478
4478
  },
4479
4479
  {
4480
4480
  "@type": "Term",
4481
4481
  "name": "Agri-food processor",
4482
4482
  "@id": "agriFoodProcessor",
4483
- "_score": 40.49057
4483
+ "_score": 40.75738
4484
4484
  },
4485
4485
  {
4486
4486
  "@type": "Term",
4487
4487
  "name": "Other natural vegetation",
4488
4488
  "@id": "otherNaturalVegetation",
4489
- "_score": 39.96792
4489
+ "_score": 40.4433
4490
4490
  },
4491
4491
  {
4492
4492
  "@type": "Term",
4493
4493
  "name": "Food retailer",
4494
4494
  "@id": "foodRetailer",
4495
- "_score": 39.138306
4495
+ "_score": 38.745514
4496
4496
  },
4497
4497
  {
4498
4498
  "@type": "Term",
4499
4499
  "name": "Natural forest",
4500
4500
  "@id": "naturalForest",
4501
- "_score": 30.200647
4501
+ "_score": 30.624483
4502
4502
  },
4503
4503
  {
4504
4504
  "@type": "Term",
4505
4505
  "name": "Animal housing",
4506
4506
  "@id": "animalHousing",
4507
- "_score": 27.085962
4507
+ "_score": 26.857834
4508
4508
  },
4509
4509
  {
4510
4510
  "@type": "Term",
4511
4511
  "name": "Permanent pasture",
4512
4512
  "@id": "permanentPasture",
4513
- "_score": 26.270697
4513
+ "_score": 26.749058
4514
4514
  },
4515
4515
  {
4516
4516
  "@type": "Term",
4517
4517
  "name": "Root or tuber crop plant",
4518
4518
  "@id": "rootOrTuberCropPlant",
4519
- "_score": 25.623035
4519
+ "_score": 24.92852
4520
4520
  },
4521
4521
  {
4522
4522
  "@type": "Term",
4523
4523
  "name": "Permanent cropland",
4524
4524
  "@id": "permanentCropland",
4525
- "_score": 18.975834
4525
+ "_score": 19.406992
4526
4526
  },
4527
4527
  {
4528
4528
  "@type": "Term",
4529
4529
  "name": "Forest",
4530
4530
  "@id": "forest",
4531
- "_score": 18.592783
4531
+ "_score": 18.911707
4532
4532
  },
4533
4533
  {
4534
4534
  "@type": "Term",
4535
4535
  "name": "Primary forest",
4536
4536
  "@id": "primaryForest",
4537
- "_score": 18.581348
4537
+ "_score": 18.139027
4538
4538
  },
4539
4539
  {
4540
4540
  "@type": "Term",
4541
- "name": "Lake",
4542
- "@id": "lake",
4543
- "_score": 17.686426
4541
+ "name": "Other land",
4542
+ "@id": "otherLand",
4543
+ "_score": 17.894175
4544
4544
  },
4545
4545
  {
4546
4546
  "@type": "Term",
4547
- "name": "Plantation forest",
4548
- "@id": "plantationForest",
4549
- "_score": 17.621328
4547
+ "name": "Lake",
4548
+ "@id": "lake",
4549
+ "_score": 17.666122
4550
4550
  },
4551
4551
  {
4552
4552
  "@type": "Term",
4553
- "name": "Other land",
4554
- "@id": "otherLand",
4555
- "_score": 17.56675
4553
+ "name": "Secondary forest",
4554
+ "@id": "secondaryForest",
4555
+ "_score": 17.617908
4556
4556
  },
4557
4557
  {
4558
4558
  "@type": "Term",
4559
- "name": "Secondary forest",
4560
- "@id": "secondaryForest",
4561
- "_score": 17.368475
4559
+ "name": "Plantation forest",
4560
+ "@id": "plantationForest",
4561
+ "_score": 17.53842
4562
4562
  },
4563
4563
  {
4564
4564
  "@type": "Term",
4565
4565
  "name": "Red sea plume alga",
4566
4566
  "@id": "redSeaPlumeAlga",
4567
- "_score": 16.392815
4567
+ "_score": 16.275637
4568
4568
  },
4569
4569
  {
4570
4570
  "@type": "Term",
4571
4571
  "name": "Sea kale plant",
4572
4572
  "@id": "seaKalePlant",
4573
- "_score": 15.716124
4573
+ "_score": 15.965439
4574
4574
  },
4575
4575
  {
4576
4576
  "@type": "Term",
4577
4577
  "name": "Pond",
4578
4578
  "@id": "pond",
4579
- "_score": 13.998917
4579
+ "_score": 13.767712
4580
4580
  },
4581
4581
  {
4582
4582
  "@type": "Term",
4583
4583
  "name": "River tamarind tree",
4584
4584
  "@id": "riverTamarindTree",
4585
- "_score": 12.513928
4585
+ "_score": 12.494918
4586
4586
  },
4587
4587
  {
4588
4588
  "@type": "Term",
4589
4589
  "name": "Cropland",
4590
4590
  "@id": "cropland",
4591
- "_score": 9.387705
4591
+ "_score": 9.371357
4592
4592
  },
4593
4593
  {
4594
4594
  "@type": "Term",
4595
4595
  "name": "Annual cropland",
4596
4596
  "@id": "annualCropland",
4597
- "_score": 8.634094
4597
+ "_score": 8.962797
4598
4598
  }
4599
4599
  ]
4600
4600
  },
@@ -7435,11 +7435,11 @@
7435
7435
  "results": [
7436
7436
  {
7437
7437
  "@type": "Term",
7438
- "@id": "fullTillage"
7438
+ "@id": "ridgeTillage"
7439
7439
  },
7440
7440
  {
7441
7441
  "@type": "Term",
7442
- "@id": "minimumTillage"
7442
+ "@id": "noTillage"
7443
7443
  },
7444
7444
  {
7445
7445
  "@type": "Term",
@@ -7455,15 +7455,15 @@
7455
7455
  },
7456
7456
  {
7457
7457
  "@type": "Term",
7458
- "@id": "ridgeTillage"
7458
+ "@id": "verticalTillage"
7459
7459
  },
7460
7460
  {
7461
7461
  "@type": "Term",
7462
- "@id": "noTillage"
7462
+ "@id": "fullTillage"
7463
7463
  },
7464
7464
  {
7465
7465
  "@type": "Term",
7466
- "@id": "verticalTillage"
7466
+ "@id": "minimumTillage"
7467
7467
  },
7468
7468
  {
7469
7469
  "@type": "Term",
@@ -113,7 +113,10 @@ def properties_logs(blank_nodes: list, properties: Union[dict, list]):
113
113
 
114
114
  def group_by_keys(group_keys: list = ['term']):
115
115
  def run(group: dict, node: dict):
116
- group_key = '-'.join(non_empty_list(map(lambda v: node.get(v, {}).get('@id'), group_keys)))
116
+ group_key = '-'.join(non_empty_list([
117
+ node.get(v, {}).get('@id') if isinstance(node.get(v), dict) else node.get(v)
118
+ for v in group_keys
119
+ ]))
117
120
  group[group_key] = group.get(group_key, []) + [node]
118
121
  return group
119
122
  return run
@@ -1 +1 @@
1
- VERSION = '0.70.4'
1
+ VERSION = '0.70.6'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hestia-earth-models
3
- Version: 0.70.4
3
+ Version: 0.70.6
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
@@ -4,7 +4,7 @@ hestia_earth/models/cache_sites.py,sha256=BOhLkkdVWLJ-4Z7kxfQ8swqrYgZ43sACn1uzxY
4
4
  hestia_earth/models/log.py,sha256=eRuH86v7Thuw-QXdKqaqVmA_MkwnOCo0UBEwtuDq4Oc,3554
5
5
  hestia_earth/models/preload_requests.py,sha256=vK_G1UzhNMhYy7ymnCtHUz_vv3cfApCSKqv29VREEBQ,1943
6
6
  hestia_earth/models/requirements.py,sha256=eU4yT443fx7BnaokhrLB_PCizJI7Y6m4auyo8vQauNg,17363
7
- hestia_earth/models/version.py,sha256=7q8eaZImIkwl8HS2xJTe4a8IOQPn1y4oCngs2Qu-BuM,19
7
+ hestia_earth/models/version.py,sha256=kHvvtSr85q7ToIOOm0D5M9RTwVyE-adBX6WrA6LbJ68,19
8
8
  hestia_earth/models/agribalyse2016/__init__.py,sha256=WvK0qCQbnYtg9oZxrACd1wGormZyXibPtpCnIQeDqbw,415
9
9
  hestia_earth/models/agribalyse2016/fuelElectricity.py,sha256=1ngl8pdxeNhlVV8keAeWRwGorr_1uFXM9EoPUWx-uSc,4382
10
10
  hestia_earth/models/agribalyse2016/machineryInfrastructureDepreciatedAmountPerCycle.py,sha256=queToXuzq0tQ9_XuUJ2pJgSywXmbt9uX3ZoIKgqkROM,2660
@@ -102,21 +102,21 @@ hestia_earth/models/ecoalimV9/impact_assessment.py,sha256=HY2hvAq9Fv-rreroHdWpXx
102
102
  hestia_earth/models/ecoalimV9/utils.py,sha256=AWmWQhjvze3J6s35bH-EQIGc58xCeMA8_56hQD7CX8A,1170
103
103
  hestia_earth/models/ecoinventV3/__init__.py,sha256=qKJRphRIlcE52yxUARkolijZgXoB27t3hJeU6nRDKpA,5084
104
104
  hestia_earth/models/ecoinventV3/utils.py,sha256=RxqaHB9hr0RdTKSjfvDN0pC8DIOyxMCr4I_xjas1POw,460
105
- hestia_earth/models/ecoinventV3AndEmberClimate/__init__.py,sha256=7deu8P0SUfYe1u-Y2MOgI2psddgzr3U9BN6H3oU6n0E,5764
105
+ hestia_earth/models/ecoinventV3AndEmberClimate/__init__.py,sha256=N2XY-DADYgxHvPsery5wg7K_m_S83o-HMR0LtHd4uHE,5844
106
106
  hestia_earth/models/ecoinventV3AndEmberClimate/utils.py,sha256=AzslK6YB0jxVMLfkLVmhHpkM7mx639N0mIWbErD6GMw,1133
107
107
  hestia_earth/models/edip2003/__init__.py,sha256=nyB0CI2gNmRAXj-203aJHQMmETYhcY-dHbMABOhJ7YI,409
108
108
  hestia_earth/models/edip2003/ozoneDepletionPotential.py,sha256=YkBct4eDUidGukaVdd2iaEouq_FckuG8l_7pgBQgCBw,1033
109
109
  hestia_earth/models/emepEea2019/__init__.py,sha256=l90-pWrqIzt1ap1WNk0gF4iZeF5_TSG62hE83bIi4rQ,412
110
- hestia_earth/models/emepEea2019/co2ToAirFuelCombustion.py,sha256=ib_xzEbIg-iQwvW2L4BosD9lV6EYOXAiIs8gYhSD9GE,1431
111
- hestia_earth/models/emepEea2019/n2OToAirFuelCombustionDirect.py,sha256=H4dgGqDuvYN4S7TRxYsX3hms1xMWr8clR2gkyyO8T18,1438
110
+ hestia_earth/models/emepEea2019/co2ToAirFuelCombustion.py,sha256=TPzbKxV-AZ9yx_tJNGhuNsfRJQNfH4a0JEtPGLKc-tA,1833
111
+ hestia_earth/models/emepEea2019/n2OToAirFuelCombustionDirect.py,sha256=y0N_GhixisN6ScfKCpahrZe2CWOwl9ayDesO_erXX68,1839
112
112
  hestia_earth/models/emepEea2019/nh3ToAirExcreta.py,sha256=DssSjl_Kug9jE5laqJs9X4xOdOrJBnsXSnk-uA_anyE,2153
113
113
  hestia_earth/models/emepEea2019/nh3ToAirInorganicFertiliser.py,sha256=7G0_S0G6X9slTykxs6CDb68DvtXB7yfq1iSKg0ReXS8,6036
114
- hestia_earth/models/emepEea2019/noxToAirFuelCombustion.py,sha256=2--8lI6C6WaYtd9LQe-WZnhvW1eUsjBVAgzT8jclcsc,1431
114
+ hestia_earth/models/emepEea2019/noxToAirFuelCombustion.py,sha256=OlrCPBuOBGlvPh_ufO8fFzSvxvkJduX7tlqzEab6qzs,1833
115
115
  hestia_earth/models/emepEea2019/pm10ToAirAnimalHousing.py,sha256=7LhOEQokWMWEPspYSQO3PtsmWkygbVAonj_Nq6JAL6c,1384
116
116
  hestia_earth/models/emepEea2019/pm25ToAirAnimalHousing.py,sha256=IzGQrRv9Pk0o1Vq18HRWZ10jhmjFG59ijfn_VYAUJIA,1384
117
- hestia_earth/models/emepEea2019/so2ToAirFuelCombustion.py,sha256=8B1GVsn5gEXVW3iZYBct-s_OTRaH-asXo6JvGW_jls0,1431
117
+ hestia_earth/models/emepEea2019/so2ToAirFuelCombustion.py,sha256=OC53aE0uCmUxgZcqQjyhjjFPZ5U5Rdfv8l8wYihcYY4,1833
118
118
  hestia_earth/models/emepEea2019/tspToAirAnimalHousing.py,sha256=TaT5GyYK6MyJQHKApBe-u4fMjqXXdmuBEtUcRYnkhac,1381
119
- hestia_earth/models/emepEea2019/utils.py,sha256=oTHjbRRwJZv_tpO9MOlfpyQRmN0a1kvEZsVHUPliZpQ,4014
119
+ hestia_earth/models/emepEea2019/utils.py,sha256=YIHxVu4GwCbxBI5FzsmJ91itWNGx0vnBTCePSwlCnz8,5629
120
120
  hestia_earth/models/emissionNotRelevant/__init__.py,sha256=yAunIZI_4nGV0khRiGhbZAmXmMiuICzEH-pvzWX1lpM,3000
121
121
  hestia_earth/models/environmentalFootprintV3_1/__init__.py,sha256=tF2WrWiV1Wzi2vnRiNXdfPWfmVxgVu9w9-7eA6PA7-s,473
122
122
  hestia_earth/models/environmentalFootprintV3_1/environmentalFootprintSingleOverallScore.py,sha256=tRx2rRlSDupAWTfB9MqvqwrUCWHy-r-3gHjbgVOYLTs,5239
@@ -205,7 +205,7 @@ hestia_earth/models/hestia/landTransformation100YearAverageDuringCycle.py,sha256
205
205
  hestia_earth/models/hestia/landTransformation20YearAverageDuringCycle.py,sha256=1StzrYhMsX-hdwBTeLnLMZWl5EEnCoEYpGPRkqy8a-A,1016
206
206
  hestia_earth/models/hestia/liveAnimal.py,sha256=95HfqgFA_qRhdIeR2X5MJ9zzIm4nMHDvJ0BCnuTYe5Q,3860
207
207
  hestia_earth/models/hestia/longFallowRatio.py,sha256=LkJaER1VNDI5351-oC8tru-LgiPK3sNMg0NhB5ic9RE,1690
208
- hestia_earth/models/hestia/management.py,sha256=e1horZLE0th9hazG1sGod_yWs8Hk8FiHFYzJXLNTzFA,10975
208
+ hestia_earth/models/hestia/management.py,sha256=TJRdiV5XQBtK3YBOZsC-Off-9RMYrvYgkzylpPVRizw,11281
209
209
  hestia_earth/models/hestia/materialAndSubstrate.py,sha256=abmM_7FOY5yaNb2yZEm-ncI4wFFcbzaebtnG9XWEA6M,5130
210
210
  hestia_earth/models/hestia/milkYield.py,sha256=__3AdxRTUTWwS_GsqxFpPGklmTnnpADiN0khlRCMAss,5541
211
211
  hestia_earth/models/hestia/netPrimaryProduction.py,sha256=uU4AZ7X6tbtWgR5YClA_aLpYWtlivq9lPQGZgt3-qoQ,1856
@@ -444,7 +444,7 @@ hestia_earth/models/linkedImpactAssessment/utils.py,sha256=S1zlux02gU2Lajrtoq-zQ
444
444
  hestia_earth/models/mocking/__init__.py,sha256=9VX50c-grz-snfd-7MBS0KfF7AadtbKuj7kK6PqtsgE,687
445
445
  hestia_earth/models/mocking/build_mock_search.py,sha256=p15ccEUmkmLp1RiGNznxMz3OFHbI8P1-29ExuohiQN8,1355
446
446
  hestia_earth/models/mocking/mock_search.py,sha256=ccFe_WrI73JElFmxp4hPNLCX7eeU--lBC1JFR901KJY,1069
447
- hestia_earth/models/mocking/search-results.json,sha256=F6U3nD8mxFGo1q8NNatlR0mkjOYL4kjvaN2eXLN_xH0,162465
447
+ hestia_earth/models/mocking/search-results.json,sha256=lb0aRVXU24w4ofPm58jtYWOzq32DTopjaUDnD0SeBDQ,162462
448
448
  hestia_earth/models/pooreNemecek2018/__init__.py,sha256=nPboL7ULJzL5nJD5q7q9VOZt_fxbKVm8fmn1Az5YkVY,417
449
449
  hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py,sha256=Qt-mel4dkhK6N5uUOutNOinCTFjbjtGzITaaI0LvYc4,2396
450
450
  hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py,sha256=JT0RybbvWVlo01FO8K0Yj41HrEaJT3Kj1xfayr2X-xw,2315
@@ -591,7 +591,7 @@ hestia_earth/models/utils/animalProduct.py,sha256=M5IunAKGY6oZv3j1Ascl34ywyeLWAp
591
591
  hestia_earth/models/utils/aquacultureManagement.py,sha256=dxrbC1Xf140cohxTbSw6TxLAnAASWTdNZwBBam4yQnw,171
592
592
  hestia_earth/models/utils/array_builders.py,sha256=ko1pDZKaUudZqxOZ99vJamKAdoR6ND4ZmxVrYH6YjPc,19498
593
593
  hestia_earth/models/utils/background_emissions.py,sha256=R0tCA63q1_2DaZ87oI7FFjZsxAZ4Zds3Rr4fDf9KhkM,1850
594
- hestia_earth/models/utils/blank_node.py,sha256=KZizahEIqZafxJ_OXL0za7QILc4AledEnHDQoxyaNI8,55961
594
+ hestia_earth/models/utils/blank_node.py,sha256=zQhMFG4o7kUQY0J_7g84E8E1hwatSRZINTUb6fELB2s,56040
595
595
  hestia_earth/models/utils/cache_sources.py,sha256=MBkrPpjwNiC4ApDjeYVHZjWBbpvAerXRDrMHpjasAZ0,377
596
596
  hestia_earth/models/utils/completeness.py,sha256=iRG4uviOAQQ4T2Nr4LlelPVTS_F1felGZNJYxek_JG8,1239
597
597
  hestia_earth/models/utils/constant.py,sha256=DmB3VVuoh7Pz2QDBJqiUG6yAML2i0fOy1BPuPHmhT1w,3442
@@ -743,16 +743,16 @@ tests/models/ecoalimV9/test_impact_assessment.py,sha256=9Br_jis2MT85kS1IvBfPE9x7
743
743
  tests/models/edip2003/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
744
744
  tests/models/edip2003/test_ozoneDepletionPotential.py,sha256=z0kimdTxzSr8_K5eScbkxq2SB9nbBp41IHqVNR4Nh4Y,688
745
745
  tests/models/emepEea2019/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
746
- tests/models/emepEea2019/test_co2ToAirFuelCombustion.py,sha256=z1H17R_Erox2dMg8xylGB0qt9BMZSwfLAoEMVv9z878,1518
747
- tests/models/emepEea2019/test_n2OToAirFuelCombustionDirect.py,sha256=4uemriZAyJBSn-xMttRpxqVHOFNBXlboVODHQYl65zQ,1524
746
+ tests/models/emepEea2019/test_co2ToAirFuelCombustion.py,sha256=SrCx1-mW0s-flisF9Zf6W_A8VtJ67sWga8pGgS713b8,1135
747
+ tests/models/emepEea2019/test_n2OToAirFuelCombustionDirect.py,sha256=dTkrj2i5QibBuHaCgV8n2dB02y0nJAwhR35WcOquHOQ,1141
748
748
  tests/models/emepEea2019/test_nh3ToAirExcreta.py,sha256=lTPftCJinvokmgUcUikl8hN_axFa8OyCTXvL0PaSRFg,1111
749
749
  tests/models/emepEea2019/test_nh3ToAirInorganicFertiliser.py,sha256=f623Pp6XTt9YPDr2QymAJEQ_yfx0_TZGndmawD8ZX98,2134
750
- tests/models/emepEea2019/test_noxToAirFuelCombustion.py,sha256=HpuzWyFmfatFXwTZd8TVpHb6Kfj2Ru3IO1gHnSiuKtQ,1518
750
+ tests/models/emepEea2019/test_noxToAirFuelCombustion.py,sha256=iFVQVYImXxB5JE8b38UAUG4q8grfbniZi1cWdLQoViE,1135
751
751
  tests/models/emepEea2019/test_pm10ToAirAnimalHousing.py,sha256=xGlQeJkdP638zbHivxAqvliZCRpcogMFZYVCMWw6j3c,715
752
752
  tests/models/emepEea2019/test_pm25ToAirAnimalHousing.py,sha256=cs3UaJ7ucCryOaQy0sbL9AiuC8l_N7uywmPZHcr3pC0,715
753
- tests/models/emepEea2019/test_so2ToAirFuelCombustion.py,sha256=zRTyeeQM1fRdRVFWbtCNndaddDbKHU1xLzmp_psDceE,1518
753
+ tests/models/emepEea2019/test_so2ToAirFuelCombustion.py,sha256=RkC_ux5bxo6bIdcXIG_97uRstWXBnmZO3DOW4IfgRx0,1135
754
754
  tests/models/emepEea2019/test_tspToAirAnimalHousing.py,sha256=4MNDsxIeUk5_3IvZwEZslxgoPNyQN9OQFDNY3uGNX6E,714
755
- tests/models/emepEea2019/test_utils.py,sha256=G6z8tEfWM0OPnUBaFCQgQyEi5-kRF_DqsqdYaPnzR_I,8761
755
+ tests/models/emepEea2019/test_utils.py,sha256=MUIeHgcCHLhbYWgleKIiKqO2Q4RX321J53YpOt9cogA,7060
756
756
  tests/models/environmentalFootprintV3_1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
757
757
  tests/models/environmentalFootprintV3_1/test_environmentalFootprintSingleOverallScore.py,sha256=F4oz4UadhpBlyh4JvLPOWAxGSIKnJVTTDaSzOT3Ihgk,4909
758
758
  tests/models/environmentalFootprintV3_1/test_freshwaterEcotoxicityPotentialCtue.py,sha256=WE-DcerljCjXMYE4f3Sv5ZCVHP0oTjbWkOGuvaa4p10,926
@@ -841,7 +841,7 @@ tests/models/hestia/test_landTransformation100YearAverageDuringCycle.py,sha256=3
841
841
  tests/models/hestia/test_landTransformation20YearAverageDuringCycle.py,sha256=bUByojQuVeuCfko1_2YtNJi1PT9yktHlcbPi_p-MPvk,1001
842
842
  tests/models/hestia/test_liveAnimal.py,sha256=3K9cL1fwr6LlBl1_D8zIaeCOuiExqkDEU7BXx1JK_dk,2139
843
843
  tests/models/hestia/test_longFallowRatio.py,sha256=OVd6NByAXeCAOx9ux_m8IJwnEF-fqIaBOoKFSGWhyO0,1513
844
- tests/models/hestia/test_management.py,sha256=h5rNqAgh3ehTlH4MEGBp4ryhZOoA2EXj_Q3lZcufbUk,1738
844
+ tests/models/hestia/test_management.py,sha256=p7j5ooACr0XBf2-hZWwwYE0-sfsoakIa2qKZhE32ZUQ,1800
845
845
  tests/models/hestia/test_materialsAndSubstrate.py,sha256=szM6aBBc1_9MDQFM1-OiW4SOKvEIO6mYYEpjHB-wI9g,1430
846
846
  tests/models/hestia/test_milkYield.py,sha256=m7SRiKb_u8SDF7Q5gX39AKr4bsrNqibXgMgzSmJJEPA,1778
847
847
  tests/models/hestia/test_netPrimaryProduction.py,sha256=--q6NB90gmpeJNBR16l3AgBsXGXwww_d1vOcWiMa-k8,1110
@@ -1243,8 +1243,8 @@ tests/orchestrator/strategies/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
1243
1243
  tests/orchestrator/strategies/run/test_add_blank_node_if_missing.py,sha256=K4xg4UAXfNhSaLyknKVPO7MGBF44Z_gD7CuZ_pe28gU,3512
1244
1244
  tests/orchestrator/strategies/run/test_add_key_if_missing.py,sha256=hKwvk1ohcBVnQUCTiDhRW99J0xEa29BpwFi1KC0yWLE,329
1245
1245
  tests/orchestrator/strategies/run/test_always.py,sha256=w5-Dhp6yLzgZGAeMRz3OrqZbbAed9gZ1O266a3z9k7w,134
1246
- hestia_earth_models-0.70.4.dist-info/LICENSE,sha256=TD25LoiRJsA5CPUNrcyt1PXlGcbUGFMAeZoBcfCrCNE,1154
1247
- hestia_earth_models-0.70.4.dist-info/METADATA,sha256=HEELN8DDxe3Qa6j7Ach7OnNlGpjQnMIVXWkW6dUVyNo,4045
1248
- hestia_earth_models-0.70.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1249
- hestia_earth_models-0.70.4.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1250
- hestia_earth_models-0.70.4.dist-info/RECORD,,
1246
+ hestia_earth_models-0.70.6.dist-info/LICENSE,sha256=TD25LoiRJsA5CPUNrcyt1PXlGcbUGFMAeZoBcfCrCNE,1154
1247
+ hestia_earth_models-0.70.6.dist-info/METADATA,sha256=UeHwB1HpSIPArmEhOgJPi80K2xc9CP3Ux_fDfaJ617w,4045
1248
+ hestia_earth_models-0.70.6.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1249
+ hestia_earth_models-0.70.6.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1250
+ hestia_earth_models-0.70.6.dist-info/RECORD,,
@@ -2,26 +2,13 @@ from unittest.mock import patch
2
2
  import json
3
3
  from tests.utils import fixtures_path, fake_new_emission
4
4
 
5
- from hestia_earth.models.emepEea2019.co2ToAirFuelCombustion import MODEL, TERM_ID, run, _should_run
5
+ from hestia_earth.models.emepEea2019.co2ToAirFuelCombustion import MODEL, TERM_ID, run
6
6
 
7
7
  class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
8
  model_utils_path = f"hestia_earth.models.{MODEL}.utils"
9
9
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
10
10
 
11
11
 
12
- @patch(f"{class_path}.get_fuel_values")
13
- def test_should_run(mock_get_fuel_values):
14
- # no fuel values => no run
15
- mock_get_fuel_values.return_value = []
16
- should_run, *args = _should_run({})
17
- assert not should_run
18
-
19
- # with fuel values => run
20
- mock_get_fuel_values.return_value = [0]
21
- should_run, *args = _should_run({})
22
- assert should_run is True
23
-
24
-
25
12
  @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
26
13
  def test_run(*args):
27
14
  with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
@@ -2,26 +2,13 @@ from unittest.mock import patch
2
2
  import json
3
3
  from tests.utils import fixtures_path, fake_new_emission
4
4
 
5
- from hestia_earth.models.emepEea2019.n2OToAirFuelCombustionDirect import MODEL, TERM_ID, run, _should_run
5
+ from hestia_earth.models.emepEea2019.n2OToAirFuelCombustionDirect import MODEL, TERM_ID, run
6
6
 
7
7
  class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
8
  model_utils_path = f"hestia_earth.models.{MODEL}.utils"
9
9
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
10
10
 
11
11
 
12
- @patch(f"{class_path}.get_fuel_values")
13
- def test_should_run(mock_get_fuel_values):
14
- # no fuel values => no run
15
- mock_get_fuel_values.return_value = []
16
- should_run, *args = _should_run({})
17
- assert not should_run
18
-
19
- # with fuel values => run
20
- mock_get_fuel_values.return_value = [0]
21
- should_run, *args = _should_run({})
22
- assert should_run is True
23
-
24
-
25
12
  @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
26
13
  def test_run(*args):
27
14
  with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
@@ -2,26 +2,13 @@ from unittest.mock import patch
2
2
  import json
3
3
  from tests.utils import fixtures_path, fake_new_emission
4
4
 
5
- from hestia_earth.models.emepEea2019.noxToAirFuelCombustion import MODEL, TERM_ID, run, _should_run
5
+ from hestia_earth.models.emepEea2019.noxToAirFuelCombustion import MODEL, TERM_ID, run
6
6
 
7
7
  class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
8
  model_utils_path = f"hestia_earth.models.{MODEL}.utils"
9
9
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
10
10
 
11
11
 
12
- @patch(f"{class_path}.get_fuel_values")
13
- def test_should_run(mock_get_fuel_values):
14
- # no fuel values => no run
15
- mock_get_fuel_values.return_value = []
16
- should_run, *args = _should_run({})
17
- assert not should_run
18
-
19
- # with fuel values => run
20
- mock_get_fuel_values.return_value = [0]
21
- should_run, *args = _should_run({})
22
- assert should_run is True
23
-
24
-
25
12
  @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
26
13
  def test_run(*args):
27
14
  with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
@@ -2,26 +2,13 @@ from unittest.mock import patch
2
2
  import json
3
3
  from tests.utils import fixtures_path, fake_new_emission
4
4
 
5
- from hestia_earth.models.emepEea2019.so2ToAirFuelCombustion import MODEL, TERM_ID, run, _should_run
5
+ from hestia_earth.models.emepEea2019.so2ToAirFuelCombustion import MODEL, TERM_ID, run
6
6
 
7
7
  class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
8
  model_utils_path = f"hestia_earth.models.{MODEL}.utils"
9
9
  fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
10
10
 
11
11
 
12
- @patch(f"{class_path}.get_fuel_values")
13
- def test_should_run(mock_get_fuel_values):
14
- # no fuel values => no run
15
- mock_get_fuel_values.return_value = []
16
- should_run, *args = _should_run({})
17
- assert not should_run
18
-
19
- # with fuel values => run
20
- mock_get_fuel_values.return_value = [0]
21
- should_run, *args = _should_run({})
22
- assert should_run is True
23
-
24
-
25
12
  @patch(f"{model_utils_path}._new_emission", side_effect=fake_new_emission)
26
13
  def test_run(*args):
27
14
  with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
@@ -1,8 +1,6 @@
1
- from unittest.mock import patch
2
-
3
1
  import pytest
4
2
 
5
- from hestia_earth.models.emepEea2019.utils import get_fuel_values, should_run_animal, _duration_in_housing
3
+ from hestia_earth.models.emepEea2019.utils import should_run_animal, _duration_in_housing
6
4
 
7
5
  class_path = 'hestia_earth.models.emepEea2019.utils'
8
6
  TERMS = [
@@ -11,52 +9,6 @@ TERMS = [
11
9
  ]
12
10
 
13
11
 
14
- @patch(f"{class_path}._is_term_type_complete", return_value=True)
15
- def test_get_fuel_values_no_inputs_complete(*args):
16
- cycle = {'@type': 'Cycle', 'inputs': []}
17
- assert get_fuel_values('co2ToAirFuelCombustion', cycle, '') == [0]
18
-
19
-
20
- @patch(f"{class_path}._is_term_type_complete", return_value=False)
21
- def test_get_fuel_values_no_inputs_incomplete(*args):
22
- cycle = {'@type': 'Cycle', 'inputs': []}
23
- assert get_fuel_values('co2ToAirFuelCombustion', cycle, '') == []
24
-
25
- cycle = {'@type': 'Transformation', 'inputs': []}
26
- assert get_fuel_values('co2ToAirFuelCombustion', cycle, '') == []
27
-
28
-
29
- def test_get_fuel_values(*args):
30
- cycle = {
31
- '@type': 'Cycle',
32
- 'inputs': [
33
- {
34
- 'term': {'@id': 'diesel', 'termType': 'fuel'},
35
- 'value': [100]
36
- },
37
- {
38
-
39
- 'term': {'@id': 'diesel', 'termType': 'fuel'},
40
- 'operation': {'@id': 'crushingWoodMachineUnspecified', 'termType': 'operation'},
41
- 'value': [200]
42
- },
43
- {
44
-
45
- 'term': {'@id': 'diesel', 'termType': 'fuel'},
46
- 'operation': {'@id': 'helicopterUseOperationUnspecified', 'termType': 'operation'},
47
- 'value': [150]
48
- },
49
- {
50
- 'term': {'@id': 'marineGasOil', 'termType': 'fuel'},
51
- 'operation': {'@id': 'crushingWoodMachineUnspecified', 'termType': 'operation'},
52
- 'value': [50]
53
- }
54
- ]
55
- }
56
- result = get_fuel_values('co2ToAirFuelCombustion', cycle, 'co2ToAirFuelCombustionEmepEea2019')
57
- assert result == [317.0, 632.0, 475.5, 158.5]
58
-
59
-
60
12
  @pytest.mark.parametrize(
61
13
  "test_name,cycle,expected_duration",
62
14
  [
@@ -13,7 +13,8 @@ fixtures_folder = os.path.join(fixtures_path, MODEL, MODEL_KEY)
13
13
  _LAND_COVER_TERM_BY_SITE_TYPE = {
14
14
  SiteSiteType.ANIMAL_HOUSING.value: "animalHousing",
15
15
  SiteSiteType.CROPLAND.value: "cropland",
16
- SiteSiteType.AGRI_FOOD_PROCESSOR.value: "agriFoodProcessor"
16
+ SiteSiteType.AGRI_FOOD_PROCESSOR.value: "agriFoodProcessor",
17
+ SiteSiteType.PERMANENT_PASTURE.value: "permanentPasture"
17
18
  }
18
19
  _folders = [d for d in os.listdir(fixtures_folder) if os.path.isdir(os.path.join(fixtures_folder, d))]
19
20