hestia-earth-models 0.73.1__py3-none-any.whl → 0.73.2__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 (31) 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/geospatialDatabase/utils.py +7 -6
  5. hestia_earth/models/hestia/aboveGroundCropResidue.py +6 -5
  6. hestia_earth/models/hestia/cropResidueManagement.py +3 -2
  7. hestia_earth/models/ipcc2019/aboveGroundBiomass.py +2 -4
  8. hestia_earth/models/ipcc2019/belowGroundBiomass.py +2 -4
  9. hestia_earth/models/ipcc2019/biomass_utils.py +1 -1
  10. hestia_earth/models/ipcc2019/ch4ToAirOrganicSoilCultivation.py +3 -4
  11. hestia_earth/models/ipcc2019/co2ToAirCarbonStockChange_utils.py +2 -4
  12. hestia_earth/models/ipcc2019/co2ToAirOrganicSoilCultivation.py +2 -3
  13. hestia_earth/models/ipcc2019/nonCo2EmissionsToAirNaturalVegetationBurning.py +2 -3
  14. hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_1.py +2 -3
  15. hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_2.py +3 -4
  16. hestia_earth/models/ipcc2019/organicCarbonPerHa_utils.py +2 -3
  17. hestia_earth/models/mocking/search-results.json +660 -660
  18. hestia_earth/models/version.py +1 -1
  19. {hestia_earth_models-0.73.1.dist-info → hestia_earth_models-0.73.2.dist-info}/METADATA +3 -2
  20. {hestia_earth_models-0.73.1.dist-info → hestia_earth_models-0.73.2.dist-info}/RECORD +26 -31
  21. tests/models/geospatialDatabase/test_utils.py +12 -1
  22. tests/models/ipcc2019/test_organicCarbonPerHa_tier_2.py +1 -1
  23. tests/models/utils/test_array_builders.py +1 -1
  24. hestia_earth/models/utils/array_builders.py +0 -590
  25. hestia_earth/models/utils/descriptive_stats.py +0 -49
  26. hestia_earth/models/utils/stats.py +0 -429
  27. tests/models/utils/test_descriptive_stats.py +0 -50
  28. tests/models/utils/test_stats.py +0 -186
  29. {hestia_earth_models-0.73.1.dist-info → hestia_earth_models-0.73.2.dist-info}/LICENSE +0 -0
  30. {hestia_earth_models-0.73.1.dist-info → hestia_earth_models-0.73.2.dist-info}/WHEEL +0 -0
  31. {hestia_earth_models-0.73.1.dist-info → hestia_earth_models-0.73.2.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,7 @@
1
1
  from hestia_earth.schema import EmissionMethodTier, EmissionStatsDefinition, TermTermType
2
2
 
3
3
  from hestia_earth.models.log import logRequirements, logShouldRun
4
+ from hestia_earth.models.utils import multiply_values
4
5
  from hestia_earth.models.utils.emission import _new_emission
5
6
  from hestia_earth.models.utils.term import get_lookup_value
6
7
  from hestia_earth.models.utils.cropResidue import get_crop_residue_burnt_value
@@ -25,7 +26,8 @@ def _run(term_id: str, product_value: list):
25
26
  term = {'termType': TermTermType.EMISSION.value, '@id': term_id}
26
27
  factor = get_lookup_value(term, LOOKUP_NAME)
27
28
  factor_sd = get_lookup_value(term, LOOKUP_NAME + '-sd')
28
- return [_emission(term_id, value * factor, value * factor_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]))]
29
31
 
30
32
 
31
33
  def _should_run(term_id: str, cycle: dict):
@@ -27,17 +27,9 @@
27
27
  "stage": 1
28
28
  },
29
29
  {
30
- "key": "practices",
31
- "model": "hestia",
32
- "value": "croppingIntensity",
33
- "runStrategy": "add_blank_node_if_missing",
34
- "mergeStrategy": "list",
35
- "stage": 1
36
- },
37
- {
38
- "key": "practices",
39
- "model": "geospatialDatabase",
40
- "value": "croppingIntensity",
30
+ "key": "inputs",
31
+ "model": "faostat2018",
32
+ "value": "seed",
41
33
  "runStrategy": "add_blank_node_if_missing",
42
34
  "mergeStrategy": "list",
43
35
  "stage": 1
@@ -100,6 +92,22 @@
100
92
  "stage": 1
101
93
  }
102
94
  ],
95
+ {
96
+ "key": "practices",
97
+ "model": "hestia",
98
+ "value": "croppingIntensity",
99
+ "runStrategy": "add_blank_node_if_missing",
100
+ "mergeStrategy": "list",
101
+ "stage": 1
102
+ },
103
+ {
104
+ "key": "practices",
105
+ "model": "geospatialDatabase",
106
+ "value": "croppingIntensity",
107
+ "runStrategy": "add_blank_node_if_missing",
108
+ "mergeStrategy": "list",
109
+ "stage": 1
110
+ },
103
111
  [
104
112
  {
105
113
  "key": "practices",
@@ -321,14 +329,6 @@
321
329
  "stage": 1
322
330
  },
323
331
  [
324
- {
325
- "key": "practices",
326
- "model": "hestia",
327
- "value": "longFallowRatio",
328
- "runStrategy": "add_blank_node_if_missing",
329
- "mergeStrategy": "list",
330
- "stage": 1
331
- },
332
332
  {
333
333
  "key": "practices",
334
334
  "model": "hestia",
@@ -467,24 +467,22 @@
467
467
  "stage": 1
468
468
  }
469
469
  ],
470
- [
471
- {
472
- "key": "inputs",
473
- "model": "faostat2018",
474
- "value": "seed",
475
- "runStrategy": "add_blank_node_if_missing",
476
- "mergeStrategy": "list",
477
- "stage": 1
478
- },
479
- {
480
- "key": "inputs",
481
- "model": "pooreNemecek2018",
482
- "value": "saplingsDepreciatedAmountPerCycle",
483
- "runStrategy": "add_blank_node_if_missing",
484
- "mergeStrategy": "list",
485
- "stage": 1
486
- }
487
- ],
470
+ {
471
+ "key": "practices",
472
+ "model": "hestia",
473
+ "value": "longFallowRatio",
474
+ "runStrategy": "add_blank_node_if_missing",
475
+ "mergeStrategy": "list",
476
+ "stage": 1
477
+ },
478
+ {
479
+ "key": "inputs",
480
+ "model": "pooreNemecek2018",
481
+ "value": "saplingsDepreciatedAmountPerCycle",
482
+ "runStrategy": "add_blank_node_if_missing",
483
+ "mergeStrategy": "list",
484
+ "stage": 1
485
+ },
488
486
  {
489
487
  "key": "completeness",
490
488
  "model": "cycle",
@@ -65,30 +65,6 @@
65
65
  "mergeStrategy": "list",
66
66
  "stage": 1
67
67
  },
68
- {
69
- "key": "measurements",
70
- "model": "hestia",
71
- "value": "brackishWater",
72
- "runStrategy": "add_blank_node_if_missing",
73
- "mergeStrategy": "list",
74
- "stage": 1
75
- },
76
- {
77
- "key": "measurements",
78
- "model": "hestia",
79
- "value": "freshWater",
80
- "runStrategy": "add_blank_node_if_missing",
81
- "mergeStrategy": "list",
82
- "stage": 1
83
- },
84
- {
85
- "key": "measurements",
86
- "model": "hestia",
87
- "value": "salineWater",
88
- "runStrategy": "add_blank_node_if_missing",
89
- "mergeStrategy": "list",
90
- "stage": 1
91
- },
92
68
  {
93
69
  "key": "measurements",
94
70
  "model": "hestia",
@@ -470,6 +446,32 @@
470
446
  "stage": 2
471
447
  }
472
448
  ],
449
+ [
450
+ {
451
+ "key": "measurements",
452
+ "model": "hestia",
453
+ "value": "brackishWater",
454
+ "runStrategy": "add_blank_node_if_missing",
455
+ "mergeStrategy": "list",
456
+ "stage": 1
457
+ },
458
+ {
459
+ "key": "measurements",
460
+ "model": "hestia",
461
+ "value": "freshWater",
462
+ "runStrategy": "add_blank_node_if_missing",
463
+ "mergeStrategy": "list",
464
+ "stage": 1
465
+ },
466
+ {
467
+ "key": "measurements",
468
+ "model": "hestia",
469
+ "value": "salineWater",
470
+ "runStrategy": "add_blank_node_if_missing",
471
+ "mergeStrategy": "list",
472
+ "stage": 1
473
+ }
474
+ ],
473
475
  [
474
476
  {
475
477
  "key": "defaultMethodClassification",
@@ -1,4 +1,6 @@
1
1
  import os
2
+ from area import area
3
+ from functools import reduce
2
4
  from hestia_earth.schema import TermTermType
3
5
  from hestia_earth.utils.tools import non_empty_list
4
6
 
@@ -85,12 +87,11 @@ def geospatial_data(site: dict, only_coordinates=False):
85
87
 
86
88
  def _get_boundary_area_size(boundary: dict):
87
89
  try:
88
- from hestia_earth.earth_engine.boundary import get_size_km2
89
- except ImportError:
90
- raise ImportError("Run `pip install hestia_earth.earth_engine` to use this functionality")
91
-
92
- try:
93
- return get_size_km2(boundary)
90
+ return (
91
+ (area(boundary.get('geometry')) / 1_000_000) if 'geometry' in boundary else
92
+ reduce(lambda p, c: p + _get_boundary_area_size(c), boundary.get('features'), 0) if 'features' in boundary
93
+ else area(boundary) / 1_000_000
94
+ )
94
95
  except Exception:
95
96
  return None
96
97
 
@@ -28,6 +28,7 @@ RETURNS = {
28
28
  "value": ""
29
29
  }]
30
30
  }
31
+ MODEL_KEY = 'aboveGroundCropResidue'
31
32
  TERM_ID = 'aboveGroundCropResidueLeftOnField,aboveGroundCropResidueBurnt,aboveGroundCropResidueIncorporated,aboveGroundCropResidueRemoved' # noqa: E501
32
33
  TOTAL_TERM_ID = 'aboveGroundCropResidueTotal'
33
34
  REMAINING_MODEL = PRODUCT_ID_TO_PRACTICES_ID[-1]['product']
@@ -59,7 +60,7 @@ def _should_run_model(model, cycle: dict, total_value: float):
59
60
  practice_value = _get_practice_value(model.get('practices'), cycle)
60
61
  has_product = find_term_match(cycle.get('products', []), term_id, None) is not None
61
62
 
62
- logRequirements(cycle, model=MODEL, term=term_id,
63
+ logRequirements(cycle, model=MODEL, term=term_id, model_key=MODEL_KEY,
63
64
  practice_value=practice_value,
64
65
  has_product=has_product)
65
66
 
@@ -70,7 +71,7 @@ def _should_run_model(model, cycle: dict, total_value: float):
70
71
  ]),
71
72
  not has_product
72
73
  ])
73
- logShouldRun(cycle, MODEL, term_id, should_run)
74
+ logShouldRun(cycle, MODEL, term_id, should_run, model_key=MODEL_KEY)
74
75
  return should_run, practice_value
75
76
 
76
77
 
@@ -104,7 +105,7 @@ def _run(cycle: dict, total_values: list):
104
105
  for model in models:
105
106
  term_id = model.get('product')
106
107
  value = _run_model(model, cycle, total_value)
107
- debugValues(cycle, model=MODEL, term=term_id,
108
+ debugValues(cycle, model=MODEL, term=term_id, model_key=MODEL_KEY,
108
109
  total_above_ground_crop_residue=total_value,
109
110
  remaining_crop_residue_value=remaining_value,
110
111
  allocated_value=value)
@@ -132,13 +133,13 @@ def _should_run_product(cycle: dict, total_values: list, term_id: str):
132
133
  find_term_match(cycle.get('practices', []), term_id).get('value', []) == [0] for term_id in practice_term_ids
133
134
  ])
134
135
 
135
- logRequirements(cycle, model=MODEL, term=term_id,
136
+ logRequirements(cycle, model=MODEL, term=term_id, model_key=MODEL_KEY,
136
137
  term_type_cropResidue_incomplete=term_type_incomplete,
137
138
  has_aboveGroundCropResidueTotal=has_aboveGroundCropResidueTotal,
138
139
  practice_term_ids=';'.join(practice_term_ids),
139
140
  practice_value_is_0=is_value_0)
140
141
  should_run = all([has_aboveGroundCropResidueTotal or is_value_0, term_type_incomplete])
141
- logShouldRun(cycle, MODEL, term_id, should_run)
142
+ logShouldRun(cycle, MODEL, term_id, should_run, model_key=MODEL_KEY)
142
143
  return should_run
143
144
 
144
145
 
@@ -20,6 +20,7 @@ RETURNS = {
20
20
  "term.termType": "cropResidueManagement"
21
21
  }]
22
22
  }
23
+ MODEL_KEY = 'cropResidueManagement'
23
24
  PRACTICE_IDS = [
24
25
  residueBurnt.TERM_ID,
25
26
  residueIncorporated.TERM_ID,
@@ -50,10 +51,10 @@ def _should_run(cycle: dict):
50
51
  should_run = all([99.5 <= sum_practices <= 100.5])
51
52
 
52
53
  for term_id in missing_practices:
53
- logRequirements(cycle, model=MODEL, term=term_id,
54
+ logRequirements(cycle, model=MODEL, term=term_id, model_key=MODEL_KEY,
54
55
  sum_crop_residue_management=sum_practices)
55
56
 
56
- logShouldRun(cycle, MODEL, term_id, should_run)
57
+ logShouldRun(cycle, MODEL, term_id, should_run, model_key=MODEL_KEY)
57
58
 
58
59
  return should_run, missing_practices
59
60
 
@@ -3,20 +3,18 @@ from functools import reduce
3
3
  from numpy import average, copy, random, vstack
4
4
  from numpy.typing import NDArray
5
5
  from typing import Optional, Union
6
-
7
6
  from hestia_earth.schema import (
8
7
  MeasurementMethodClassification,
9
8
  MeasurementStatsDefinition,
10
9
  SiteSiteType
11
10
  )
12
-
13
11
  from hestia_earth.utils.tools import non_empty_list
12
+ from hestia_earth.utils.stats import gen_seed
13
+ from hestia_earth.utils.descriptive_stats import calc_descriptive_stats
14
14
 
15
15
  from hestia_earth.models.log import log_as_table, logRequirements, logShouldRun
16
16
  from hestia_earth.models.utils import pairwise
17
- from hestia_earth.models.utils.array_builders import gen_seed
18
17
  from hestia_earth.models.utils.blank_node import group_nodes_by_year
19
- from hestia_earth.models.utils.descriptive_stats import calc_descriptive_stats
20
18
  from hestia_earth.models.utils.ecoClimateZone import EcoClimateZone, get_eco_climate_zone_value
21
19
  from hestia_earth.models.utils.source import get_source
22
20
  from hestia_earth.models.utils.measurement import _new_measurement
@@ -3,20 +3,18 @@ from functools import reduce
3
3
  from numpy import average, copy, random, vstack
4
4
  from numpy.typing import NDArray
5
5
  from typing import Optional, Union
6
-
7
6
  from hestia_earth.schema import (
8
7
  MeasurementMethodClassification,
9
8
  MeasurementStatsDefinition,
10
9
  SiteSiteType
11
10
  )
12
-
13
11
  from hestia_earth.utils.tools import non_empty_list
12
+ from hestia_earth.utils.stats import gen_seed
13
+ from hestia_earth.utils.descriptive_stats import calc_descriptive_stats
14
14
 
15
15
  from hestia_earth.models.log import log_as_table, logRequirements, logShouldRun
16
16
  from hestia_earth.models.utils import pairwise
17
- from hestia_earth.models.utils.array_builders import gen_seed
18
17
  from hestia_earth.models.utils.blank_node import group_nodes_by_year
19
- from hestia_earth.models.utils.descriptive_stats import calc_descriptive_stats
20
18
  from hestia_earth.models.utils.ecoClimateZone import EcoClimateZone, get_eco_climate_zone_value
21
19
  from hestia_earth.models.utils.source import get_source
22
20
  from hestia_earth.models.utils.measurement import _new_measurement
@@ -9,7 +9,7 @@ from hestia_earth.schema import TermTermType
9
9
  from hestia_earth.utils.blank_node import get_node_value
10
10
  from hestia_earth.utils.model import filter_list_term_type
11
11
 
12
- from hestia_earth.models.utils.array_builders import repeat_single, truncated_normal_1d
12
+ from hestia_earth.utils.stats import repeat_single, truncated_normal_1d
13
13
  from hestia_earth.models.utils.blank_node import node_term_match, validate_start_date_end_date
14
14
  from hestia_earth.models.utils.ecoClimateZone import EcoClimateZone, get_ecoClimateZone_lookup_grouped_value
15
15
  from hestia_earth.models.utils.term import get_cover_crop_property_terms, get_lookup_value
@@ -1,15 +1,14 @@
1
1
  import numpy as np
2
2
  import numpy.typing as npt
3
3
  from typing import Callable, Union
4
-
5
4
  from hestia_earth.schema import EmissionMethodTier, EmissionStatsDefinition
6
-
7
5
  from hestia_earth.models.log import logRequirements, logShouldRun
8
- from hestia_earth.models.utils.array_builders import (
6
+ from hestia_earth.utils.stats import (
9
7
  discrete_uniform_1d, gen_seed, normal_1d, repeat_single, triangular_1d
10
8
  )
9
+ from hestia_earth.utils.descriptive_stats import calc_descriptive_stats
10
+
11
11
  from hestia_earth.models.utils.cycle import land_occupation_per_ha
12
- from hestia_earth.models.utils.descriptive_stats import calc_descriptive_stats
13
12
  from hestia_earth.models.utils.ecoClimateZone import EcoClimateZone, get_eco_climate_zone_value
14
13
  from hestia_earth.models.utils.emission import _new_emission
15
14
  from hestia_earth.models.utils.measurement import most_relevant_measurement_value
@@ -2,7 +2,6 @@
2
2
  Utilities for calculating CO2 emissions based on changes in carbon stocks (e.g., `organicCarbonPerHa`,
3
3
  `aboveGroundBiomass` and `belowGroundBiomass`).
4
4
  """
5
-
6
5
  from datetime import datetime, timedelta
7
6
  from enum import Enum
8
7
  from functools import reduce
@@ -11,22 +10,21 @@ from numpy import array, random, mean
11
10
  from numpy.typing import NDArray
12
11
  from pydash.objects import merge
13
12
  from typing import Any, Callable, NamedTuple, Optional, Union
14
-
15
13
  from hestia_earth.schema import (
16
14
  EmissionMethodTier, EmissionStatsDefinition, MeasurementMethodClassification
17
15
  )
18
16
  from hestia_earth.utils.date import diff_in_days, YEAR
19
17
  from hestia_earth.utils.tools import flatten, non_empty_list, safe_parse_date
18
+ from hestia_earth.utils.stats import correlated_normal_2d, gen_seed
19
+ from hestia_earth.utils.descriptive_stats import calc_descriptive_stats
20
20
 
21
21
  from hestia_earth.models.log import log_as_table
22
22
  from hestia_earth.models.utils import pairwise
23
- from hestia_earth.models.utils.array_builders import correlated_normal_2d, gen_seed
24
23
  from hestia_earth.models.utils.blank_node import (
25
24
  _gapfill_datestr, _get_datestr_format, DatestrGapfillMode, DatestrFormat, group_nodes_by_year, node_term_match,
26
25
  split_node_by_dates
27
26
  )
28
27
  from hestia_earth.models.utils.constant import Units, get_atomic_conversion
29
- from hestia_earth.models.utils.descriptive_stats import calc_descriptive_stats
30
28
  from hestia_earth.models.utils.emission import min_emission_method_tier
31
29
  from hestia_earth.models.utils.measurement import (
32
30
  group_measurements_by_method_classification, min_measurement_method_classification,
@@ -1,13 +1,12 @@
1
1
  import numpy as np
2
2
  import numpy.typing as npt
3
3
  from typing import Callable, Union
4
-
5
4
  from hestia_earth.schema import EmissionMethodTier, EmissionStatsDefinition
5
+ from hestia_earth.utils.stats import gen_seed, repeat_single, truncated_normal_1d
6
+ from hestia_earth.utils.descriptive_stats import calc_descriptive_stats
6
7
 
7
8
  from hestia_earth.models.log import logRequirements, logShouldRun
8
- from hestia_earth.models.utils.array_builders import gen_seed, repeat_single, truncated_normal_1d
9
9
  from hestia_earth.models.utils.cycle import land_occupation_per_ha
10
- from hestia_earth.models.utils.descriptive_stats import calc_descriptive_stats
11
10
  from hestia_earth.models.utils.ecoClimateZone import EcoClimateZone, get_eco_climate_zone_value
12
11
  from hestia_earth.models.utils.emission import _new_emission
13
12
  from hestia_earth.models.utils.measurement import most_relevant_measurement_value
@@ -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