hestia-earth-models 0.59.2__py3-none-any.whl → 0.59.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.

Files changed (34) hide show
  1. hestia_earth/models/geospatialDatabase/potentialEvapotranspirationMonthly.py +98 -0
  2. hestia_earth/models/geospatialDatabase/precipitationMonthly.py +98 -0
  3. hestia_earth/models/geospatialDatabase/temperatureAnnual.py +1 -2
  4. hestia_earth/models/geospatialDatabase/temperatureMonthly.py +98 -0
  5. hestia_earth/models/geospatialDatabase/utils.py +8 -1
  6. hestia_earth/models/ipcc2006/n2OToAirCropResidueDecompositionDirect.py +83 -0
  7. hestia_earth/models/ipcc2006/utils.py +12 -0
  8. hestia_earth/models/ipcc2019/nh3ToAirInorganicFertiliser.py +112 -0
  9. hestia_earth/models/ipcc2019/nh3ToAirOrganicFertiliser.py +6 -3
  10. hestia_earth/models/ipcc2019/noxToAirInorganicFertiliser.py +112 -0
  11. hestia_earth/models/ipcc2019/noxToAirOrganicFertiliser.py +6 -3
  12. hestia_earth/models/ipcc2019/organicCarbonPerHa.py +13 -28
  13. hestia_earth/models/mocking/search-results.json +8 -8
  14. hestia_earth/models/site/management.py +6 -6
  15. hestia_earth/models/site/pre_checks/cache_geospatialDatabase.py +27 -7
  16. hestia_earth/models/site/utils.py +2 -6
  17. hestia_earth/models/utils/__init__.py +9 -0
  18. hestia_earth/models/utils/site.py +8 -5
  19. hestia_earth/models/version.py +1 -1
  20. {hestia_earth_models-0.59.2.dist-info → hestia_earth_models-0.59.4.dist-info}/METADATA +2 -2
  21. {hestia_earth_models-0.59.2.dist-info → hestia_earth_models-0.59.4.dist-info}/RECORD +34 -22
  22. tests/models/geospatialDatabase/test_potentialEvapotranspirationMonthly.py +20 -0
  23. tests/models/geospatialDatabase/test_precipitationMonthly.py +20 -0
  24. tests/models/geospatialDatabase/test_temperatureMonthly.py +20 -0
  25. tests/models/ipcc2006/test_n2OToAirCropResidueDecompositionDirect.py +50 -0
  26. tests/models/ipcc2019/test_nh3ToAirInorganicFertiliser.py +47 -0
  27. tests/models/ipcc2019/test_noxToAirInorganicFertiliser.py +47 -0
  28. tests/models/ipcc2019/test_organicCarbonPerHa.py +10 -22
  29. tests/models/site/test_management.py +13 -13
  30. tests/models/utils/test_blank_node.py +5 -5
  31. tests/models/utils/test_site.py +1 -1
  32. {hestia_earth_models-0.59.2.dist-info → hestia_earth_models-0.59.4.dist-info}/LICENSE +0 -0
  33. {hestia_earth_models-0.59.2.dist-info → hestia_earth_models-0.59.4.dist-info}/WHEEL +0 -0
  34. {hestia_earth_models-0.59.2.dist-info → hestia_earth_models-0.59.4.dist-info}/top_level.txt +0 -0
@@ -3,7 +3,7 @@ hestia_earth/models/__init__.py,sha256=qEFeq3yuf3lQKVseALmL8aPM8fpCS54B_5pry00M3
3
3
  hestia_earth/models/cache_sites.py,sha256=kp_3D09P-JdAn9vt7eU-KKTwd6BAXWKQL_0UQCDsH2s,4798
4
4
  hestia_earth/models/log.py,sha256=b63I3qyTtQs17xxbq8RI0Fv2lvZ1oDZ9k0njhxqiFFk,3459
5
5
  hestia_earth/models/requirements.py,sha256=znNZJAhwX2iYiKcAQXPftY7z_1MsNa0QxCXkXyHm_U0,17363
6
- hestia_earth/models/version.py,sha256=58Yl5t5ON-GW8LlDihjO_US-BZGFRvSNjAnjUrGJ5wQ,19
6
+ hestia_earth/models/version.py,sha256=dVCy68c5An9e5A-5RC7W7zhxXlwTjzAHL1hfZj8TunQ,19
7
7
  hestia_earth/models/agribalyse2016/__init__.py,sha256=WvK0qCQbnYtg9oZxrACd1wGormZyXibPtpCnIQeDqbw,415
8
8
  hestia_earth/models/agribalyse2016/fuelElectricity.py,sha256=mrh8seYSYdTgcMDCETLiknuPeJehg071YoG4UiyW0yU,4404
9
9
  hestia_earth/models/agribalyse2016/machineryInfrastructureDepreciatedAmountPerCycle.py,sha256=_Rbngu0DzHKa62JwBl58ZC_ui1zLF2que_nB7ukhOQc,3392
@@ -143,19 +143,22 @@ hestia_earth/models/geospatialDatabase/nutrientLossToAquaticEnvironment.py,sha25
143
143
  hestia_earth/models/geospatialDatabase/organicCarbonPerKgSoil.py,sha256=gt3-crrUN0HPtIKY7Hf9dUteCXkegSICVjO-jufDqas,2196
144
144
  hestia_earth/models/geospatialDatabase/potentialEvapotranspirationAnnual.py,sha256=UlCBvAD-6H-4sdryfPuX1YDlOsGPOI8T9y0q4O0Tau8,2544
145
145
  hestia_earth/models/geospatialDatabase/potentialEvapotranspirationLongTermAnnualMean.py,sha256=uGMCkSZk8gJ6gFHhaiV1PtQxuP0Gzt4m3is0vkQSiXU,2122
146
+ hestia_earth/models/geospatialDatabase/potentialEvapotranspirationMonthly.py,sha256=vNO0cJLE8LGrFeEF2PPRCJWFbdOxHIDG7KH8BTe4cg4,3284
146
147
  hestia_earth/models/geospatialDatabase/precipitationAnnual.py,sha256=8_lMKVUPClnp7tetHrsoUY2ZGG2J7c-cXqJD8rznp0Q,2803
147
148
  hestia_earth/models/geospatialDatabase/precipitationLongTermAnnualMean.py,sha256=fS5knfil5f2QP8-gxFdXuoGTxXpzoJQZ9h4UjWIWjCA,2376
149
+ hestia_earth/models/geospatialDatabase/precipitationMonthly.py,sha256=SbsldfQS4bePegyvJERc13zH8Xy3VVdLFuAKCx6JbME,3279
148
150
  hestia_earth/models/geospatialDatabase/region.py,sha256=rdywdsI4OglcO05tih0UQx0qbnm8BAn7mP-x74iV03c,1462
149
151
  hestia_earth/models/geospatialDatabase/sandContent.py,sha256=BZUn2z4BN1HgCGZ2Xsifca2CRTaZ4gdcaZ8A1_UoPQM,2704
150
152
  hestia_earth/models/geospatialDatabase/siltContent.py,sha256=0GnBZHjqS_Py4730s4LqzQ_GikBSxFyUGYG4dEiXiGs,2162
151
153
  hestia_earth/models/geospatialDatabase/slope.py,sha256=g1SpuYks60injv2w-CMjESNfu8KM1JsiYnRT9XZfSuY,1859
152
154
  hestia_earth/models/geospatialDatabase/slopeLength.py,sha256=6pGr1qR0EiiUKkeflpYut7eI6UsnXAzHDoHhAzXKFJk,1864
153
155
  hestia_earth/models/geospatialDatabase/soilPh.py,sha256=egvtnVPCL0El2J9oVLAFxl6HoZQsK-RrNobA0LMAtOY,2109
154
- hestia_earth/models/geospatialDatabase/temperatureAnnual.py,sha256=PJGFvudYZgYiwVoY2h8jkO8tJb-hoBgVTzupemPH1WQ,2814
156
+ hestia_earth/models/geospatialDatabase/temperatureAnnual.py,sha256=0UwONdo7ClGQ6mxg44ghT_KGpDXXoJwesDHTv-yZAyk,2806
155
157
  hestia_earth/models/geospatialDatabase/temperatureLongTermAnnualMean.py,sha256=G276JqkPwZsMH7fexrjPCwVfWGYzS7mHLag2UsiqjIs,2261
158
+ hestia_earth/models/geospatialDatabase/temperatureMonthly.py,sha256=LtYPegS3m8K8ZQ3HVBcca5Pr-ffIaAF62hwPGVe-vCo,3282
156
159
  hestia_earth/models/geospatialDatabase/totalNitrogenPerKgSoil.py,sha256=kjP3ue-tlzMQNx2hBM56_CBBRa8Pcosmd2BPgyiNVW4,2081
157
160
  hestia_earth/models/geospatialDatabase/totalPhosphorusPerKgSoil.py,sha256=5oasLMYgfnPwSse0D8EEe_pV57AMusac853BgVSUh5E,2070
158
- hestia_earth/models/geospatialDatabase/utils.py,sha256=zCwT9PfC38gTbmhMI-Pz-AM0JAEOYG2j_4s_pxonBlc,5876
161
+ hestia_earth/models/geospatialDatabase/utils.py,sha256=VmzT7r-o_7wnABlnu49q-H6CAVJD5D9Zmz-Po2jkNe4,6081
159
162
  hestia_earth/models/geospatialDatabase/waterDepth.py,sha256=Xy2UxwAJrgdOkcw59NetEHMt5vgRYE6qg4fgXb1ptlU,1643
160
163
  hestia_earth/models/globalCropWaterModel2008/__init__.py,sha256=vQxexzFCl2Uv2RiIJfcppkRi9RgzBsJ68yhVDK4GvAU,425
161
164
  hestia_earth/models/globalCropWaterModel2008/rootingDepth.py,sha256=pajS-6UWxqIqnzW0IjkgNm-2Vl3bMor2UZOQtQQERuc,4096
@@ -202,6 +205,7 @@ hestia_earth/models/ipcc2006/aboveGroundCropResidueRemoved.py,sha256=6FDgMH5eiO1
202
205
  hestia_earth/models/ipcc2006/aboveGroundCropResidueTotal.py,sha256=vD_kpvOJmjTOjDEnlqSYBSZxjuPGvzpmCr0JIC84GKE,3431
203
206
  hestia_earth/models/ipcc2006/belowGroundCropResidue.py,sha256=KzeRphJb1IWB_EPVcxa9tbCoNmEe80D9lKxgQOqfKoU,4138
204
207
  hestia_earth/models/ipcc2006/co2ToAirOrganicSoilCultivation.py,sha256=8AzFuqRprk6o-uyyI3XYsTGl2dP_ALgYJXWCseYEBQ8,3029
208
+ hestia_earth/models/ipcc2006/n2OToAirCropResidueDecompositionDirect.py,sha256=_2oTngpspikbFwgFTtOWs-SgEVF8LzznvITGITTtol4,2913
205
209
  hestia_earth/models/ipcc2006/n2OToAirCropResidueDecompositionIndirect.py,sha256=kf4WjdMzs6d8h433LFuUH9LJKJ_aMHTqEHDToGY5-Xk,2315
206
210
  hestia_earth/models/ipcc2006/n2OToAirExcretaDirect.py,sha256=VvQTIh58JyhrdPk5FdJQBkjBDr5-Cv7CnGkNEcco3P4,1986
207
211
  hestia_earth/models/ipcc2006/n2OToAirExcretaIndirect.py,sha256=me1MLX2WI5A_VZ11774CRxwRC6seOaxgMg_GGYCckIk,2243
@@ -210,7 +214,7 @@ hestia_earth/models/ipcc2006/n2OToAirInorganicFertiliserIndirect.py,sha256=MNFyX
210
214
  hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserDirect.py,sha256=MZUmA3ajGkpi4wr020OU6m4WJdujjKkRhUVsbPgUVb8,2094
211
215
  hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserIndirect.py,sha256=pgNG18EwgTA7kmVw9QFtucMn8ScVeEKJAsSPxcExbI8,2801
212
216
  hestia_earth/models/ipcc2006/n2OToAirOrganicSoilCultivationDirect.py,sha256=0J6ntZxYyLg3pUQeSQelDe36fb0nQtbMLjIBtwzHUyc,3038
213
- hestia_earth/models/ipcc2006/utils.py,sha256=7-0rfkjgm8tH0dx5nfi-9sFP07L9Dli_2UCZf6eL2qU,541
217
+ hestia_earth/models/ipcc2006/utils.py,sha256=flB7HWrynzOorKlmrpbETGD63NMv45H8Wxjj3RCav98,739
214
218
  hestia_earth/models/ipcc2013ExcludingFeedbacks/__init__.py,sha256=v4Qe-X4w3tqIHGJBNnEAK81x4ZuQMwYxQYXRncugmcU,427
215
219
  hestia_earth/models/ipcc2013ExcludingFeedbacks/gwp100.py,sha256=8VRg-Vvzc86_CQmBH-iHNhaSnAFHew2swAMecT0aXW4,979
216
220
  hestia_earth/models/ipcc2013IncludingFeedbacks/__init__.py,sha256=VJ16KIGQQHybzZiTvu3mpZy_3j0xcd06RHHCfPrCMgU,427
@@ -235,14 +239,16 @@ hestia_earth/models/ipcc2019/n2OToAirInorganicFertiliserDirect.py,sha256=NfS6EiE
235
239
  hestia_earth/models/ipcc2019/n2OToAirInorganicFertiliserIndirect.py,sha256=iNjwTyktLqD0HpwfwAEnAHbQUDNQmT7ekONF_lJobzE,3715
236
240
  hestia_earth/models/ipcc2019/n2OToAirOrganicFertiliserDirect.py,sha256=pMyl6UtUVgPWfczgA_cdm1RUdMGi4Ln16qWrw1eesv4,4138
237
241
  hestia_earth/models/ipcc2019/n2OToAirOrganicFertiliserIndirect.py,sha256=9YbaR8h7P-4rLHgcwtDLnQ_hT7cKzyELjCVJ9lWV2jI,3701
238
- hestia_earth/models/ipcc2019/nh3ToAirOrganicFertiliser.py,sha256=fsuc4pojyOfNrfnwLpVlfUWScm6SznJ5s_rbxhB6zJg,3717
242
+ hestia_earth/models/ipcc2019/nh3ToAirInorganicFertiliser.py,sha256=IASHAUO_tV043qLxll9M7Bp9WM5N290lkmkh1yQr-1U,4226
243
+ hestia_earth/models/ipcc2019/nh3ToAirOrganicFertiliser.py,sha256=mPAoC6mRc4F7bXRt02JQWqhJvds-bEIEnk2XbdJzmEU,3911
239
244
  hestia_earth/models/ipcc2019/nitrogenContent.py,sha256=6fGG7diDp9zAidVH75gXz9c8uxURx0Q2COo8KrkT3I4,7191
240
245
  hestia_earth/models/ipcc2019/no3ToGroundwaterCropResidueDecomposition.py,sha256=8NOjbqJuQ-wnLz3bYmwaygSzKBdaF3N7hoELGNnO4YQ,3115
241
246
  hestia_earth/models/ipcc2019/no3ToGroundwaterExcreta.py,sha256=mJUXLGtg9EOZq9LH0KFOKvzER1ypCUucs0ZMaNYMShc,2991
242
247
  hestia_earth/models/ipcc2019/no3ToGroundwaterInorganicFertiliser.py,sha256=wTvMBthqmiKMn4nLbL4VD6_8_gGI2WGR3OYz3KK8sXs,3105
243
248
  hestia_earth/models/ipcc2019/no3ToGroundwaterOrganicFertiliser.py,sha256=zOhp6NhYUuUNU_LMMwhZBP78YC2XRWRlGnajBUX2AN8,3095
244
- hestia_earth/models/ipcc2019/noxToAirOrganicFertiliser.py,sha256=VK3F0GUBG5CYJj0tLercVryj1ezj58PxaFi_zqijHvE,3717
245
- hestia_earth/models/ipcc2019/organicCarbonPerHa.py,sha256=ADn2kv6uzfJb71ti8ydI3aGiGQMj0HsIZDjgxdU2Aic,142289
249
+ hestia_earth/models/ipcc2019/noxToAirInorganicFertiliser.py,sha256=D-UyzY55mOiIcXRzEtvPY-r1bDFgb9YqA08SmHsQeNA,4226
250
+ hestia_earth/models/ipcc2019/noxToAirOrganicFertiliser.py,sha256=SVgVNp76bIv9oUjrZZuI6xYLo4Gw2DRU5tbp14gydOE,3911
251
+ hestia_earth/models/ipcc2019/organicCarbonPerHa.py,sha256=QmSoBEmkrukZz4rwXDRoW_vDrfF5yopBrrFcf10BGio,141999
246
252
  hestia_earth/models/ipcc2019/pastureGrass.py,sha256=CpDEtdnbKd_8eaDLcflJ-dGik3t879HIoEIzuaHNmC0,23168
247
253
  hestia_earth/models/ipcc2019/utils.py,sha256=MSDMu15D9DnilFUgi4_6jYXC0FaKso3OODauGTMB6hs,6229
248
254
  hestia_earth/models/ipcc2021/__init__.py,sha256=VTgGFKhwMmk_nuI1RRq0in27fHYVPBonlXlPK00K8no,409
@@ -345,7 +351,7 @@ hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystems
345
351
  hestia_earth/models/linkedImpactAssessment/__init__.py,sha256=GZb-7uylALKNabUQaPjwekZHqBBeVCuL3wG2OzHeEo8,4565
346
352
  hestia_earth/models/mocking/__init__.py,sha256=kmSeOTSvurMUxw7Ajhf3G-SVPQ1NgmirMTk4TSOEicY,765
347
353
  hestia_earth/models/mocking/mock_search.py,sha256=V-ycVBTkJu7PP37Ivy_16hpKBV4aEtJb5S9DfChPNSU,2038
348
- hestia_earth/models/mocking/search-results.json,sha256=lqiVVybBoRY40119-ykY8FND8RfzK0WLCcBKlQzHE-8,39777
354
+ hestia_earth/models/mocking/search-results.json,sha256=TUYddNUVoFlEpTTglJq5Xkg4nt0pZTSSadUzh6Ehrsw,39779
349
355
  hestia_earth/models/pooreNemecek2018/__init__.py,sha256=nPboL7ULJzL5nJD5q7q9VOZt_fxbKVm8fmn1Az5YkVY,417
350
356
  hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py,sha256=Qt-mel4dkhK6N5uUOutNOinCTFjbjtGzITaaI0LvYc4,2396
351
357
  hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py,sha256=JT0RybbvWVlo01FO8K0Yj41HrEaJT3Kj1xfayr2X-xw,2315
@@ -438,7 +444,7 @@ hestia_earth/models/schmidt2007/utils.py,sha256=pQ76IBWMwi10Wa5PjsehtdnOMw-GVgDt
438
444
  hestia_earth/models/site/__init__.py,sha256=aVuLLhq0OQVm-_MZoq4JAKMidqexUWJBg_7mmojmDzc,405
439
445
  hestia_earth/models/site/cationExchangeCapacityPerKgSoil.py,sha256=0eH4A-tXJ0hvIkiYXWxlx8TfrdbIKUGYUDk97-yQJgg,3653
440
446
  hestia_earth/models/site/flowingWater.py,sha256=0ZuSXMr3EUTY3wsy8hdfuXeZcNX-n3D45MfX3dwyaeA,1728
441
- hestia_earth/models/site/management.py,sha256=3jZuDfBVoSuG9xCXYVv3yVLmzxvQvejvZ23FZTkGeO8,5402
447
+ hestia_earth/models/site/management.py,sha256=3xKv2DCsSSqjJCaOqB1JzhGgV-yywk6Pu1CqgILCh-A,5400
442
448
  hestia_earth/models/site/netPrimaryProduction.py,sha256=UIIQkYd911qVzrWjxBLrC37e-RARIVgDwLdARY9BuLw,1849
443
449
  hestia_earth/models/site/organicCarbonPerHa.py,sha256=gcmhZavc2EWvkroKkpFM5xXowPTgyXGh1XL6lgs3CX4,14303
444
450
  hestia_earth/models/site/organicCarbonPerKgSoil.py,sha256=t--wAshiAKS-JvEKhLFRadGvgSBv5NFZ68jdyms_wh4,1945
@@ -455,14 +461,14 @@ hestia_earth/models/site/soilMeasurement.py,sha256=pFh7-lpcBrvpOZ071XhadpuK_5Aoy
455
461
  hestia_earth/models/site/temperatureAnnual.py,sha256=Q3b1RH2_hpA0JWwOYA5nKgMGcXHjV8-akXT9vB0cbwc,2012
456
462
  hestia_earth/models/site/temperatureMonthly.py,sha256=yXwpFCGT2tUqvVBNedaPyBmN_KlzZqo5yv2TWem1pBk,1890
457
463
  hestia_earth/models/site/totalNitrogenPerKgSoil.py,sha256=8ERrTZpN_yCRUyFg_EYaX4abE9jLcyX3lx3MO4Bi6CE,1938
458
- hestia_earth/models/site/utils.py,sha256=sX-U-Edomaw5hhXZVQJ5ugWJmk8-jpdgWts6xDaulRo,3303
464
+ hestia_earth/models/site/utils.py,sha256=b5y6jNmTclC1Vs8FzwW22u3sVyFsvs5if3NJzvLZQLs,3176
459
465
  hestia_earth/models/site/waterDepth.py,sha256=uasApPdOzibZMiOyKNKr_ajAkzwUEEPm1j0FNEy49TY,1293
460
466
  hestia_earth/models/site/measurement/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
461
467
  hestia_earth/models/site/measurement/value.py,sha256=7IhUbIj7n5vB7yXoNxXsWbliEJjg1Ww3T5g_P2IyNCU,1661
462
468
  hestia_earth/models/site/post_checks/__init__.py,sha256=CkExxesk1GuG8NjrbKfix1iDuVUgU-9i1ccM_X7MZn4,284
463
469
  hestia_earth/models/site/post_checks/cache.py,sha256=_MZsNsclecUdHDT2MsYx4cEsVUXydIasddgZNA6SU4k,284
464
470
  hestia_earth/models/site/pre_checks/__init__.py,sha256=fjv6nU5fiL-CLyaa-cBpiLB-xujgPzeK7i7ZJuTOjCI,394
465
- hestia_earth/models/site/pre_checks/cache_geospatialDatabase.py,sha256=9JwbsKl8Pgmh4HuHZcRUnObBViWom0wZFGTOHN_Iaao,4078
471
+ hestia_earth/models/site/pre_checks/cache_geospatialDatabase.py,sha256=XmAJAohSQQwbjqx-xTqB6LuU4lyz5lcG8njVuWFDGsU,4820
466
472
  hestia_earth/models/site/pre_checks/cache_sources.py,sha256=RzvSgHJTpVkAB3mEvRju_irDQmdJRK7GUdU6PhS2Gaw,904
467
473
  hestia_earth/models/site/pre_checks/cache_years.py,sha256=qGwTaHlWxnVT7iVxXVcpJ-oG6M-VH4ZpCDTdTixUHR4,883
468
474
  hestia_earth/models/stehfestBouwman2006/__init__.py,sha256=EhvD4NK6oEPevusLb1WdYV3GT_fCtQx4gvdMhK_dEIQ,420
@@ -495,7 +501,7 @@ hestia_earth/models/transformation/product/__init__.py,sha256=47DEQpj8HBSa-_TImW
495
501
  hestia_earth/models/transformation/product/excreta.py,sha256=Yj9wMF5if-zivb6qbN3vy1X51ZNYxvoyG9f4KPp3Y18,5700
496
502
  hestia_earth/models/usetoxV2/__init__.py,sha256=pK37V3H-KvYcvRKw4Mv8CWrB2N0LFLzmv0jKLdhGGqs,409
497
503
  hestia_earth/models/usetoxV2/freshwaterEcotoxicityPotentialCtue.py,sha256=oYNwThnMXjZymif5buyHiczFiOq_61jOdDMOAyy8vwQ,1018
498
- hestia_earth/models/utils/__init__.py,sha256=ooBopT4rd4fO_zx07tJ2-RTCaLpuQzoh-xIwAb5kCG4,3997
504
+ hestia_earth/models/utils/__init__.py,sha256=-kuwCLmQOihU3n1RxqhojRa3Izd6PGOqA30k7qKl4vc,4275
499
505
  hestia_earth/models/utils/aggregated.py,sha256=sz6usleZmo_tC_hIvmGgYsX8-H0dulXmmhHK4EkA5Kg,4946
500
506
  hestia_earth/models/utils/animalProduct.py,sha256=JA-xGQiwsz-VPR_8UfI5hKa918bpQOWIok3--b_iVuM,681
501
507
  hestia_earth/models/utils/aquacultureManagement.py,sha256=3uSTSMDNNPa26NTJGZCYwByv3QZVyxj6bh2aFCoBzHk,126
@@ -524,7 +530,7 @@ hestia_earth/models/utils/practice.py,sha256=tNadOzsrNlCEt801B815XaruJXzZ5yPASam
524
530
  hestia_earth/models/utils/product.py,sha256=XwxrRwdREWc4N5cE0oLJbLdEucKFRKgKNDj-Kd8mZEQ,9837
525
531
  hestia_earth/models/utils/productivity.py,sha256=bUBVCZInGqHuHZvHDSYPQkjWXQxOtTjEk-1-f_BsFOo,594
526
532
  hestia_earth/models/utils/property.py,sha256=7UV9pxSX49RnUsbEqOeohzxyXXShao1XAnEYCCVKS0k,4923
527
- hestia_earth/models/utils/site.py,sha256=4i6rjvFIzOEcsNcF1B9I8OFdVR_iFDODcWgq2_XFXfc,3155
533
+ hestia_earth/models/utils/site.py,sha256=OhSpyDqVwnIglBtoa3iUImzVr0Xj254oYR1wMiAiOHs,3176
528
534
  hestia_earth/models/utils/source.py,sha256=HhZkvQoFdy6j6FC2cwP5EbHXHFM4pif9gpnuzeDwEh4,1746
529
535
  hestia_earth/models/utils/temperature.py,sha256=ljlG4-yCgFFb6LRZweb18cZKLrr7K2mqd4E4Hz_D1f8,476
530
536
  hestia_earth/models/utils/term.py,sha256=_DahtnHIS5wtyEXew3gpV52QjnsAWQZmyxnz4fu6mrI,17780
@@ -665,8 +671,10 @@ tests/models/geospatialDatabase/test_nutrientLossToAquaticEnvironment.py,sha256=
665
671
  tests/models/geospatialDatabase/test_organicCarbonPerKgSoil.py,sha256=WomlRdVl4f6ooJz2YctPf0YGiNs-9To6XFwTdtpm0SQ,1024
666
672
  tests/models/geospatialDatabase/test_potentialEvapotranspirationAnnual.py,sha256=6s4XDmKi__njKE_3tFMIAHr0a1w7X4t8uFRtihN_cm4,706
667
673
  tests/models/geospatialDatabase/test_potentialEvapotranspirationLongTermAnnualMean.py,sha256=KzIXuYeO5IZ8l4tKsIEaWcFeV_vSPDSpR6xiuvt_x4o,1003
674
+ tests/models/geospatialDatabase/test_potentialEvapotranspirationMonthly.py,sha256=iu8HWAwl52fWDQJ_Nz5AZIAzbuMAjQfiQwxCHlciI-o,762
668
675
  tests/models/geospatialDatabase/test_precipitationAnnual.py,sha256=OhN7dbLZUG8ofvV7C56RKE_hGFXGtOuzXYz3EwFcQyg,744
669
676
  tests/models/geospatialDatabase/test_precipitationLongTermAnnualMean.py,sha256=wGGKXGemg3OEgDRRXy52oFf5p8jU57iraTgQMWDzusQ,1033
677
+ tests/models/geospatialDatabase/test_precipitationMonthly.py,sha256=FTmnMXqwxuV_FwNzx8ZJsF5DCdaOdXPNV9UQ5gFKALs,748
670
678
  tests/models/geospatialDatabase/test_region.py,sha256=5q3q5TK7yzvoZI2gknf-TPNcmDqVkMo0D3-KY401J2k,882
671
679
  tests/models/geospatialDatabase/test_sandContent.py,sha256=hvV0Z51hKPLoSBNsjLJ18upGSt3FUHYbp2ofx7fBUvU,1177
672
680
  tests/models/geospatialDatabase/test_siltContent.py,sha256=udJDh2gidlkQVkotxWjCCsXRkbvAQxfpFAjEj5dtNJE,1124
@@ -675,6 +683,7 @@ tests/models/geospatialDatabase/test_slopeLength.py,sha256=56iCm-qn41NpeVHU9dKtA
675
683
  tests/models/geospatialDatabase/test_soilPh.py,sha256=Xi-SQ9HesSbvpaUd97n7KbDhxLVZLh07mQ-YtOR0FZU,1008
676
684
  tests/models/geospatialDatabase/test_temperatureAnnual.py,sha256=1hW0fHUlFOAWiPqYZm4ZbTGqjpOAmLb1mkucnAaTrIQ,742
677
685
  tests/models/geospatialDatabase/test_temperatureLongTermAnnualMean.py,sha256=Wrz9dbDvXM0OgBA3mXpzY0WZk-yqIp980JRKenxFqno,1031
686
+ tests/models/geospatialDatabase/test_temperatureMonthly.py,sha256=eUaI1TZ-9sXFxWR2UoKBbca8dzW21zp5jGcfbooTt3M,746
678
687
  tests/models/geospatialDatabase/test_totalNitrogenPerKgSoil.py,sha256=_U3j5hqwYezG7e9v2WyO9ik2QJ9MqjM1QWPGkDChP7M,1024
679
688
  tests/models/geospatialDatabase/test_totalPhosphorusPerKgSoil.py,sha256=N5Vqf3YKlxHxWRe1PP3Kpbd30bhPOsB8eYr2IGS7quk,1026
680
689
  tests/models/geospatialDatabase/test_utils.py,sha256=2AOTtxs7KjPUVQXyErHsm7578523a5WNODVbbuxafAY,758
@@ -724,6 +733,7 @@ tests/models/ipcc2006/test_aboveGroundCropResidueRemoved.py,sha256=5F7eU4qWYfTZA
724
733
  tests/models/ipcc2006/test_aboveGroundCropResidueTotal.py,sha256=FrSR1xBTRtJ99pXAklXLtDRC00FSW1vXSAvQNeBoXTQ,1725
725
734
  tests/models/ipcc2006/test_belowGroundCropResidue.py,sha256=cFqLDFy5pcgOyzKC9l-RClEP6CWCdVNnq48S90SITVM,1720
726
735
  tests/models/ipcc2006/test_co2ToAirOrganicSoilCultivation.py,sha256=wM1BYFcK28aiNVP6JUEWdc90kCd3w4rjOnpxzwuYV_o,1609
736
+ tests/models/ipcc2006/test_n2OToAirCropResidueDecompositionDirect.py,sha256=rmL8K9ToJa9SAO-kxSd8Zz3cl5bTWrDRDxsPAMMTmCo,1626
727
737
  tests/models/ipcc2006/test_n2OToAirCropResidueDecompositionIndirect.py,sha256=cxn5rX_pZqbl7m8rhJARuyjG2P5O-BQbufeEcTmO06k,1357
728
738
  tests/models/ipcc2006/test_n2OToAirExcretaDirect.py,sha256=tm6Lm90_4qEkCU6UIFsOD6yhrMrq69lkF1LvCjXPjE4,2132
729
739
  tests/models/ipcc2006/test_n2OToAirExcretaIndirect.py,sha256=712I87Wkpp4KcHfHaK1kgfD6nfHGo3iZqKIwfMG9a6A,1282
@@ -756,14 +766,16 @@ tests/models/ipcc2019/test_n2OToAirInorganicFertiliserDirect.py,sha256=ffk-aom1B
756
766
  tests/models/ipcc2019/test_n2OToAirInorganicFertiliserIndirect.py,sha256=RnU8CkUCYBBO1bgJALnoVgjTHLL1L1sja2nsyeVA_cg,2113
757
767
  tests/models/ipcc2019/test_n2OToAirOrganicFertiliserDirect.py,sha256=XQpzdEFT7qSw6KKRYEZ6Cmzkc_xLyG98FHH1PSfOUo0,2403
758
768
  tests/models/ipcc2019/test_n2OToAirOrganicFertiliserIndirect.py,sha256=hW84sTlhB8mKRSFJX_iQS4gYo74zCtY-9zr1VHLC5GU,2111
769
+ tests/models/ipcc2019/test_nh3ToAirInorganicFertiliser.py,sha256=xmRHSTmyh--EZX29Z5NHD4LqEZl7Lkc5HntBCXlIRHE,1537
759
770
  tests/models/ipcc2019/test_nh3ToAirOrganicFertiliser.py,sha256=Z4a20I2UnZdzm6FqHnlHRXXVCY993_SHT7nG-zAhx-c,1104
760
771
  tests/models/ipcc2019/test_nitrogenContent.py,sha256=rKl_05PCC0OSsAhG0cHJOqnt9LsCaFnRpJorkm1TShA,3704
761
772
  tests/models/ipcc2019/test_no3ToGroundwaterCropResidueDecomposition.py,sha256=4__3HDUDWt5KjQGcXEFXHBgP_jT0rxvIzpBLH_mP9WE,1729
762
773
  tests/models/ipcc2019/test_no3ToGroundwaterExcreta.py,sha256=Z-pCBQvlUf0ttmCERgezW-6e3KlX45YEVccOwthf5lU,1588
763
774
  tests/models/ipcc2019/test_no3ToGroundwaterInorganicFertiliser.py,sha256=e7REnQ9r9a8xroq5aPp0NIzmkad_6MyTuceRTYoKdkE,1613
764
775
  tests/models/ipcc2019/test_no3ToGroundwaterOrganicFertiliser.py,sha256=e1ZViD12qB3bLdH3TJw3GbBP8iqMen-UJbcFkytb3VQ,1609
776
+ tests/models/ipcc2019/test_noxToAirInorganicFertiliser.py,sha256=NZBSBJLM_j2PEpHRON2ysgKNF8x5sHfQVoAKQdGsfzk,1537
765
777
  tests/models/ipcc2019/test_noxToAirOrganicFertiliser.py,sha256=LR5pjV5vRbgSSQAw8kYRp_ij4CHInzgaDS6EggQuBiw,1104
766
- tests/models/ipcc2019/test_organicCarbonPerHa.py,sha256=lsg148KPupjF4ds8yUy1Cl2hcVXaGT9AIgkGycbHqXI,21643
778
+ tests/models/ipcc2019/test_organicCarbonPerHa.py,sha256=QTo8GL_jXNRH_r8fgt0K9Z_QEP9PjuRN6N0fyyebAj0,21346
767
779
  tests/models/ipcc2019/test_pastureGrass.py,sha256=pE4PWdR541v4xWDYihP7Dou8V1iqg5GwD5_rjGRzrds,2292
768
780
  tests/models/ipcc2021/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
769
781
  tests/models/ipcc2021/test_gwp100.py,sha256=JRklKMSg-OXopb9ZufGgl94deuMuJSsfNXRZDBtOZrE,1119
@@ -952,7 +964,7 @@ tests/models/schmidt2007/test_utils.py,sha256=rmtOV3xiFynjgx8lQNGsJqquG8HDxz3LDm
952
964
  tests/models/site/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
953
965
  tests/models/site/test_cationExchangeCapacityPerKgSoil.py,sha256=tNMhN998vcjQ15I-5mNnFh2d7mHzEBIBO6o1VSfQNUE,1075
954
966
  tests/models/site/test_flowingWater.py,sha256=t_rxvdlmUVDsFBoDF20_zDM-0iiLKkNCV7knO9l1T7o,1370
955
- tests/models/site/test_management.py,sha256=wwXuaIaGz5kh65PPXqp9WvvlKYSCNFZQoHJMU-mKJ-4,3779
967
+ tests/models/site/test_management.py,sha256=dY_1QlIbnm-cQruD7DQT6fhWezC63X3B4yknq8d6RIQ,3774
956
968
  tests/models/site/test_netPrimaryProduction.py,sha256=JCxG0MODbKVvl3hOqmKzh4FjHYn3Xs9KsVod6LvKQII,1108
957
969
  tests/models/site/test_organicCarbonPerHa.py,sha256=6Qtc0Xmveir7MmNF4Ekv5YkV92TNp8GfDnURPVg05-4,3471
958
970
  tests/models/site/test_organicCarbonPerKgSoil.py,sha256=0M-NMg_T3UXzGT_VlKOKhSxg4cZ0_zhd3FRgY5Hpj6o,1087
@@ -1007,7 +1019,7 @@ tests/models/transformation/product/test_excreta.py,sha256=Q9OQpk8qVPv3alIz2i5XQ
1007
1019
  tests/models/usetoxV2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1008
1020
  tests/models/usetoxV2/test_freshwaterEcotoxicityPotentialCtue.py,sha256=eq7Gcmfya9g0eOKKkuBhz8vq7xi_CmZ_LTSxueBwZt4,835
1009
1021
  tests/models/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1010
- tests/models/utils/test_blank_node.py,sha256=xlyddD7moTRvjiHq2Z9uKJODV05WW8YZkliUOCHy4b8,31488
1022
+ tests/models/utils/test_blank_node.py,sha256=T1-JRrWcK6oFavYAEy7gt2iojnTdNgoX2WDc08-4h-I,31333
1011
1023
  tests/models/utils/test_cropResidueManagement.py,sha256=RQt8lexeJzCyxZceIutgDpw7BpcqmjsUB0C0yZC2QpY,930
1012
1024
  tests/models/utils/test_currency.py,sha256=BPsojPsY9QW2aj8vgbjkPQXU8GU6wDwwtPZ3HdC4KTU,277
1013
1025
  tests/models/utils/test_cycle.py,sha256=evTHH73ftNVhv5vHlYE2973msKE4pSCd3D0GfX1ZPUA,465
@@ -1022,13 +1034,13 @@ tests/models/utils/test_measurement.py,sha256=Sl5dPZgu1Nrb7kliFiUpx-kEH81v7MdxiH
1022
1034
  tests/models/utils/test_practice.py,sha256=ILaxkb3qICor9AquAGYiOtA-YKnq0hppmJQzNC_VNyA,612
1023
1035
  tests/models/utils/test_product.py,sha256=kwvgAeeEoRgkeStX0zQcFd-4DJhoUhX6Apaks0MU2L0,2305
1024
1036
  tests/models/utils/test_property.py,sha256=t2npw86IK7C6G4ypiPtanFi0db4PB7G5VBR1GjRGl34,618
1025
- tests/models/utils/test_site.py,sha256=cSKrkLeerymMLZAwCnbQce38NwgxXojQHAVm9DPUTpg,1181
1037
+ tests/models/utils/test_site.py,sha256=5nCW3onTk6GF_N-h4NYDrlSoxHhXY2GVMbjaDsicbSE,1187
1026
1038
  tests/models/utils/test_source.py,sha256=mv3vHZV5cjpoLA2I1109-YUkuzAiuhbRSnv_76_f0CA,631
1027
1039
  tests/models/utils/test_term.py,sha256=JJmzyHnhVGeQ7tG-T6DjE7CoIJPH0guH-y2kjGeZiJY,3756
1028
1040
  tests/models/webbEtAl2012AndSintermannEtAl2012/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1029
1041
  tests/models/webbEtAl2012AndSintermannEtAl2012/test_nh3ToAirOrganicFertiliser.py,sha256=qi2FNXS5Af2WDtm7nq_FsprH3BfCF0XxnE0XHmC4aIY,2244
1030
- hestia_earth_models-0.59.2.dist-info/LICENSE,sha256=EFSZhfUdZCTsCIYdHzTGewMKfRfp7X9t1s2aaKxm8O0,1154
1031
- hestia_earth_models-0.59.2.dist-info/METADATA,sha256=-qJ0J6ITtaF7C2fKg8Y38GtdFxZq0FMtcW4XO-H1pkA,3134
1032
- hestia_earth_models-0.59.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
1033
- hestia_earth_models-0.59.2.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1034
- hestia_earth_models-0.59.2.dist-info/RECORD,,
1042
+ hestia_earth_models-0.59.4.dist-info/LICENSE,sha256=EFSZhfUdZCTsCIYdHzTGewMKfRfp7X9t1s2aaKxm8O0,1154
1043
+ hestia_earth_models-0.59.4.dist-info/METADATA,sha256=GRtBR9ZzqxPAH4asis3_RYiwPtga8Kk-Rs5Yfefk318,3134
1044
+ hestia_earth_models-0.59.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
1045
+ hestia_earth_models-0.59.4.dist-info/top_level.txt,sha256=1dqA9TqpOLTEgpqa-YBsmbCmmNU1y56AtfFGEceZ2A0,19
1046
+ hestia_earth_models-0.59.4.dist-info/RECORD,,
@@ -0,0 +1,20 @@
1
+ from unittest.mock import patch
2
+ import json
3
+ from tests.utils import fixtures_path, fake_new_measurement
4
+
5
+ from hestia_earth.models.geospatialDatabase.potentialEvapotranspirationMonthly import MODEL, TERM_ID, run
6
+
7
+ class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
+ fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
9
+
10
+
11
+ @patch(f"{class_path}.get_source", return_value={})
12
+ @patch(f"{class_path}._new_measurement", side_effect=fake_new_measurement)
13
+ @patch(f"{class_path}.related_years", return_value=['2009'])
14
+ @patch(f"{class_path}.download", return_value=None)
15
+ def test_run(mock_download, *args):
16
+ with open(f"{fixtures_path}/{MODEL}/site.jsonld", encoding='utf-8') as f:
17
+ site = json.load(f)
18
+
19
+ run(site)
20
+ assert mock_download.call_count == 12
@@ -0,0 +1,20 @@
1
+ from unittest.mock import patch
2
+ import json
3
+ from tests.utils import fixtures_path, fake_new_measurement
4
+
5
+ from hestia_earth.models.geospatialDatabase.precipitationMonthly import MODEL, TERM_ID, run
6
+
7
+ class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
+ fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
9
+
10
+
11
+ @patch(f"{class_path}.get_source", return_value={})
12
+ @patch(f"{class_path}._new_measurement", side_effect=fake_new_measurement)
13
+ @patch(f"{class_path}.related_years", return_value=['2009'])
14
+ @patch(f"{class_path}.download", return_value=None)
15
+ def test_run(mock_download, *args):
16
+ with open(f"{fixtures_path}/{MODEL}/site.jsonld", encoding='utf-8') as f:
17
+ site = json.load(f)
18
+
19
+ run(site)
20
+ assert mock_download.call_count == 12
@@ -0,0 +1,20 @@
1
+ from unittest.mock import patch
2
+ import json
3
+ from tests.utils import fixtures_path, fake_new_measurement
4
+
5
+ from hestia_earth.models.geospatialDatabase.temperatureMonthly import MODEL, TERM_ID, run
6
+
7
+ class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
+ fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
9
+
10
+
11
+ @patch(f"{class_path}.get_source", return_value={})
12
+ @patch(f"{class_path}._new_measurement", side_effect=fake_new_measurement)
13
+ @patch(f"{class_path}.related_years", return_value=['2009'])
14
+ @patch(f"{class_path}.download", return_value=None)
15
+ def test_run(mock_download, *args):
16
+ with open(f"{fixtures_path}/{MODEL}/site.jsonld", encoding='utf-8') as f:
17
+ site = json.load(f)
18
+
19
+ run(site)
20
+ assert mock_download.call_count == 12
@@ -0,0 +1,50 @@
1
+ from unittest.mock import patch
2
+ import json
3
+ from tests.utils import fixtures_path, fake_new_emission
4
+
5
+ from hestia_earth.models.ipcc2006.n2OToAirCropResidueDecompositionDirect import MODEL, TERM_ID, run, _should_run
6
+
7
+ class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
+ fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
9
+
10
+
11
+ @patch(f"{class_path}._is_term_type_complete", return_value=False)
12
+ @patch(f"{class_path}.get_crop_residue_decomposition_N_total", return_value=0)
13
+ def test_should_run(mock_N_total, mock_complete):
14
+ # no N => no run
15
+ should_run, *args = _should_run({})
16
+ assert not should_run
17
+
18
+ # with N => no run
19
+ mock_N_total.return_value = 10
20
+ should_run, *args = _should_run({})
21
+ assert not should_run
22
+
23
+ # is complete => run
24
+ mock_complete.return_value = True
25
+ should_run, *args = _should_run({})
26
+ assert should_run is True
27
+
28
+
29
+ @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
30
+ def test_run(*args):
31
+ with open(f"{fixtures_folder}/cycle.jsonld", encoding='utf-8') as f:
32
+ cycle = json.load(f)
33
+
34
+ with open(f"{fixtures_folder}/result.jsonld", encoding='utf-8') as f:
35
+ expected = json.load(f)
36
+
37
+ value = run(cycle)
38
+ assert value == expected
39
+
40
+
41
+ @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
42
+ def test_run_flooded_rice(*args):
43
+ with open(f"{fixtures_folder}/with-flooded-rice/cycle.jsonld", encoding='utf-8') as f:
44
+ cycle = json.load(f)
45
+
46
+ with open(f"{fixtures_folder}/with-flooded-rice/result.jsonld", encoding='utf-8') as f:
47
+ expected = json.load(f)
48
+
49
+ value = run(cycle)
50
+ assert value == expected
@@ -0,0 +1,47 @@
1
+ from unittest.mock import patch
2
+ import json
3
+ from tests.utils import fixtures_path, fake_new_emission
4
+
5
+ from hestia_earth.models.ipcc2019.nh3ToAirInorganicFertiliser import MODEL, TERM_ID, run, _should_run
6
+
7
+ class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
+ fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
9
+
10
+
11
+ @patch(f"{class_path}._is_term_type_complete", return_value=False)
12
+ @patch(f"{class_path}.get_inorganic_fertiliser_N_total", return_value=0)
13
+ def test_should_run(mock_N_total, mock_complete, *args):
14
+ # no N => no run
15
+ assert not _should_run({})
16
+
17
+ # with N => no run
18
+ mock_N_total.return_value = 10
19
+ assert not _should_run({})
20
+
21
+ # is complete => run
22
+ mock_complete.return_value = True
23
+ assert _should_run({}) is True
24
+
25
+
26
+ @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
27
+ def test_run_aggregated(*args):
28
+ with open(f"{fixtures_folder}/aggregated/cycle.jsonld", encoding='utf-8') as f:
29
+ cycle = json.load(f)
30
+
31
+ with open(f"{fixtures_folder}/aggregated/result.jsonld", encoding='utf-8') as f:
32
+ expected = json.load(f)
33
+
34
+ value = run(cycle)
35
+ assert value == expected
36
+
37
+
38
+ @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
39
+ def test_run_disaggregated(*args):
40
+ with open(f"{fixtures_folder}/disaggregated/cycle.jsonld", encoding='utf-8') as f:
41
+ cycle = json.load(f)
42
+
43
+ with open(f"{fixtures_folder}/disaggregated/result.jsonld", encoding='utf-8') as f:
44
+ expected = json.load(f)
45
+
46
+ value = run(cycle)
47
+ assert value == expected
@@ -0,0 +1,47 @@
1
+ from unittest.mock import patch
2
+ import json
3
+ from tests.utils import fixtures_path, fake_new_emission
4
+
5
+ from hestia_earth.models.ipcc2019.noxToAirInorganicFertiliser import MODEL, TERM_ID, run, _should_run
6
+
7
+ class_path = f"hestia_earth.models.{MODEL}.{TERM_ID}"
8
+ fixtures_folder = f"{fixtures_path}/{MODEL}/{TERM_ID}"
9
+
10
+
11
+ @patch(f"{class_path}._is_term_type_complete", return_value=False)
12
+ @patch(f"{class_path}.get_inorganic_fertiliser_N_total", return_value=0)
13
+ def test_should_run(mock_N_total, mock_complete, *args):
14
+ # no N => no run
15
+ assert not _should_run({})
16
+
17
+ # with N => no run
18
+ mock_N_total.return_value = 10
19
+ assert not _should_run({})
20
+
21
+ # is complete => run
22
+ mock_complete.return_value = True
23
+ assert _should_run({}) is True
24
+
25
+
26
+ @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
27
+ def test_run_aggregated(*args):
28
+ with open(f"{fixtures_folder}/aggregated/cycle.jsonld", encoding='utf-8') as f:
29
+ cycle = json.load(f)
30
+
31
+ with open(f"{fixtures_folder}/aggregated/result.jsonld", encoding='utf-8') as f:
32
+ expected = json.load(f)
33
+
34
+ value = run(cycle)
35
+ assert value == expected
36
+
37
+
38
+ @patch(f"{class_path}._new_emission", side_effect=fake_new_emission)
39
+ def test_run_disaggregated(*args):
40
+ with open(f"{fixtures_folder}/disaggregated/cycle.jsonld", encoding='utf-8') as f:
41
+ cycle = json.load(f)
42
+
43
+ with open(f"{fixtures_folder}/disaggregated/result.jsonld", encoding='utf-8') as f:
44
+ expected = json.load(f)
45
+
46
+ value = run(cycle)
47
+ assert value == expected
@@ -16,7 +16,6 @@ from hestia_earth.models.ipcc2019.organicCarbonPerHa import (
16
16
  _calc_temperature_factor,
17
17
  _calc_tier_1_soc_stocks,
18
18
  _calc_water_factor,
19
- _calculated_cycles,
20
19
  _check_cropland_low_category,
21
20
  _check_cropland_medium_category,
22
21
  _get_carbon_input_kwargs,
@@ -146,11 +145,11 @@ RUN_SUBFOLDERS = [
146
145
  @patch(f"{class_path}.get_residue_removed_or_burnt_terms", return_value=RESIDUE_REMOVED_OR_BURNT_TERM_IDS)
147
146
  @patch(f"{class_path}.get_upland_rice_land_cover_terms", return_value=UPLAND_RICE_LAND_COVER_TERM_IDS)
148
147
  @patch(f"{class_path}.get_upland_rice_crop_terms", return_value=UPLAND_RICE_CROP_TERM_IDS)
149
- @patch(f"{class_path}._calculated_cycles")
148
+ @patch(f"{class_path}.related_cycles")
150
149
  @patch("hestia_earth.models.utils.property.find_term_property")
151
150
  def test_run(
152
151
  mock_find_term_property,
153
- mock_calculated_cycles,
152
+ mock_related_cycles,
154
153
  _mock_get_upland_rice_crop_terms,
155
154
  _mock_get_upland_rice_land_cover_terms,
156
155
  _mock_get_residue_removed_or_burnt_terms,
@@ -169,7 +168,7 @@ def test_run(
169
168
  return json.load(f)
170
169
 
171
170
  mock_find_term_property.side_effect = find_term_property_side_effect
172
- mock_calculated_cycles.return_value = load_cycles_from_file() if load_cycles else []
171
+ mock_related_cycles.return_value = load_cycles_from_file() if load_cycles else []
173
172
 
174
173
  with open(f"{folder}/site.jsonld", encoding='utf-8') as f:
175
174
  site = json.load(f)
@@ -189,7 +188,7 @@ def test_run(
189
188
  @patch(f"{class_path}.get_residue_removed_or_burnt_terms", return_value=RESIDUE_REMOVED_OR_BURNT_TERM_IDS)
190
189
  @patch(f"{class_path}.get_upland_rice_land_cover_terms", return_value=UPLAND_RICE_LAND_COVER_TERM_IDS)
191
190
  @patch(f"{class_path}.get_upland_rice_crop_terms", return_value=UPLAND_RICE_CROP_TERM_IDS)
192
- @patch(f"{class_path}._calculated_cycles", return_value=[])
191
+ @patch(f"{class_path}.related_cycles", return_value=[])
193
192
  def test_run_no_data(*args):
194
193
  SITE = {}
195
194
  EXPECTED = []
@@ -234,22 +233,6 @@ def test_calc_water_factor():
234
233
  assert _calc_water_factor(1, 1) == _calc_water_factor(1000, 1000)
235
234
 
236
235
 
237
- @patch(f"{class_path}.find_related")
238
- @patch("hestia_earth.models.utils.download_hestia")
239
- def test_calculated_cycles(mock_download_hestia, mock_find_related):
240
- CYCLES = [{"@id": "cycle"}]
241
- EXPECTED = [{"@id": "cycle", "@type": "Cycle"}]
242
-
243
- mock_download_hestia.side_effect = lambda node_id, node_type, **_: {
244
- "@type": node_type.value,
245
- "@id": node_id
246
- }
247
- mock_find_related.return_value = CYCLES
248
-
249
- result = _calculated_cycles({})
250
- assert EXPECTED == result
251
-
252
-
253
236
  # --- IPCC SOIL CATEGORY TESTS ---
254
237
 
255
238
 
@@ -438,7 +421,12 @@ CARBON_INPUT_CATEGORY_PARAMS = [
438
421
  IpccCarbonInputCategory.CROPLAND_HIGH_WITH_MANURE
439
422
  ),
440
423
  (
441
- "cropland-high-without-manure",
424
+ "cropland-high-without-manure/organic-fertiliser", # Closes issue 743
425
+ IpccManagementCategory.FULL_TILLAGE,
426
+ IpccCarbonInputCategory.CROPLAND_HIGH_WITHOUT_MANURE
427
+ ),
428
+ (
429
+ "cropland-high-without-manure/soil-amendment", # Closes issue 743
442
430
  IpccManagementCategory.FULL_TILLAGE,
443
431
  IpccCarbonInputCategory.CROPLAND_HIGH_WITHOUT_MANURE
444
432
  ),
@@ -2,7 +2,7 @@ import json
2
2
  from unittest.mock import patch
3
3
  from hestia_earth.schema import TermTermType
4
4
 
5
- from hestia_earth.models.site.management import MODEL, MODEL_KEY, run, should_run
5
+ from hestia_earth.models.site.management import MODEL, MODEL_KEY, run, _should_run
6
6
  from tests.utils import fixtures_path
7
7
 
8
8
  CLASS_PATH = f"hestia_earth.models.{MODEL}.{MODEL_KEY}"
@@ -18,13 +18,13 @@ TERM_BY_ID = {
18
18
  def test_should_run(mock_related_cycles, *args):
19
19
  # no cycles => do not run
20
20
  mock_related_cycles.return_value = []
21
- _should_run, *args = should_run({})
22
- assert _should_run is False
21
+ should_run, *args = _should_run({})
22
+ assert should_run is False
23
23
 
24
24
  # no products => do not run
25
25
  mock_related_cycles.return_value = [{"products": []}]
26
- _should_run, *args = should_run({})
27
- assert _should_run is False
26
+ should_run, *args = _should_run({})
27
+ assert should_run is False
28
28
 
29
29
  # with irrelevant termType => do not run
30
30
  mock_related_cycles.return_value = [
@@ -37,8 +37,8 @@ def test_should_run(mock_related_cycles, *args):
37
37
  "endDate": "2022"
38
38
  }
39
39
  ]
40
- _should_run, *args = should_run({})
41
- assert _should_run is False
40
+ should_run, *args = _should_run({})
41
+ assert should_run is False
42
42
 
43
43
  # products and practices but no relevant terms/termTypes => do not run
44
44
  mock_related_cycles.return_value = [
@@ -53,8 +53,8 @@ def test_should_run(mock_related_cycles, *args):
53
53
  ]
54
54
  }
55
55
  ]
56
- _should_run, *args = should_run({})
57
- assert _should_run is False
56
+ should_run, *args = _should_run({})
57
+ assert should_run is False
58
58
 
59
59
  # # practices with relevant termType => run
60
60
  mock_related_cycles.return_value = [
@@ -67,8 +67,8 @@ def test_should_run(mock_related_cycles, *args):
67
67
  "endDate": "2022"
68
68
  }
69
69
  ]
70
- _should_run, *args = should_run({})
71
- assert _should_run is True
70
+ should_run, *args = _should_run({})
71
+ assert should_run is True
72
72
 
73
73
  # with relevant product => run
74
74
  mock_related_cycles.return_value = [
@@ -89,8 +89,8 @@ def test_should_run(mock_related_cycles, *args):
89
89
  "endDate": "2022"
90
90
  }
91
91
  ]
92
- _should_run, *args = should_run({})
93
- assert _should_run is True
92
+ should_run, *args = _should_run({})
93
+ assert should_run is True
94
94
  assert args[0] == [{
95
95
  'term': TERM_BY_ID['genericCropPlant'],
96
96
  'value': 100,
@@ -815,13 +815,13 @@ def test_group_nodes_by_year_scenario_d():
815
815
  "value": 100
816
816
  },
817
817
  {
818
- "term.@id": "organicFertiliserOrSoilCarbonIncreasingAmendmentUsed",
818
+ "term.@id": "organicFertiliserUsed",
819
819
  "endDate": "2000-11",
820
820
  "startDate": "2000-09",
821
821
  "value": True
822
822
  },
823
823
  {
824
- "term.@id": "organicFertiliserOrSoilCarbonIncreasingAmendmentUsed",
824
+ "term.@id": "organicFertiliserUsed",
825
825
  "endDate": "2002-06",
826
826
  "startDate": "2001-07",
827
827
  "value": True
@@ -838,7 +838,7 @@ def test_group_nodes_by_year_scenario_d():
838
838
  "fraction_of_node_duration": 0.9153005464480874
839
839
  },
840
840
  {
841
- "term.@id": "organicFertiliserOrSoilCarbonIncreasingAmendmentUsed",
841
+ "term.@id": "organicFertiliserUsed",
842
842
  "endDate": "2000-11",
843
843
  "startDate": "2000-09",
844
844
  "value": True,
@@ -872,7 +872,7 @@ def test_group_nodes_by_year_scenario_d():
872
872
  "fraction_of_node_duration": 0.8315217391304348
873
873
  },
874
874
  {
875
- "term.@id": "organicFertiliserOrSoilCarbonIncreasingAmendmentUsed",
875
+ "term.@id": "organicFertiliserUsed",
876
876
  "endDate": "2002-06",
877
877
  "startDate": "2001-07",
878
878
  "value": True,
@@ -882,7 +882,7 @@ def test_group_nodes_by_year_scenario_d():
882
882
  ],
883
883
  2002: [
884
884
  {
885
- "term.@id": "organicFertiliserOrSoilCarbonIncreasingAmendmentUsed",
885
+ "term.@id": "organicFertiliserUsed",
886
886
  "endDate": "2002-06",
887
887
  "startDate": "2001-07",
888
888
  "value": True,
@@ -19,7 +19,7 @@ def test_region_level_1_id():
19
19
 
20
20
 
21
21
  @patch(f"{class_path}.find_related", return_value=[CYCLE])
22
- @patch(f"{class_path}.download_hestia", return_value=CYCLE)
22
+ @patch(f"{class_path}._load_calculated_node", return_value=CYCLE)
23
23
  def test_related_cycles(*args):
24
24
  assert related_cycles('id') == [CYCLE]
25
25