hestia-earth-models 0.73.3__py3-none-any.whl → 0.73.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.
- hestia_earth/models/akagiEtAl2011/utils.py +12 -13
- hestia_earth/models/ipcc2019/n2OToAirCropResidueBurningDirect.py +4 -10
- hestia_earth/models/mocking/search-results.json +669 -669
- hestia_earth/models/utils/cropResidue.py +2 -2
- hestia_earth/models/version.py +1 -1
- {hestia_earth_models-0.73.3.dist-info → hestia_earth_models-0.73.4.dist-info}/METADATA +1 -1
- {hestia_earth_models-0.73.3.dist-info → hestia_earth_models-0.73.4.dist-info}/RECORD +13 -13
- tests/models/akagiEtAl2011/test_utils.py +3 -2
- tests/models/ipcc2019/test_n2OToAirCropResidueBurningDirect.py +3 -2
- tests/models/utils/test_cropResidue.py +4 -4
- {hestia_earth_models-0.73.3.dist-info → hestia_earth_models-0.73.4.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.73.3.dist-info → hestia_earth_models-0.73.4.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.73.3.dist-info → hestia_earth_models-0.73.4.dist-info}/top_level.txt +0 -0
|
@@ -21,27 +21,26 @@ def _emission(term_id: str, value: float, sd: float = None):
|
|
|
21
21
|
return emission
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
def _run(term_id: str,
|
|
25
|
-
value
|
|
26
|
-
term = {'termType': TermTermType.EMISSION.value, '@id': term_id}
|
|
27
|
-
factor = get_lookup_value(term, LOOKUP_NAME)
|
|
28
|
-
factor_sd = get_lookup_value(term, LOOKUP_NAME + '-sd')
|
|
29
|
-
emission_value = multiply_values([value, factor])
|
|
30
|
-
return [] if emission_value is None else [_emission(term_id, emission_value, multiply_values([value, factor_sd]))]
|
|
24
|
+
def _run(term_id: str, value: float, factor: float, factor_sd: float = None):
|
|
25
|
+
return [_emission(term_id, value * factor, multiply_values([value, factor_sd]))]
|
|
31
26
|
|
|
32
27
|
|
|
33
28
|
def _should_run(term_id: str, cycle: dict):
|
|
34
29
|
crop_residue_burnt_value = get_crop_residue_burnt_value(cycle)
|
|
35
|
-
|
|
30
|
+
term = {'termType': TermTermType.EMISSION.value, '@id': term_id}
|
|
31
|
+
factor = get_lookup_value(term, LOOKUP_NAME)
|
|
32
|
+
factor_sd = get_lookup_value(term, LOOKUP_NAME + '-sd')
|
|
36
33
|
|
|
37
34
|
logRequirements(cycle, model=MODEL, term=term_id,
|
|
38
|
-
|
|
35
|
+
crop_residue_burnt_value=crop_residue_burnt_value,
|
|
36
|
+
burning_factor=factor,
|
|
37
|
+
burning_factor_sd=factor_sd)
|
|
39
38
|
|
|
40
|
-
should_run = all([
|
|
39
|
+
should_run = all([crop_residue_burnt_value is not None, factor is not None])
|
|
41
40
|
logShouldRun(cycle, MODEL, term_id, should_run, methodTier=TIER)
|
|
42
|
-
return should_run, crop_residue_burnt_value
|
|
41
|
+
return should_run, crop_residue_burnt_value, factor, factor_sd
|
|
43
42
|
|
|
44
43
|
|
|
45
44
|
def run_emission(term_id: str, cycle: dict):
|
|
46
|
-
should_run,
|
|
47
|
-
return _run(term_id,
|
|
45
|
+
should_run, value, factor, factor_sd = _should_run(term_id, cycle)
|
|
46
|
+
return _run(term_id, value, factor, factor_sd) if should_run else []
|
|
@@ -38,25 +38,19 @@ def _emission(value: float):
|
|
|
38
38
|
return emission
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
def _run(product_value: list, factor: float):
|
|
42
|
-
value = sum(product_value)
|
|
43
|
-
return [_emission(value * factor)]
|
|
44
|
-
|
|
45
|
-
|
|
46
41
|
def _should_run(cycle: dict):
|
|
47
42
|
crop_residue_burnt_value = get_crop_residue_burnt_value(cycle)
|
|
48
|
-
has_crop_residue_burnt = len(crop_residue_burnt_value) > 0
|
|
49
43
|
factor = get_lookup_value({'termType': 'emission', '@id': TERM_ID}, LOOKUPS['emission'][0])
|
|
50
44
|
|
|
51
45
|
logRequirements(cycle, model=MODEL, term=TERM_ID,
|
|
52
|
-
|
|
46
|
+
crop_residue_burnt_value=crop_residue_burnt_value,
|
|
53
47
|
burning_factor=factor)
|
|
54
48
|
|
|
55
|
-
should_run = all([
|
|
49
|
+
should_run = all([crop_residue_burnt_value is not None, factor is not None])
|
|
56
50
|
logShouldRun(cycle, MODEL, TERM_ID, should_run, methodTier=TIER)
|
|
57
51
|
return should_run, crop_residue_burnt_value, factor
|
|
58
52
|
|
|
59
53
|
|
|
60
54
|
def run(cycle: dict):
|
|
61
|
-
should_run,
|
|
62
|
-
return
|
|
55
|
+
should_run, value, factor = _should_run(cycle)
|
|
56
|
+
return [_emission(value * factor)] if should_run else []
|