hestia-earth-models 0.74.10__py3-none-any.whl → 0.74.12__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/agribalyse2016/fuelElectricity.py +1 -2
- hestia_earth/models/agribalyse2016/machineryInfrastructureDepreciatedAmountPerCycle.py +1 -7
- hestia_earth/models/akagiEtAl2011/utils.py +2 -6
- hestia_earth/models/aware/scarcityWeightedWaterUse.py +1 -4
- hestia_earth/models/aware2_0/scarcityWeightedWaterUse.py +1 -4
- hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsLandOccupation.py +1 -4
- hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsLandTransformation.py +1 -4
- hestia_earth/models/chaudharyBrooks2018/damageToTerrestrialEcosystemsTotalLandUseEffects.py +1 -4
- hestia_earth/models/cml2001Baseline/abioticResourceDepletionFossilFuels.py +1 -4
- hestia_earth/models/cml2001Baseline/abioticResourceDepletionMineralsAndMetals.py +1 -4
- hestia_earth/models/cml2001Baseline/eutrophicationPotentialExcludingFate.py +1 -4
- hestia_earth/models/cml2001Baseline/resourceUseEnergyDepletionDuringCycle.py +12 -10
- hestia_earth/models/cml2001Baseline/resourceUseMineralsAndMetalsDuringCycle.py +5 -5
- hestia_earth/models/cml2001Baseline/terrestrialAcidificationPotentialIncludingFateAverageEurope.py +1 -7
- hestia_earth/models/cml2001NonBaseline/eutrophicationPotentialIncludingFateAverageEurope.py +1 -7
- hestia_earth/models/cml2001NonBaseline/terrestrialAcidificationPotentialExcludingFate.py +1 -7
- hestia_earth/models/config/ImpactAssessment.json +12 -6
- hestia_earth/models/config/Site.json +16 -0
- hestia_earth/models/cycle/aboveGroundCropResidueTotal.py +1 -6
- hestia_earth/models/cycle/practice/landCover.py +9 -9
- hestia_earth/models/dammgen2009/noxToAirExcreta.py +1 -2
- hestia_earth/models/deRuijterEtAl2010/nh3ToAirCropResidueDecomposition.py +1 -2
- hestia_earth/models/ecoalimV9/cycle.py +1 -2
- hestia_earth/models/ecoalimV9/impact_assessment.py +10 -3
- hestia_earth/models/ecoinventV3/cycle.py +1 -2
- hestia_earth/models/ecoinventV3AndEmberClimate/cycle.py +1 -2
- hestia_earth/models/edip2003/ozoneDepletionPotential.py +1 -7
- hestia_earth/models/emepEea2019/utils.py +1 -2
- hestia_earth/models/emissionNotRelevant/__init__.py +2 -2
- hestia_earth/models/environmentalFootprintV3_1/environmentalFootprintSingleOverallScore.py +1 -4
- hestia_earth/models/environmentalFootprintV3_1/freshwaterEcotoxicityPotentialCtue.py +1 -7
- hestia_earth/models/environmentalFootprintV3_1/marineEutrophicationPotential.py +1 -7
- hestia_earth/models/environmentalFootprintV3_1/photochemicalOzoneCreationPotentialHumanHealthNmvocEq.py +1 -7
- hestia_earth/models/environmentalFootprintV3_1/scarcityWeightedWaterUse.py +1 -7
- hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandOccupation.py +2 -7
- hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexLandTransformation.py +2 -7
- hestia_earth/models/environmentalFootprintV3_1/soilQualityIndexTotalLandUseEffects.py +2 -7
- hestia_earth/models/epa2014/no3ToGroundwaterExcreta.py +1 -2
- hestia_earth/models/fantkeEtAl2016/damageToHumanHealthParticulateMatterFormation.py +2 -11
- hestia_earth/models/faostat2018/liveweightPerHead.py +11 -7
- hestia_earth/models/faostat2018/product/price.py +9 -5
- hestia_earth/models/faostat2018/seed.py +5 -12
- hestia_earth/models/faostat2018/utils.py +14 -6
- hestia_earth/models/frischknechtEtAl2000/ionisingRadiationKbqU235Eq.py +4 -8
- hestia_earth/models/geospatialDatabase/altitude.py +1 -2
- hestia_earth/models/geospatialDatabase/clayContent.py +1 -2
- hestia_earth/models/geospatialDatabase/croppingIntensity.py +1 -3
- hestia_earth/models/geospatialDatabase/drainageClass.py +1 -2
- hestia_earth/models/geospatialDatabase/ecoClimateZone.py +1 -2
- hestia_earth/models/geospatialDatabase/erodibility.py +1 -2
- hestia_earth/models/geospatialDatabase/heavyWinterPrecipitation.py +1 -2
- hestia_earth/models/geospatialDatabase/histosol.py +1 -2
- hestia_earth/models/geospatialDatabase/longFallowRatio.py +1 -3
- hestia_earth/models/geospatialDatabase/nutrientLossToAquaticEnvironment.py +1 -2
- hestia_earth/models/geospatialDatabase/organicCarbonPerKgSoil.py +1 -2
- hestia_earth/models/geospatialDatabase/potentialEvapotranspirationAnnual.py +1 -2
- hestia_earth/models/geospatialDatabase/potentialEvapotranspirationLongTermAnnualMean.py +1 -2
- hestia_earth/models/geospatialDatabase/potentialEvapotranspirationMonthly.py +1 -2
- hestia_earth/models/geospatialDatabase/precipitationAnnual.py +1 -2
- hestia_earth/models/geospatialDatabase/precipitationLongTermAnnualMean.py +1 -2
- hestia_earth/models/geospatialDatabase/precipitationMonthly.py +1 -2
- hestia_earth/models/geospatialDatabase/sandContent.py +1 -2
- hestia_earth/models/geospatialDatabase/siltContent.py +1 -2
- hestia_earth/models/geospatialDatabase/slope.py +1 -2
- hestia_earth/models/geospatialDatabase/slopeLength.py +1 -2
- hestia_earth/models/geospatialDatabase/soilPh.py +1 -2
- hestia_earth/models/geospatialDatabase/temperatureAnnual.py +1 -2
- hestia_earth/models/geospatialDatabase/temperatureLongTermAnnualMean.py +1 -2
- hestia_earth/models/geospatialDatabase/temperatureMonthly.py +1 -2
- hestia_earth/models/geospatialDatabase/totalNitrogenPerKgSoil.py +1 -2
- hestia_earth/models/geospatialDatabase/totalPhosphorusPerKgSoil.py +1 -2
- hestia_earth/models/geospatialDatabase/waterDepth.py +1 -2
- hestia_earth/models/hestia/aboveGroundCropResidue.py +1 -2
- hestia_earth/models/hestia/aboveGroundCropResidueTotal.py +1 -6
- hestia_earth/models/hestia/brackishWater.py +1 -2
- hestia_earth/models/hestia/cationExchangeCapacityPerKgSoil.py +1 -2
- hestia_earth/models/hestia/cropResidueManagement.py +1 -2
- hestia_earth/models/hestia/croppingIntensity.py +1 -7
- hestia_earth/models/hestia/default_emissions.py +3 -5
- hestia_earth/models/hestia/default_resourceUse.py +4 -11
- hestia_earth/models/hestia/excretaKgMass.py +9 -6
- hestia_earth/models/hestia/excretaKgN.py +8 -7
- hestia_earth/models/hestia/excretaKgVs.py +8 -7
- hestia_earth/models/hestia/feedConversionRatio/__init__.py +5 -7
- hestia_earth/models/hestia/flowingWater.py +1 -2
- hestia_earth/models/hestia/freshWater.py +1 -2
- hestia_earth/models/hestia/histosol.py +1 -2
- hestia_earth/models/hestia/inorganicFertiliser.py +2 -14
- hestia_earth/models/hestia/irrigatedTypeUnspecified.py +1 -7
- hestia_earth/models/hestia/landCover.py +192 -911
- hestia_earth/models/hestia/landCover_utils.py +769 -0
- hestia_earth/models/hestia/landOccupationDuringCycle.py +1 -2
- hestia_earth/models/hestia/liveAnimal.py +1 -3
- hestia_earth/models/hestia/longFallowRatio.py +1 -7
- hestia_earth/models/hestia/management.py +14 -8
- hestia_earth/models/hestia/materialAndSubstrate.py +1 -2
- hestia_earth/models/hestia/milkYield.py +2 -12
- hestia_earth/models/hestia/netPrimaryProduction.py +1 -2
- hestia_earth/models/hestia/organicCarbonPerHa.py +1 -2
- hestia_earth/models/hestia/pToSurfaceWaterAquacultureSystems.py +2 -4
- hestia_earth/models/hestia/pastureGrass.py +3 -4
- hestia_earth/models/hestia/pastureSystem.py +1 -7
- hestia_earth/models/hestia/potentialEvapotranspirationAnnual.py +1 -2
- hestia_earth/models/hestia/potentialEvapotranspirationMonthly.py +1 -2
- hestia_earth/models/hestia/precipitationAnnual.py +1 -2
- hestia_earth/models/hestia/precipitationMonthly.py +1 -2
- hestia_earth/models/hestia/rainfallAnnual.py +1 -2
- hestia_earth/models/hestia/rainfallMonthly.py +1 -2
- hestia_earth/models/hestia/residueBurnt.py +1 -7
- hestia_earth/models/hestia/residueIncorporated.py +1 -7
- hestia_earth/models/hestia/residueLeftOnField.py +1 -7
- hestia_earth/models/hestia/residueRemoved.py +3 -8
- hestia_earth/models/hestia/resourceUse_utils.py +4 -20
- hestia_earth/models/hestia/salineWater.py +1 -2
- hestia_earth/models/hestia/seed_emissions.py +5 -6
- hestia_earth/models/hestia/slope.py +44 -0
- hestia_earth/models/hestia/slopeLength.py +44 -0
- hestia_earth/models/hestia/soilMeasurement.py +1 -2
- hestia_earth/models/hestia/stockingDensityAnimalHousingAverage.py +1 -7
- hestia_earth/models/hestia/temperatureAnnual.py +1 -2
- hestia_earth/models/hestia/temperatureMonthly.py +1 -2
- hestia_earth/models/hestia/totalNitrogenPerKgSoil.py +1 -2
- hestia_earth/models/hestia/unknownPreSeasonWaterRegime.py +1 -7
- hestia_earth/models/hestia/utils.py +5 -5
- hestia_earth/models/hestia/waterDepth.py +1 -2
- hestia_earth/models/hestia/waterSalinity.py +1 -2
- hestia_earth/models/impact_assessment/emissions.py +8 -9
- hestia_earth/models/impact_assessment/post_checks/cycle.py +1 -1
- hestia_earth/models/impact_assessment/pre_checks/cycle.py +1 -1
- hestia_earth/models/ipcc2006/aboveGroundCropResidueRemoved.py +1 -3
- hestia_earth/models/ipcc2006/aboveGroundCropResidueTotal.py +1 -3
- hestia_earth/models/ipcc2006/belowGroundCropResidue.py +1 -3
- hestia_earth/models/ipcc2006/n2OToAirCropResidueDecompositionDirect.py +2 -6
- hestia_earth/models/ipcc2006/n2OToAirCropResidueDecompositionIndirect.py +1 -2
- hestia_earth/models/ipcc2006/n2OToAirExcretaDirect.py +1 -2
- hestia_earth/models/ipcc2006/n2OToAirExcretaIndirect.py +1 -2
- hestia_earth/models/ipcc2006/n2OToAirInorganicFertiliserDirect.py +1 -2
- hestia_earth/models/ipcc2006/n2OToAirInorganicFertiliserIndirect.py +1 -2
- hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserDirect.py +1 -2
- hestia_earth/models/ipcc2006/n2OToAirOrganicFertiliserIndirect.py +1 -2
- hestia_earth/models/ipcc2013ExcludingFeedbacks/gwp100.py +1 -7
- hestia_earth/models/ipcc2013IncludingFeedbacks/gwp100.py +1 -7
- hestia_earth/models/ipcc2019/aboveGroundBiomass.py +1 -1
- hestia_earth/models/ipcc2019/aboveGroundCropResidueTotal.py +1 -3
- hestia_earth/models/ipcc2019/animal/milkYieldPerAnimal.py +3 -7
- hestia_earth/models/ipcc2019/animal/pastureGrass.py +1 -2
- hestia_earth/models/ipcc2019/belowGroundBiomass.py +1 -1
- hestia_earth/models/ipcc2019/belowGroundCropResidue.py +1 -3
- hestia_earth/models/ipcc2019/biocharOrganicCarbonPerHa.py +1 -1
- hestia_earth/models/ipcc2019/ch4ToAirAquacultureSystems.py +2 -6
- hestia_earth/models/ipcc2019/ch4ToAirEntericFermentation.py +2 -12
- hestia_earth/models/ipcc2019/ch4ToAirExcreta.py +1 -2
- hestia_earth/models/ipcc2019/ch4ToAirFloodedRice.py +2 -10
- hestia_earth/models/ipcc2019/ch4ToAirOrganicSoilCultivation.py +1 -1
- hestia_earth/models/ipcc2019/co2ToAirAboveGroundBiomassStockChange.py +1 -1
- hestia_earth/models/ipcc2019/co2ToAirBelowGroundBiomassStockChange.py +1 -1
- hestia_earth/models/ipcc2019/co2ToAirBiocharStockChange.py +1 -1
- hestia_earth/models/ipcc2019/co2ToAirLimeHydrolysis.py +1 -2
- hestia_earth/models/ipcc2019/co2ToAirOrganicSoilCultivation.py +1 -1
- hestia_earth/models/ipcc2019/co2ToAirSoilOrganicCarbonStockChange.py +1 -1
- hestia_earth/models/ipcc2019/co2ToAirUreaHydrolysis.py +1 -2
- hestia_earth/models/ipcc2019/croppingDuration.py +1 -2
- hestia_earth/models/ipcc2019/n2OToAirCropResidueBurningDirect.py +1 -2
- hestia_earth/models/ipcc2019/n2OToAirCropResidueDecompositionDirect.py +2 -7
- hestia_earth/models/ipcc2019/n2OToAirExcretaDirect.py +1 -2
- hestia_earth/models/ipcc2019/n2OToAirInorganicFertiliserDirect.py +2 -7
- hestia_earth/models/ipcc2019/n2OToAirOrganicFertiliserDirect.py +2 -7
- hestia_earth/models/ipcc2019/n2OToAirOrganicSoilCultivationDirect.py +2 -7
- hestia_earth/models/ipcc2019/n2OToAir_indirect_emissions_utils.py +3 -9
- hestia_earth/models/ipcc2019/nh3ToAirInorganicFertiliser.py +2 -6
- hestia_earth/models/ipcc2019/nh3ToAirOrganicFertiliser.py +2 -6
- hestia_earth/models/ipcc2019/no3ToGroundwaterCropResidueDecomposition.py +2 -7
- hestia_earth/models/ipcc2019/no3ToGroundwaterExcreta.py +2 -8
- hestia_earth/models/ipcc2019/no3ToGroundwaterInorganicFertiliser.py +2 -7
- hestia_earth/models/ipcc2019/no3ToGroundwaterOrganicFertiliser.py +2 -7
- hestia_earth/models/ipcc2019/nonCo2EmissionsToAirNaturalVegetationBurning.py +1 -1
- hestia_earth/models/ipcc2019/noxToAirInorganicFertiliser.py +2 -6
- hestia_earth/models/ipcc2019/noxToAirOrganicFertiliser.py +2 -6
- hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_1.py +1 -1
- hestia_earth/models/ipcc2019/organicCarbonPerHa_tier_2.py +1 -1
- hestia_earth/models/ipcc2019/pastureGrass.py +1 -2
- hestia_earth/models/ipcc2021/gwp100.py +2 -11
- hestia_earth/models/jarvisAndPain1994/n2ToAirExcreta.py +1 -2
- hestia_earth/models/koble2014/utils.py +1 -3
- hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsClimateChange.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsFreshwaterEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsFreshwaterEutrophication.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToFreshwaterEcosystemsWaterStress.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealth.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthClimateChange.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthHumanToxicityCancerogenic.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthHumanToxicityNonCancerogenic.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthParticulateMatterFormation.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthStratosphericOzoneDepletion.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToHumanHealthWaterStress.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToMarineEcosystemsMarineEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToMarineEcosystemsMarineEutrophication.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToMarineEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsClimateChange.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsTerrestrialAcidification.py +1 -7
- hestia_earth/models/lcImpactAllEffects100Years/damageToTerrestrialEcosystemsTerrestrialEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsClimateChange.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsFreshwaterEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsFreshwaterEutrophication.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToFreshwaterEcosystemsWaterStress.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealth.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthClimateChange.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthHumanToxicityCancerogenic.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthHumanToxicityNonCancerogenic.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthParticulateMatterFormation.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthStratosphericOzoneDepletion.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToHumanHealthWaterStress.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToMarineEcosystemsMarineEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToMarineEcosystemsMarineEutrophication.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToMarineEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsClimateChange.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsTerrestrialAcidification.py +1 -7
- hestia_earth/models/lcImpactAllEffectsInfinite/damageToTerrestrialEcosystemsTerrestrialEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToFreshwaterEcosystemsFreshwaterEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToFreshwaterEcosystemsFreshwaterEutrophication.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToFreshwaterEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToFreshwaterEcosystemsWaterStress.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealth.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthClimateChange.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthHumanToxicityCancerogenic.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthHumanToxicityNonCancerogenic.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthParticulateMatterFormation.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthStratosphericOzoneDepletion.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToHumanHealthWaterStress.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToMarineEcosystemsMarineEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToMarineEcosystemsMarineEutrophication.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToMarineEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsClimateChange.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsTerrestrialAcidification.py +1 -7
- hestia_earth/models/lcImpactCertainEffects100Years/damageToTerrestrialEcosystemsTerrestrialEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToFreshwaterEcosystemsFreshwaterEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToFreshwaterEcosystemsFreshwaterEutrophication.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToFreshwaterEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToFreshwaterEcosystemsWaterStress.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealth.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthClimateChange.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthHumanToxicityCancerogenic.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthHumanToxicityNonCancerogenic.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthParticulateMatterFormation.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthStratosphericOzoneDepletion.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToHumanHealthWaterStress.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToMarineEcosystemsMarineEcotoxicity.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToMarineEcosystemsMarineEutrophication.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToMarineEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsClimateChange.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsPdfYear.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsPhotochemicalOzoneFormation.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsTerrestrialAcidification.py +1 -7
- hestia_earth/models/lcImpactCertainEffectsInfinite/damageToTerrestrialEcosystemsTerrestrialEcotoxicity.py +1 -7
- hestia_earth/models/linkedImpactAssessment/emissions.py +4 -6
- hestia_earth/models/linkedImpactAssessment/utils.py +4 -6
- hestia_earth/models/mocking/search-results.json +1 -1
- hestia_earth/models/pooreNemecek2018/aboveGroundCropResidueTotal.py +1 -3
- hestia_earth/models/pooreNemecek2018/belowGroundCropResidue.py +1 -3
- hestia_earth/models/pooreNemecek2018/ch4ToAirAquacultureSystems.py +1 -2
- hestia_earth/models/pooreNemecek2018/excretaKgN.py +3 -4
- hestia_earth/models/pooreNemecek2018/excretaKgVs.py +4 -4
- hestia_earth/models/pooreNemecek2018/freshwaterWithdrawalsDuringCycle.py +3 -9
- hestia_earth/models/pooreNemecek2018/landOccupationDuringCycle.py +3 -7
- hestia_earth/models/pooreNemecek2018/longFallowDuration.py +1 -7
- hestia_earth/models/pooreNemecek2018/n2OToAirAquacultureSystemsDirect.py +1 -2
- hestia_earth/models/pooreNemecek2018/n2ToAirAquacultureSystems.py +1 -2
- hestia_earth/models/pooreNemecek2018/nh3ToAirAquacultureSystems.py +1 -2
- hestia_earth/models/pooreNemecek2018/no3ToGroundwaterCropResidueDecomposition.py +1 -2
- hestia_earth/models/pooreNemecek2018/no3ToGroundwaterExcreta.py +1 -2
- hestia_earth/models/pooreNemecek2018/no3ToGroundwaterInorganicFertiliser.py +1 -2
- hestia_earth/models/pooreNemecek2018/no3ToGroundwaterOrganicFertiliser.py +1 -2
- hestia_earth/models/pooreNemecek2018/no3ToGroundwaterSoilFlux_utils.py +1 -2
- hestia_earth/models/pooreNemecek2018/noxToAirAquacultureSystems.py +1 -2
- hestia_earth/models/pooreNemecek2018/nurseryDensity.py +1 -7
- hestia_earth/models/pooreNemecek2018/nurseryDuration.py +1 -7
- hestia_earth/models/pooreNemecek2018/plantationDensity.py +1 -7
- hestia_earth/models/pooreNemecek2018/plantationLifespan.py +1 -7
- hestia_earth/models/pooreNemecek2018/plantationProductiveLifespan.py +1 -7
- hestia_earth/models/pooreNemecek2018/rotationDuration.py +1 -7
- hestia_earth/models/pooreNemecek2018/saplingsDepreciatedAmountPerCycle.py +1 -7
- hestia_earth/models/poschEtAl2008/terrestrialAcidificationPotentialAccumulatedExceedance.py +1 -7
- hestia_earth/models/poschEtAl2008/terrestrialEutrophicationPotentialAccumulatedExceedance.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/damageToFreshwaterEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/damageToHumanHealth.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/damageToMarineEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/damageToResourceAvailability.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/damageToTerrestrialEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/ecosystemDamageOzoneFormation.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/fossilResourceScarcity.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/freshwaterAquaticEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/freshwaterEutrophicationPotential.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/humanCarcinogenicToxicity.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/humanDamageOzoneFormation.py +2 -10
- hestia_earth/models/recipe2016Egalitarian/humanNonCarcinogenicToxicity.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/marineAquaticEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/marineEutrophicationPotential.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/ozoneDepletionPotential.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/terrestrialAcidificationPotential.py +1 -7
- hestia_earth/models/recipe2016Egalitarian/terrestrialEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/damageToFreshwaterEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/damageToHumanHealth.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/damageToMarineEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/damageToResourceAvailability.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/damageToTerrestrialEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/ecosystemDamageOzoneFormation.py +2 -10
- hestia_earth/models/recipe2016Hierarchist/fossilResourceScarcity.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/freshwaterAquaticEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/freshwaterEutrophicationPotential.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/humanCarcinogenicToxicity.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/humanDamageOzoneFormation.py +2 -10
- hestia_earth/models/recipe2016Hierarchist/humanNonCarcinogenicToxicity.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/marineAquaticEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/marineEutrophicationPotential.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/ozoneDepletionPotential.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/terrestrialAcidificationPotential.py +1 -7
- hestia_earth/models/recipe2016Hierarchist/terrestrialEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Individualist/damageToFreshwaterEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Individualist/damageToHumanHealth.py +1 -7
- hestia_earth/models/recipe2016Individualist/damageToMarineEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Individualist/damageToResourceAvailability.py +1 -7
- hestia_earth/models/recipe2016Individualist/damageToTerrestrialEcosystemsSpeciesYear.py +1 -7
- hestia_earth/models/recipe2016Individualist/ecosystemDamageOzoneFormation.py +2 -10
- hestia_earth/models/recipe2016Individualist/fossilResourceScarcity.py +1 -7
- hestia_earth/models/recipe2016Individualist/freshwaterAquaticEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Individualist/freshwaterEutrophicationPotential.py +1 -7
- hestia_earth/models/recipe2016Individualist/humanCarcinogenicToxicity.py +1 -7
- hestia_earth/models/recipe2016Individualist/humanDamageOzoneFormation.py +2 -10
- hestia_earth/models/recipe2016Individualist/humanNonCarcinogenicToxicity.py +1 -7
- hestia_earth/models/recipe2016Individualist/marineAquaticEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/recipe2016Individualist/marineEutrophicationPotential.py +1 -7
- hestia_earth/models/recipe2016Individualist/ozoneDepletionPotential.py +1 -7
- hestia_earth/models/recipe2016Individualist/terrestrialAcidificationPotential.py +1 -7
- hestia_earth/models/recipe2016Individualist/terrestrialEcotoxicityPotential14Dcbeq.py +1 -7
- hestia_earth/models/resourceUseNotRelevant/__init__.py +2 -8
- hestia_earth/models/schererPfister2015/nErosionSoilFlux.py +1 -2
- hestia_earth/models/schererPfister2015/pErosionSoilFlux.py +1 -2
- hestia_earth/models/schererPfister2015/pToDrainageWaterSoilFlux.py +1 -2
- hestia_earth/models/schererPfister2015/pToGroundwaterSoilFlux.py +1 -2
- hestia_earth/models/schererPfister2015/pToSurfaceWaterSoilFlux.py +1 -2
- hestia_earth/models/schmidt2007/ch4ToAirWasteTreatment.py +1 -2
- hestia_earth/models/schmidt2007/h2SToAirWasteTreatment.py +1 -2
- hestia_earth/models/schmidt2007/n2OToAirWasteTreatmentDirect.py +1 -2
- hestia_earth/models/schmidt2007/nh3ToAirWasteTreatment.py +1 -2
- hestia_earth/models/site/grouped_measurement.py +2 -3
- hestia_earth/models/stehfestBouwman2006/n2OToAirCropResidueDecompositionDirect.py +1 -2
- hestia_earth/models/stehfestBouwman2006/n2OToAirExcretaDirect.py +1 -2
- hestia_earth/models/stehfestBouwman2006/n2OToAirInorganicFertiliserDirect.py +1 -2
- hestia_earth/models/stehfestBouwman2006/n2OToAirOrganicFertiliserDirect.py +1 -2
- hestia_earth/models/stehfestBouwman2006/n2OToAirSoilFlux_utils.py +1 -2
- hestia_earth/models/stehfestBouwman2006/noxToAirCropResidueDecomposition.py +1 -2
- hestia_earth/models/stehfestBouwman2006/noxToAirExcreta.py +1 -2
- hestia_earth/models/stehfestBouwman2006/noxToAirInorganicFertiliser.py +1 -2
- hestia_earth/models/stehfestBouwman2006/noxToAirOrganicFertiliser.py +1 -2
- hestia_earth/models/stehfestBouwman2006/noxToAirSoilFlux_utils.py +1 -2
- hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirCropResidueDecomposition.py +1 -2
- hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirExcreta.py +1 -2
- hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirInorganicFertiliser.py +1 -2
- hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirOrganicFertiliser.py +1 -2
- hestia_earth/models/stehfestBouwman2006GisImplementation/noxToAirSoilFlux_utils.py +1 -2
- hestia_earth/models/transformation/input/excreta.py +7 -5
- hestia_earth/models/transformation/product/excreta.py +4 -4
- hestia_earth/models/usetoxV2/freshwaterEcotoxicityPotentialCtue.py +1 -7
- hestia_earth/models/utils/__init__.py +26 -7
- hestia_earth/models/utils/background_emissions.py +3 -3
- hestia_earth/models/utils/blank_node.py +31 -12
- hestia_earth/models/utils/emission.py +24 -10
- hestia_earth/models/utils/indicator.py +28 -13
- hestia_earth/models/utils/input.py +22 -5
- hestia_earth/models/utils/management.py +18 -4
- hestia_earth/models/utils/measurement.py +14 -6
- hestia_earth/models/utils/practice.py +24 -4
- hestia_earth/models/utils/product.py +32 -14
- hestia_earth/models/version.py +1 -1
- hestia_earth/models/webbEtAl2012AndSintermannEtAl2012/nh3ToAirOrganicFertiliser.py +1 -2
- hestia_earth/orchestrator/models/__init__.py +22 -11
- {hestia_earth_models-0.74.10.dist-info → hestia_earth_models-0.74.12.dist-info}/METADATA +2 -2
- {hestia_earth_models-0.74.10.dist-info → hestia_earth_models-0.74.12.dist-info}/RECORD +410 -404
- tests/models/cml2001Baseline/test_abioticResourceDepletionFossilFuels.py +4 -9
- tests/models/cml2001Baseline/test_abioticResourceDepletionMineralsAndMetals.py +4 -9
- tests/models/environmentalFootprintV3_1/test_environmentalFootprintSingleOverallScore.py +4 -9
- tests/models/environmentalFootprintV3_1/test_marineEutrophicationPotential.py +1 -7
- tests/models/environmentalFootprintV3_1/test_scarcityWeightedWaterUse.py +2 -8
- tests/models/environmentalFootprintV3_1/test_soilQualityIndexLandTransformation.py +3 -13
- tests/models/hestia/test_default_emissions.py +2 -2
- tests/models/hestia/test_default_resourceUse.py +3 -3
- tests/models/hestia/test_landCover.py +42 -295
- tests/models/hestia/test_landCover_utils.py +233 -0
- tests/models/hestia/test_slope.py +23 -0
- tests/models/hestia/test_slopeLength.py +23 -0
- tests/models/ipcc2019/test_no3ToGroundwaterExcreta.py +1 -0
- tests/models/poschEtAl2008/test_terrestrialAcidificationPotentialAccumulatedExceedance.py +4 -9
- tests/models/poschEtAl2008/test_terrestrialEutrophicationPotentialAccumulatedExceedance.py +4 -9
- tests/models/utils/test_indicator.py +6 -4
- tests/models/utils/test_measurement.py +7 -5
- {hestia_earth_models-0.74.10.dist-info → hestia_earth_models-0.74.12.dist-info}/LICENSE +0 -0
- {hestia_earth_models-0.74.10.dist-info → hestia_earth_models-0.74.12.dist-info}/WHEEL +0 -0
- {hestia_earth_models-0.74.10.dist-info → hestia_earth_models-0.74.12.dist-info}/top_level.txt +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
from collections.abc import Iterable
|
|
2
|
-
from typing import Optional, Union
|
|
2
|
+
from typing import Optional, Union, List
|
|
3
3
|
from hestia_earth.schema import EmissionMethodTier, SchemaType, TermTermType
|
|
4
4
|
from hestia_earth.utils.model import linked_node
|
|
5
5
|
from hestia_earth.utils.emission import cycle_emissions_in_system_boundary, emissions_in_system_boundary
|
|
6
6
|
from hestia_earth.utils.term import download_term
|
|
7
7
|
|
|
8
|
-
from . import flatten_args
|
|
8
|
+
from . import flatten_args, set_node_value, set_node_stats, set_node_term
|
|
9
9
|
from .blank_node import find_terms_value
|
|
10
10
|
from .method import include_methodModel
|
|
11
11
|
from .constant import Units, get_atomic_conversion
|
|
@@ -13,14 +13,28 @@ from .constant import Units, get_atomic_conversion
|
|
|
13
13
|
EMISSION_METHOD_TIERS = [e.value for e in EmissionMethodTier]
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
def _new_emission(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
def _new_emission(
|
|
17
|
+
term: Union[dict, str],
|
|
18
|
+
value: List[Optional[float]] = None,
|
|
19
|
+
sd: float = None,
|
|
20
|
+
min: float = None,
|
|
21
|
+
max: float = None,
|
|
22
|
+
model: Optional[Union[dict, str]] = None,
|
|
23
|
+
country_id: str = None,
|
|
24
|
+
key_id: str = None
|
|
25
|
+
):
|
|
26
|
+
return set_node_stats(
|
|
27
|
+
include_methodModel({
|
|
28
|
+
'@type': SchemaType.EMISSION.value,
|
|
29
|
+
'term': linked_node(term if isinstance(term, dict) else download_term(term))
|
|
30
|
+
}, model) |
|
|
31
|
+
set_node_value('value', value, is_list=True) |
|
|
32
|
+
(set_node_value('sd', sd, is_list=True) if sd is not None else {}) |
|
|
33
|
+
set_node_value('min', min, is_list=True) |
|
|
34
|
+
set_node_value('max', max, is_list=True) |
|
|
35
|
+
set_node_term('country', country_id, TermTermType.REGION) |
|
|
36
|
+
set_node_term('key', key_id)
|
|
37
|
+
)
|
|
24
38
|
|
|
25
39
|
|
|
26
40
|
def get_nh3_no3_nox_to_n(cycle: dict, nh3_term_id: str = None, no3_term_id: str = None, nox_term_id: str = None):
|
|
@@ -1,22 +1,37 @@
|
|
|
1
|
+
from typing import Union, Optional
|
|
1
2
|
from hestia_earth.schema import SchemaType, TermTermType
|
|
2
3
|
from hestia_earth.utils.model import linked_node
|
|
3
4
|
from hestia_earth.utils.term import download_term
|
|
4
5
|
|
|
6
|
+
from . import set_node_value, set_node_term, set_node_stats
|
|
5
7
|
from .method import include_methodModel
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
def _new_indicator(
|
|
9
|
-
term: dict,
|
|
10
|
-
|
|
11
|
+
term: Union[dict, str],
|
|
12
|
+
value: float,
|
|
13
|
+
sd: float = None,
|
|
14
|
+
min: float = None,
|
|
15
|
+
max: float = None,
|
|
16
|
+
inputs: list = None,
|
|
17
|
+
model: Optional[Union[dict, str]] = None,
|
|
18
|
+
land_cover_id: str = None,
|
|
19
|
+
previous_land_cover_id: str = None,
|
|
20
|
+
country_id: str = None,
|
|
21
|
+
key_id: str = None
|
|
11
22
|
):
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
return set_node_stats(
|
|
24
|
+
include_methodModel({
|
|
25
|
+
'@type': SchemaType.INDICATOR.value,
|
|
26
|
+
'term': linked_node(term if isinstance(term, dict) else download_term(term))
|
|
27
|
+
}, model) |
|
|
28
|
+
set_node_value('value', value) |
|
|
29
|
+
set_node_value('sd', sd) |
|
|
30
|
+
set_node_value('min', min) |
|
|
31
|
+
set_node_value('max', max) |
|
|
32
|
+
(set_node_value('inputs', inputs) if inputs else {}) |
|
|
33
|
+
set_node_term('landCover', land_cover_id, TermTermType.LANDCOVER) |
|
|
34
|
+
set_node_term('previousLandCover', previous_land_cover_id, TermTermType.LANDCOVER) |
|
|
35
|
+
set_node_term('country', country_id, TermTermType.REGION) |
|
|
36
|
+
set_node_term('key', key_id)
|
|
37
|
+
) if value is not None else None # cannot return an indicator without a value
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from typing import Union, Optional, List
|
|
1
2
|
from hestia_earth.schema import SchemaType, TermTermType
|
|
2
3
|
from hestia_earth.utils.model import find_term_match, linked_node, filter_list_term_type
|
|
3
4
|
from hestia_earth.utils.tools import list_sum, non_empty_list, list_average, flatten
|
|
@@ -5,16 +6,32 @@ from hestia_earth.utils.lookup import download_lookup, get_table_value, column_n
|
|
|
5
6
|
from hestia_earth.utils.term import download_term
|
|
6
7
|
|
|
7
8
|
from hestia_earth.models.log import logger
|
|
8
|
-
from . import
|
|
9
|
+
from . import (
|
|
10
|
+
_filter_list_term_unit, _load_calculated_node, group_by, set_node_value, set_node_stats
|
|
11
|
+
)
|
|
9
12
|
from .constant import Units
|
|
10
13
|
from .blank_node import get_total_value, get_total_value_converted, get_lookup_value
|
|
11
14
|
from .method import include_model
|
|
12
15
|
|
|
13
16
|
|
|
14
|
-
def _new_input(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
def _new_input(
|
|
18
|
+
term: Union[dict, str],
|
|
19
|
+
value: List[Optional[float]] = None,
|
|
20
|
+
sd: float = None,
|
|
21
|
+
min: float = None,
|
|
22
|
+
max: float = None,
|
|
23
|
+
model: Optional[Union[dict, str]] = None,
|
|
24
|
+
):
|
|
25
|
+
return set_node_stats(
|
|
26
|
+
include_model({
|
|
27
|
+
'@type': SchemaType.INPUT.value,
|
|
28
|
+
'term': linked_node(term if isinstance(term, dict) else download_term(term))
|
|
29
|
+
}, model) |
|
|
30
|
+
set_node_value('value', value, is_list=True) |
|
|
31
|
+
(set_node_value('sd', sd, is_list=True) if sd is not None else {}) |
|
|
32
|
+
set_node_value('min', min, is_list=True) |
|
|
33
|
+
set_node_value('max', max, is_list=True)
|
|
34
|
+
)
|
|
18
35
|
|
|
19
36
|
|
|
20
37
|
def load_impacts(inputs: list):
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
+
from typing import Union, Optional, List
|
|
1
2
|
from hestia_earth.schema import SchemaType
|
|
2
3
|
from hestia_earth.utils.model import linked_node
|
|
3
4
|
from hestia_earth.utils.term import download_term
|
|
4
5
|
|
|
6
|
+
from . import set_node_value
|
|
5
7
|
from .method import include_model
|
|
6
8
|
|
|
7
9
|
|
|
8
|
-
def _new_management(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
def _new_management(
|
|
11
|
+
term: Union[dict, str],
|
|
12
|
+
value: Optional[Union[float, List[float]]] = None,
|
|
13
|
+
model: Optional[Union[dict, str]] = None,
|
|
14
|
+
end_date: str = None,
|
|
15
|
+
start_date: str = None
|
|
16
|
+
):
|
|
17
|
+
return (
|
|
18
|
+
include_model({
|
|
19
|
+
'@type': SchemaType.MANAGEMENT.value,
|
|
20
|
+
'term': linked_node(term if isinstance(term, dict) else download_term(term))
|
|
21
|
+
}, model) |
|
|
22
|
+
set_node_value('value', value) |
|
|
23
|
+
set_node_value('endDate', end_date) |
|
|
24
|
+
set_node_value('startDate', start_date)
|
|
25
|
+
)
|
|
@@ -2,14 +2,14 @@ from collections import defaultdict
|
|
|
2
2
|
from collections.abc import Iterable
|
|
3
3
|
from functools import reduce
|
|
4
4
|
from statistics import mode, mean
|
|
5
|
-
from typing import Any, Optional, Union
|
|
5
|
+
from typing import Any, Optional, Union, List
|
|
6
6
|
from hestia_earth.schema import MeasurementMethodClassification, SchemaType, TermTermType
|
|
7
7
|
from hestia_earth.utils.model import linked_node, filter_list_term_type
|
|
8
8
|
from hestia_earth.utils.tools import non_empty_list, flatten, safe_parse_float, list_sum
|
|
9
9
|
from hestia_earth.utils.date import diff_in_days
|
|
10
10
|
from hestia_earth.utils.term import download_term
|
|
11
11
|
|
|
12
|
-
from . import flatten_args
|
|
12
|
+
from . import flatten_args, set_node_value
|
|
13
13
|
from .blank_node import most_relevant_blank_node_by_id
|
|
14
14
|
from .method import include_method
|
|
15
15
|
from .term import get_lookup_value
|
|
@@ -27,10 +27,18 @@ MEASUREMENT_REDUCE = {
|
|
|
27
27
|
MEASUREMENT_METHOD_CLASSIFICATIONS = [e.value for e in MeasurementMethodClassification]
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
def _new_measurement(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
def _new_measurement(
|
|
31
|
+
term: Union[dict, str],
|
|
32
|
+
value: List[Union[float, bool]] = None,
|
|
33
|
+
model: Optional[Union[dict, str]] = None
|
|
34
|
+
):
|
|
35
|
+
return (
|
|
36
|
+
include_method({
|
|
37
|
+
'@type': SchemaType.MEASUREMENT.value,
|
|
38
|
+
'term': linked_node(term if isinstance(term, dict) else download_term(term))
|
|
39
|
+
}, model) |
|
|
40
|
+
set_node_value('value', value, is_list=True)
|
|
41
|
+
)
|
|
34
42
|
|
|
35
43
|
|
|
36
44
|
def measurement_value(measurement: dict, is_larger_unit: bool = False, default=None) -> float:
|
|
@@ -1,11 +1,31 @@
|
|
|
1
|
+
from typing import Union, Optional, List
|
|
1
2
|
from hestia_earth.schema import SchemaType
|
|
2
3
|
from hestia_earth.utils.model import linked_node
|
|
3
4
|
from hestia_earth.utils.term import download_term
|
|
4
5
|
|
|
6
|
+
from . import set_node_value, set_node_stats
|
|
5
7
|
from .method import include_model
|
|
6
8
|
|
|
7
9
|
|
|
8
|
-
def _new_practice(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
def _new_practice(
|
|
11
|
+
term: Union[dict, str],
|
|
12
|
+
value: Optional[Union[float, List[float]]] = None,
|
|
13
|
+
sd: float = None,
|
|
14
|
+
min: float = None,
|
|
15
|
+
max: float = None,
|
|
16
|
+
model: Optional[Union[dict, str]] = None,
|
|
17
|
+
end_date: str = None,
|
|
18
|
+
start_date: str = None
|
|
19
|
+
):
|
|
20
|
+
return set_node_stats(
|
|
21
|
+
include_model({
|
|
22
|
+
'@type': SchemaType.PRACTICE.value,
|
|
23
|
+
'term': linked_node(term if isinstance(term, dict) else download_term(term))
|
|
24
|
+
}, model) |
|
|
25
|
+
set_node_value('value', value, is_list=True) |
|
|
26
|
+
(set_node_value('sd', sd, is_list=True) if sd is not None else {}) |
|
|
27
|
+
set_node_value('min', min, is_list=True) |
|
|
28
|
+
set_node_value('max', max, is_list=True) |
|
|
29
|
+
set_node_value('endDate', end_date) |
|
|
30
|
+
set_node_value('startDate', start_date)
|
|
31
|
+
)
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
from typing import Union, Optional, List
|
|
1
2
|
from hestia_earth.schema import SchemaType, TermTermType, UNIQUENESS_FIELDS
|
|
2
3
|
from hestia_earth.utils.model import filter_list_term_type, find_term_match, linked_node
|
|
3
4
|
from hestia_earth.utils.tools import flatten, list_sum, non_empty_list, get_dict_key
|
|
4
5
|
from hestia_earth.utils.term import download_term
|
|
5
6
|
|
|
7
|
+
from . import set_node_value, set_node_stats
|
|
6
8
|
from .blank_node import get_total_value, get_total_value_converted
|
|
7
9
|
from .constant import Units
|
|
8
10
|
from .currency import DEFAULT_CURRENCY
|
|
@@ -11,16 +13,28 @@ from .term import get_rice_paddy_terms
|
|
|
11
13
|
from .method import include_model
|
|
12
14
|
|
|
13
15
|
|
|
14
|
-
def _new_product(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
def _new_product(
|
|
17
|
+
term: Union[dict, str],
|
|
18
|
+
value: Optional[Union[float, List[float]]] = None,
|
|
19
|
+
sd: float = None,
|
|
20
|
+
min: float = None,
|
|
21
|
+
max: float = None,
|
|
22
|
+
model: Optional[Union[dict, str]] = None,
|
|
23
|
+
):
|
|
24
|
+
return set_node_stats(
|
|
25
|
+
include_model({
|
|
26
|
+
'@type': SchemaType.PRODUCT.value,
|
|
27
|
+
'term': linked_node(term if isinstance(term, dict) else download_term(term))
|
|
28
|
+
}, model) |
|
|
29
|
+
set_node_value('value', value, is_list=True) |
|
|
30
|
+
(set_node_value('sd', sd, is_list=True) if sd is not None else {}) |
|
|
31
|
+
set_node_value('min', min, is_list=True) |
|
|
32
|
+
set_node_value('max', max, is_list=True)
|
|
33
|
+
) | ({
|
|
34
|
+
'economicValueShare': 0,
|
|
35
|
+
'revenue': 0,
|
|
36
|
+
'currency': DEFAULT_CURRENCY
|
|
37
|
+
} if value == 0 else {})
|
|
24
38
|
|
|
25
39
|
|
|
26
40
|
def _match_list_el(source: list, dest: list, key: str):
|
|
@@ -320,16 +334,20 @@ PRODUCT_UNITS_CONVERSIONS = {
|
|
|
320
334
|
}
|
|
321
335
|
|
|
322
336
|
|
|
323
|
-
def convert_product_to_unit(product: dict, dest_unit: Units):
|
|
337
|
+
def convert_product_to_unit(product: dict, dest_unit: Units, **log_args):
|
|
324
338
|
from_units = product.get('term', {}).get('units')
|
|
325
339
|
to_units = dest_unit if isinstance(dest_unit, str) else dest_unit.value
|
|
326
340
|
conversions = PRODUCT_UNITS_CONVERSIONS.get(from_units, {}).get(to_units)
|
|
327
341
|
return None if len(product.get('value', [])) == 0 else 0 if conversions is None else list_sum(
|
|
328
342
|
flatten([
|
|
329
|
-
get_total_value_converted([product], properties, multiply
|
|
343
|
+
get_total_value_converted([product], properties, multiply, **log_args)
|
|
344
|
+
for properties, multiply in conversions
|
|
330
345
|
]) if len(conversions) > 0 else get_total_value([product])
|
|
331
346
|
)
|
|
332
347
|
|
|
333
348
|
|
|
334
|
-
def liveweight_produced(products: list):
|
|
335
|
-
return list_sum([
|
|
349
|
+
def liveweight_produced(products: list, **log_args):
|
|
350
|
+
return list_sum([
|
|
351
|
+
convert_product_to_unit(product=p, dest_unit=Units.KG_LIVEWEIGHT, **log_args)
|
|
352
|
+
for p in products
|
|
353
|
+
])
|
hestia_earth/models/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
VERSION = '0.74.
|
|
1
|
+
VERSION = '0.74.12'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
from typing import Union, List
|
|
2
|
+
import sys
|
|
3
|
+
from typing import Union, List, Optional
|
|
5
4
|
import importlib
|
|
6
5
|
from functools import reduce
|
|
7
6
|
import concurrent.futures
|
|
@@ -16,15 +15,27 @@ from hestia_earth.orchestrator.strategies.merge import merge
|
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
def _memory_usage():
|
|
19
|
-
|
|
20
|
-
1024
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
try:
|
|
19
|
+
factor = 1024 * (
|
|
20
|
+
1024 if sys.platform in ['darwin', 'win32'] else 1
|
|
21
|
+
)
|
|
22
|
+
if sys.platform == "win32":
|
|
23
|
+
import psutil
|
|
24
|
+
return psutil.Process(os.getpid()).memory_info().peak_wset / factor
|
|
25
|
+
else:
|
|
26
|
+
# Fallback to resource library from psutil
|
|
27
|
+
# https://psutil.readthedocs.io/en/latest/#psutil.Process.memory_info
|
|
28
|
+
import resource
|
|
29
|
+
return resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / factor
|
|
30
|
+
except Exception:
|
|
31
|
+
# skip resource cannot be computed
|
|
32
|
+
return 0
|
|
23
33
|
|
|
24
34
|
|
|
25
35
|
def _max_workers(type: str):
|
|
26
36
|
try:
|
|
27
|
-
|
|
37
|
+
max_workers_str = os.getenv(f"MAX_WORKERS_{type.upper()}")
|
|
38
|
+
return int(max_workers_str) if max_workers_str is not None else None
|
|
28
39
|
except Exception:
|
|
29
40
|
return None
|
|
30
41
|
|
|
@@ -51,7 +62,7 @@ def _list_except_item(list, item):
|
|
|
51
62
|
return list[:idx] + list[idx+1:]
|
|
52
63
|
|
|
53
64
|
|
|
54
|
-
def _filter_models_stage(models: list, stage: Union[int, List[int]] = None):
|
|
65
|
+
def _filter_models_stage(models: list, stage: Optional[Union[int, List[int]]] = None):
|
|
55
66
|
stages = stage if isinstance(stage, list) else [stage] if stage is not None else None
|
|
56
67
|
return models if stage is None else non_empty_list([
|
|
57
68
|
(_filter_models_stage(m, stage) if isinstance(m, list) else m) for m in models if (
|
|
@@ -140,7 +151,7 @@ def _run(data: dict, model: dict, all_models: list):
|
|
|
140
151
|
return _run_model(data, model, all_models) if should_run(data, model) else None
|
|
141
152
|
|
|
142
153
|
|
|
143
|
-
def _run_serie(data: dict, models: list, stage: Union[int, List[int]] = None):
|
|
154
|
+
def _run_serie(data: dict, models: list, stage: Optional[Union[int, List[int]]] = None):
|
|
144
155
|
return reduce(
|
|
145
156
|
lambda prev, m: merge(
|
|
146
157
|
prev, _run_parallel(prev, m, models) if isinstance(m, list) else [_run(_node_copy(prev), m, models)]
|
|
@@ -163,7 +174,7 @@ def _run_parallel(data: dict, model: list, all_models: list):
|
|
|
163
174
|
return results
|
|
164
175
|
|
|
165
176
|
|
|
166
|
-
def run(data: dict, models: list, stage: Union[int, List[int]] = None):
|
|
177
|
+
def run(data: dict, models: list, stage: Optional[Union[int, List[int]]] = None):
|
|
167
178
|
# make sure we reset before recalculating the node
|
|
168
179
|
reset_index()
|
|
169
180
|
# run pre-checks if exist
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hestia-earth-models
|
|
3
|
-
Version: 0.74.
|
|
3
|
+
Version: 0.74.12
|
|
4
4
|
Summary: HESTIA's set of modules for filling gaps in the activity data using external datasets (e.g. populating soil properties with a geospatial dataset using provided coordinates) and internal lookups (e.g. populating machinery use from fuel use). Includes rules for when gaps should be filled versus not (e.g. never gap fill yield, gap fill crop residue if yield provided etc.).
|
|
5
5
|
Home-page: https://gitlab.com/hestia-earth/hestia-engine-models
|
|
6
6
|
Author: HESTIA Team
|
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3.6
|
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: hestia-earth-schema<34.0.0,>=33.5.0
|
|
15
|
-
Requires-Dist: hestia-earth-utils>=0.15.
|
|
15
|
+
Requires-Dist: hestia-earth-utils>=0.15.12
|
|
16
16
|
Requires-Dist: CurrencyConverter==0.16.8
|
|
17
17
|
Requires-Dist: haversine>=2.7.0
|
|
18
18
|
Requires-Dist: pydash
|