hestia-earth-models 0.73.1__py3-none-any.whl → 0.73.3__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.
Files changed (49) hide show
  1. hestia_earth/models/akagiEtAl2011/utils.py +3 -1
  2. hestia_earth/models/config/Cycle.json +35 -37
  3. hestia_earth/models/config/Site.json +26 -24
  4. hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandOccupation.py +3 -2
  5. hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandTransformation.py +1 -1
  6. hestia_earth/models/frischknechtEtAl2000/ionisingRadiationKbqU235Eq.py +10 -6
  7. hestia_earth/models/geospatialDatabase/utils.py +20 -6
  8. hestia_earth/models/hestia/aboveGroundCropResidue.py +6 -5
  9. hestia_earth/models/hestia/cropResidueManagement.py +3 -2
  10. hestia_earth/models/hestia/default_emissions.py +1 -0
  11. hestia_earth/models/hestia/default_resourceUse.py +3 -2
  12. hestia_earth/models/hestia/excretaKgMass.py +1 -1
  13. hestia_earth/models/hestia/excretaKgN.py +1 -1
  14. hestia_earth/models/hestia/excretaKgVs.py +1 -1
  15. hestia_earth/models/hestia/landCover.py +1 -1
  16. hestia_earth/models/hestia/waterSalinity.py +13 -6
  17. hestia_earth/models/ipcc2019/aboveGroundBiomass.py +2 -4
  18. hestia_earth/models/ipcc2019/belowGroundBiomass.py +2 -4
  19. hestia_earth/models/ipcc2019/biomass_utils.py +1 -1
  20. hestia_earth/models/ipcc2019/ch4ToAirOrganicSoilCultivation.py +3 -4
  21. hestia_earth/models/ipcc2019/co2ToAirCarbonStockChange_utils.py +2 -4
  22. hestia_earth/models/ipcc2019/co2ToAirOrganicSoilCultivation.py +2 -3
  23. hestia_earth/models/ipcc2019/n2OToAirCropResidueBurningDirect.py +8 -7
  24. hestia_earth/models/ipcc2019/nonCo2EmissionsToAirNaturalVegetationBurning.py +2 -3
  25. hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_1.py +2 -3
  26. hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_2.py +3 -4
  27. hestia_earth/models/ipcc2019/organicCarbonPerHa_utils.py +2 -3
  28. hestia_earth/models/mocking/search-results.json +1568 -1568
  29. hestia_earth/models/schmidt2007/utils.py +2 -2
  30. hestia_earth/models/utils/__init__.py +1 -1
  31. hestia_earth/models/utils/cycle.py +2 -2
  32. hestia_earth/models/utils/impact_assessment.py +14 -14
  33. hestia_earth/models/utils/lookup.py +30 -10
  34. hestia_earth/models/version.py +1 -1
  35. {hestia_earth_models-0.73.1.dist-info → hestia_earth_models-0.73.3.dist-info}/METADATA +3 -2
  36. {hestia_earth_models-0.73.1.dist-info → hestia_earth_models-0.73.3.dist-info}/RECORD +44 -49
  37. tests/models/environmentalFootprintV3_1/test_soilQualityIndexLandOccupation.py +3 -3
  38. tests/models/frischknechtEtAl2000/test_ionisingRadiationKbqU235Eq.py +85 -31
  39. tests/models/geospatialDatabase/test_utils.py +12 -1
  40. tests/models/ipcc2019/test_organicCarbonPerHa_tier_2.py +1 -1
  41. tests/models/utils/test_array_builders.py +1 -1
  42. hestia_earth/models/utils/array_builders.py +0 -590
  43. hestia_earth/models/utils/descriptive_stats.py +0 -49
  44. hestia_earth/models/utils/stats.py +0 -429
  45. tests/models/utils/test_descriptive_stats.py +0 -50
  46. tests/models/utils/test_stats.py +0 -186
  47. {hestia_earth_models-0.73.1.dist-info → hestia_earth_models-0.73.3.dist-info}/LICENSE +0 -0
  48. {hestia_earth_models-0.73.1.dist-info → hestia_earth_models-0.73.3.dist-info}/WHEEL +0 -0
  49. {hestia_earth_models-0.73.1.dist-info → hestia_earth_models-0.73.3.dist-info}/top_level.txt +0 -0
@@ -38,24 +38,25 @@ def _emission(value: float):
38
38
  return emission
39
39
 
40
40
 
41
- def _run(product_value: list):
41
+ def _run(product_value: list, factor: float):
42
42
  value = sum(product_value)
43
- factor = get_lookup_value({'termType': 'emission', '@id': TERM_ID}, LOOKUPS['emission'][0])
44
43
  return [_emission(value * factor)]
45
44
 
46
45
 
47
46
  def _should_run(cycle: dict):
48
47
  crop_residue_burnt_value = get_crop_residue_burnt_value(cycle)
49
48
  has_crop_residue_burnt = len(crop_residue_burnt_value) > 0
49
+ factor = get_lookup_value({'termType': 'emission', '@id': TERM_ID}, LOOKUPS['emission'][0])
50
50
 
51
51
  logRequirements(cycle, model=MODEL, term=TERM_ID,
52
- has_crop_residue_burnt=has_crop_residue_burnt)
52
+ has_crop_residue_burnt=has_crop_residue_burnt,
53
+ burning_factor=factor)
53
54
 
54
- should_run = all([has_crop_residue_burnt])
55
+ should_run = all([has_crop_residue_burnt, factor is not None])
55
56
  logShouldRun(cycle, MODEL, TERM_ID, should_run, methodTier=TIER)
56
- return should_run, crop_residue_burnt_value
57
+ return should_run, crop_residue_burnt_value, factor
57
58
 
58
59
 
59
60
  def run(cycle: dict):
60
- should_run, crop_residue_burnt_value = _should_run(cycle)
61
- return _run(crop_residue_burnt_value) if should_run else []
61
+ should_run, crop_residue_burnt_value, factor = _should_run(cycle)
62
+ return _run(crop_residue_burnt_value, factor) if should_run else []
@@ -4,15 +4,14 @@ from itertools import product
4
4
  import numpy as np
5
5
  import numpy.typing as npt
6
6
  from typing import Any, Callable, Literal, Optional, TypedDict, Union
7
-
8
7
  from hestia_earth.schema import EmissionMethodTier, EmissionStatsDefinition, SiteSiteType
9
8
  from hestia_earth.utils.lookup import download_lookup, get_table_value, column_name
10
9
  from hestia_earth.utils.tools import safe_parse_float
10
+ from hestia_earth.utils.stats import gen_seed, repeat_single, truncated_normal_1d
11
+ from hestia_earth.utils.descriptive_stats import calc_descriptive_stats
11
12
 
12
13
  from hestia_earth.models.log import debugMissingLookup, log_as_table, logRequirements, logShouldRun
13
- from hestia_earth.models.utils.array_builders import gen_seed, repeat_single, truncated_normal_1d
14
14
  from hestia_earth.models.utils.blank_node import group_nodes_by_year
15
- from hestia_earth.models.utils.descriptive_stats import calc_descriptive_stats
16
15
  from hestia_earth.models.utils.ecoClimateZone import EcoClimateZone, get_eco_climate_zone_value
17
16
  from hestia_earth.models.utils.emission import _new_emission
18
17
  from hestia_earth.models.utils.lookup import get_region_lookup_value
@@ -4,20 +4,19 @@ from numpy import empty_like, random, vstack
4
4
  from numpy.typing import NDArray
5
5
  from pydash.objects import merge
6
6
  from typing import Callable, Literal, Optional, Union
7
-
8
7
  from hestia_earth.schema import MeasurementMethodClassification, SiteSiteType, TermTermType
9
8
  from hestia_earth.utils.blank_node import get_node_value
10
9
  from hestia_earth.utils.model import find_term_match, filter_list_term_type
11
10
  from hestia_earth.utils.tools import non_empty_list
11
+ from hestia_earth.utils.stats import gen_seed
12
+ from hestia_earth.utils.descriptive_stats import calc_descriptive_stats
12
13
 
13
14
  from hestia_earth.models.utils import split_on_condition
14
- from hestia_earth.models.utils.array_builders import gen_seed
15
15
  from hestia_earth.models.utils.blank_node import (
16
16
  cumulative_nodes_match, cumulative_nodes_lookup_match, cumulative_nodes_term_match, group_by_term,
17
17
  node_lookup_match, node_term_match, group_nodes_by_year, validate_start_date_end_date
18
18
  )
19
19
  from hestia_earth.models.utils.ecoClimateZone import EcoClimateZone, get_eco_climate_zone_value
20
- from hestia_earth.models.utils.descriptive_stats import calc_descriptive_stats
21
20
  from hestia_earth.models.utils.measurement import _new_measurement
22
21
  from hestia_earth.models.utils.property import get_node_property
23
22
  from hestia_earth.models.utils.term import get_residue_removed_or_burnt_terms, get_upland_rice_land_cover_terms
@@ -3,23 +3,22 @@ from numpy import array, empty, exp, minimum, random, where, vstack
3
3
  from numpy.typing import NDArray
4
4
  from pydash.objects import merge
5
5
  from typing import Any, Callable, Union
6
-
7
6
  from hestia_earth.schema import (
8
7
  CycleFunctionalUnit, MeasurementMethodClassification, SiteSiteType, TermTermType
9
8
  )
10
9
  from hestia_earth.utils.model import find_term_match, filter_list_term_type
11
10
  from hestia_earth.utils.tools import flatten, list_sum, non_empty_list
12
11
  from hestia_earth.utils.blank_node import get_node_value
13
-
14
- from hestia_earth.models.utils.array_builders import (
12
+ from hestia_earth.utils.stats import (
15
13
  avg_run_in_columnwise, gen_seed, grouped_avg, repeat_1d_array_as_columns
16
14
  )
15
+ from hestia_earth.utils.descriptive_stats import calc_descriptive_stats
16
+
17
17
  from hestia_earth.models.utils.blank_node import (
18
18
  cumulative_nodes_lookup_match, cumulative_nodes_term_match, group_nodes_by_year, group_nodes_by_year_and_month,
19
19
  GroupNodesByYearMode, node_lookup_match, node_term_match
20
20
  )
21
21
  from hestia_earth.models.utils.cycle import check_cycle_site_ids_identical
22
- from hestia_earth.models.utils.descriptive_stats import calc_descriptive_stats
23
22
  from hestia_earth.models.utils.measurement import _new_measurement
24
23
  from hestia_earth.models.utils.property import get_node_property
25
24
  from hestia_earth.models.utils.site import related_cycles
@@ -2,14 +2,13 @@ from enum import Enum
2
2
  from numpy import inf
3
3
  from numpy.typing import NDArray
4
4
  from typing import NamedTuple, Optional
5
-
6
5
  from hestia_earth.schema import MeasurementStatsDefinition, SiteSiteType
6
+ from hestia_earth.utils.stats import calc_z_critical
7
7
 
8
- from hestia_earth.models.utils.array_builders import (
8
+ from hestia_earth.utils.stats import (
9
9
  repeat_single, truncated_normal_1d
10
10
  )
11
11
  from hestia_earth.models.utils.blank_node import cumulative_nodes_term_match, node_term_match
12
- from hestia_earth.models.utils.stats import calc_z_critical
13
12
  from hestia_earth.models.utils.term import get_cover_crop_property_terms, get_irrigated_terms
14
13
 
15
14
  STATS_DEFINITION = MeasurementStatsDefinition.SIMULATED.value