hestia-earth-models 0.74.8__py3-none-any.whl → 0.74.9__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.
- hestia_earth/models/cache_sites.py +1 -1
- hestia_earth/models/faostat2018/liveweightPerHead.py +1 -1
- hestia_earth/models/faostat2018/product/price.py +1 -1
- hestia_earth/models/geospatialDatabase/ecoClimateZone.py +1 -1
- hestia_earth/models/geospatialDatabase/region.py +1 -1
- hestia_earth/models/geospatialDatabase/utils.py +1 -1
- hestia_earth/models/globalCropWaterModel2008/rootingDepth.py +2 -1
- hestia_earth/models/haversineFormula/transport/distance.py +1 -1
- hestia_earth/models/hestia/aboveGroundCropResidue.py +1 -3
- hestia_earth/models/hestia/cropResidueManagement.py +1 -0
- hestia_earth/models/hestia/excretaKgMass.py +1 -1
- hestia_earth/models/hestia/landCover.py +13 -6
- hestia_earth/models/hestia/landOccupationDuringCycle.py +1 -1
- hestia_earth/models/hestia/management.py +25 -11
- hestia_earth/models/hestia/pastureGrass.py +1 -1
- hestia_earth/models/impact_assessment/post_checks/__init__.py +3 -2
- hestia_earth/models/impact_assessment/post_checks/remove_no_value.py +13 -0
- hestia_earth/models/ipcc2019/biocharOrganicCarbonPerHa.py +2 -1
- hestia_earth/models/ipcc2019/ch4ToAirExcreta.py +4 -1
- hestia_earth/models/ipcc2019/organicCarbonPerHa.py +5 -1
- hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_1.py +88 -101
- hestia_earth/models/ipcc2019/organicCarbonPerHa_utils.py +21 -0
- hestia_earth/models/mocking/search-results.json +1 -1
- hestia_earth/models/site/pre_checks/country.py +1 -2
- hestia_earth/models/utils/__init__.py +7 -5
- hestia_earth/models/utils/blank_node.py +7 -2
- hestia_earth/models/utils/completeness.py +1 -2
- hestia_earth/models/utils/emission.py +1 -1
- hestia_earth/models/utils/indicator.py +1 -1
- hestia_earth/models/utils/input.py +1 -1
- hestia_earth/models/utils/management.py +1 -1
- hestia_earth/models/utils/measurement.py +2 -1
- hestia_earth/models/utils/method.py +1 -2
- hestia_earth/models/utils/practice.py +1 -1
- hestia_earth/models/utils/product.py +2 -1
- hestia_earth/models/utils/property.py +2 -1
- hestia_earth/models/utils/term.py +1 -27
- hestia_earth/models/version.py +1 -1
- {hestia_earth_models-0.74.8.dist-info → hestia_earth_models-0.74.9.dist-info}/METADATA +2 -2
- {hestia_earth_models-0.74.8.dist-info → hestia_earth_models-0.74.9.dist-info}/RECORD +48 -45
- tests/models/hestia/test_aboveGroundCropResidue.py +13 -35
- tests/models/hestia/test_landOccupationDuringCycle.py +9 -2
- tests/models/impact_assessment/post_checks/test_remove_cache_fields.py +6 -0
- tests/models/impact_assessment/post_checks/test_remove_no_value.py +17 -0
- tests/models/ipcc2019/test_organicCarbonPerHa_tier_1.py +1 -1
- {hestia_earth_models-0.74.8.dist-info → hestia_earth_models-0.74.9.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.74.8.dist-info → hestia_earth_models-0.74.9.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.74.8.dist-info → hestia_earth_models-0.74.9.dist-info}/top_level.txt +0 -0
|
@@ -8,6 +8,7 @@ from hestia_earth.utils.stats import calc_z_critical
|
|
|
8
8
|
from hestia_earth.utils.stats import (
|
|
9
9
|
repeat_single, truncated_normal_1d
|
|
10
10
|
)
|
|
11
|
+
from hestia_earth.models.log import log_as_table
|
|
11
12
|
from hestia_earth.models.utils.blank_node import cumulative_nodes_term_match, node_term_match
|
|
12
13
|
from hestia_earth.models.utils.term import get_cover_crop_property_terms, get_irrigated_terms
|
|
13
14
|
|
|
@@ -178,6 +179,16 @@ lignin_content : float
|
|
|
178
179
|
"""
|
|
179
180
|
|
|
180
181
|
|
|
182
|
+
SoilData = NamedTuple(
|
|
183
|
+
"SoilData",
|
|
184
|
+
[
|
|
185
|
+
("term_id", str),
|
|
186
|
+
("value", float),
|
|
187
|
+
("category", IpccSoilCategory)
|
|
188
|
+
]
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
|
|
181
192
|
def check_consecutive(ints: list[int]) -> bool:
|
|
182
193
|
"""
|
|
183
194
|
Checks whether a list of integers are consecutive.
|
|
@@ -286,3 +297,13 @@ def format_number_list(values: Optional[list[float]]) -> str:
|
|
|
286
297
|
" ".join(format_number(value) for value in values) or "None"if isinstance(values, list)
|
|
287
298
|
else "None"
|
|
288
299
|
)
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
def format_soil_inventory(inventory: list[SoilData]) -> str:
|
|
303
|
+
return log_as_table(
|
|
304
|
+
{
|
|
305
|
+
"term-id": data.term_id,
|
|
306
|
+
"value": format_number(data.value),
|
|
307
|
+
"category": format_enum(data.category)
|
|
308
|
+
} for data in inventory
|
|
309
|
+
) if inventory else "None"
|