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

@@ -12,34 +12,34 @@ from . import MODEL
12
12
  from .utils import get_coefficient_factor
13
13
 
14
14
  REQUIREMENTS = {
15
- "Cycle": {
16
- "siteDuration": "> 0",
17
- "siteArea": "> 0",
18
- "site": {"siteType": "",
19
- "@type": "Site",
20
- "management": [{"@type": "Management", "value": "", "term.termType": "landCover"}],
21
- "country": {"@type": "Term", "termType": "region"}
22
- },
23
- "optional": {
24
- "otherSitesDuration": "> 0",
25
- "otherSitesArea": "> 0",
26
- "otherSites": [
27
- {
28
- "siteType": "",
15
+ "ImpactAssessment": {
16
+ "cycle": {
17
+ "@type": "Cycle",
18
+ "siteDuration": "> 0",
19
+ "siteArea": "> 0",
20
+ "site": {
21
+ "siteType": "",
22
+ "@type": "Site",
23
+ "management": [{"@type": "Management", "value": "", "term.termType": "landCover"}],
24
+ "country": {"@type": "Term", "termType": "region"}
25
+ },
26
+ "optional": {
27
+ "otherSitesDuration": "> 0",
28
+ "otherSitesArea": "> 0",
29
+ "otherSites": [{
29
30
  "@type": "Site",
31
+ "siteType": "",
30
32
  "management": [{"@type": "Management", "value": "", "term.termType": "landCover"}],
31
33
  "country": {"@type": "Term", "termType": "region"}
32
- }
33
- ]
34
+ }]
35
+ }
34
36
  }
35
37
  }
36
38
  }
37
39
  LOOKUPS = {
38
40
  "@doc": "Performs lookup on landCover.csv for column headers and region-pefTermGrouping-landOccupation.csv for CFs",
39
41
  "region-pefTermGrouping-landOccupation": "",
40
- "landCover": [
41
- "pefTermGrouping"
42
- ]
42
+ "landCover": "pefTermGrouping"
43
43
  }
44
44
 
45
45
  RETURNS = {
@@ -62,7 +62,8 @@ def _run(sites: list):
62
62
  return _indicator(list_sum(values)) if values else None
63
63
 
64
64
 
65
- def _should_run(cycle: dict):
65
+ def _should_run(impact_assessment: dict):
66
+ cycle = impact_assessment.get('cycle', {})
66
67
  end_date = cycle.get('endDate')
67
68
 
68
69
  has_site = bool(cycle.get('site', False))
@@ -123,6 +124,6 @@ def _should_run(cycle: dict):
123
124
  return should_run, valid_sites
124
125
 
125
126
 
126
- def run(cycle: dict):
127
- should_run, sites = _should_run(cycle)
127
+ def run(impact_assessment: dict):
128
+ should_run, sites = _should_run(impact_assessment)
128
129
  return _run(sites) if should_run else None