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
|
@@ -66,9 +66,8 @@ class SiteData(NamedTuple):
|
|
|
66
66
|
|
|
67
67
|
def _indicator(term_id: str, value: float, land_cover_id: str, country_id: str):
|
|
68
68
|
indicator = _new_indicator(
|
|
69
|
-
term_id, model=MODEL, land_cover_id=land_cover_id, country_id=country_id
|
|
69
|
+
term=term_id, model=MODEL, value=value, land_cover_id=land_cover_id, country_id=country_id
|
|
70
70
|
)
|
|
71
|
-
indicator['value'] = round(value, 6)
|
|
72
71
|
return indicator
|
|
73
72
|
|
|
74
73
|
|
|
@@ -45,9 +45,7 @@ MODEL_KEY = 'liveAnimal'
|
|
|
45
45
|
VALID_SITE_TYPES = [SiteSiteType.ANIMAL_HOUSING.value, SiteSiteType.PERMANENT_PASTURE.value]
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
def _product(
|
|
49
|
-
product = _new_product(term, value, MODEL)
|
|
50
|
-
return product
|
|
48
|
+
def _product(term_id: str, value: float = None): return _new_product(term=term_id, model=MODEL, value=value)
|
|
51
49
|
|
|
52
50
|
|
|
53
51
|
def _run(term_id: str, product_value: dict, propertyPerHead: float):
|
|
@@ -21,15 +21,9 @@ RETURNS = {
|
|
|
21
21
|
TERM_ID = 'longFallowRatio'
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
def _practice(value: float):
|
|
25
|
-
practice = _new_practice(TERM_ID, MODEL)
|
|
26
|
-
practice['value'] = [round(value, 7)]
|
|
27
|
-
return practice
|
|
28
|
-
|
|
29
|
-
|
|
30
24
|
def _run(longFallowDuration: float, rotationDuration: float):
|
|
31
25
|
value = rotationDuration / (rotationDuration - longFallowDuration)
|
|
32
|
-
return [
|
|
26
|
+
return [_new_practice(term=TERM_ID, model=MODEL, value=value)]
|
|
33
27
|
|
|
34
28
|
|
|
35
29
|
def _should_run(cycle: dict):
|
|
@@ -3,11 +3,11 @@ from datetime import timedelta, datetime
|
|
|
3
3
|
from hestia_earth.schema import SchemaType, TermTermType, COMPLETENESS_MAPPING
|
|
4
4
|
from hestia_earth.utils.lookup import column_name, get_table_value, download_lookup
|
|
5
5
|
from hestia_earth.utils.model import filter_list_term_type
|
|
6
|
-
from hestia_earth.utils.tools import safe_parse_float, flatten, is_number, is_boolean
|
|
6
|
+
from hestia_earth.utils.tools import safe_parse_float, flatten, is_number, is_boolean, pick
|
|
7
7
|
from hestia_earth.utils.blank_node import get_node_value
|
|
8
8
|
|
|
9
9
|
from hestia_earth.models.log import logRequirements, logShouldRun, log_as_table
|
|
10
|
-
from hestia_earth.models.utils import
|
|
10
|
+
from hestia_earth.models.utils import group_by
|
|
11
11
|
from hestia_earth.models.utils.management import _new_management
|
|
12
12
|
from hestia_earth.models.utils.term import get_lookup_value
|
|
13
13
|
from hestia_earth.models.utils.blank_node import condense_nodes, DatestrFormat, _gapfill_datestr, DatestrGapfillMode
|
|
@@ -93,11 +93,17 @@ _PRACTICES_COMPLETENESS_MAPPING = COMPLETENESS_MAPPING.get(SchemaType.PRACTICE.v
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
def management(data: dict):
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
start_date = (
|
|
97
|
+
_gap_filled_date_only_str(date_str=data['startDate'], mode=DatestrGapfillMode.START) if data.get('startDate')
|
|
98
|
+
else None
|
|
99
|
+
)
|
|
100
|
+
node = _new_management(
|
|
101
|
+
term=data.get('id'),
|
|
102
|
+
model=MODEL,
|
|
103
|
+
value=data['value'],
|
|
104
|
+
end_date=_gap_filled_date_only_str(data['endDate']),
|
|
105
|
+
start_date=start_date
|
|
106
|
+
)
|
|
101
107
|
if data.get('properties'):
|
|
102
108
|
node['properties'] = data['properties']
|
|
103
109
|
return node
|
|
@@ -186,7 +192,7 @@ def _get_relevant_items(cycle: dict, item_name: str, term_types: List[TermTermTy
|
|
|
186
192
|
blank_nodes = filter_list_term_type(cycle.get(item_name, []), complete_term_types)
|
|
187
193
|
return [
|
|
188
194
|
_include_with_date_gap_fill(cycle, ["startDate", "endDate"]) |
|
|
189
|
-
|
|
195
|
+
pick(
|
|
190
196
|
_gap_filled_start_date(
|
|
191
197
|
cycle=cycle,
|
|
192
198
|
end_date=item.get("endDate") if "endDate" in item else cycle.get("endDate", ""),
|
|
@@ -53,8 +53,7 @@ _SIGNIFICANT_DIGITS = 5
|
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
def _input(term_id: str, value: float, stats: dict) -> dict:
|
|
56
|
-
node = _new_input(term_id + _ID_SUFFIX, MODEL)
|
|
57
|
-
node['value'] = [value]
|
|
56
|
+
node = _new_input(term=term_id + _ID_SUFFIX, model=MODEL, value=value)
|
|
58
57
|
return node | stats
|
|
59
58
|
|
|
60
59
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from hestia_earth.schema import TermTermType, SiteSiteType
|
|
1
|
+
from hestia_earth.schema import TermTermType, SiteSiteType
|
|
2
2
|
from hestia_earth.utils.model import filter_list_term_type, find_term_match
|
|
3
3
|
from hestia_earth.utils.tools import list_sum
|
|
4
4
|
|
|
@@ -51,19 +51,9 @@ VALID_SITE_TYPES = [
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
def practice(term_id: str, value: float, properties: list, sd: float = None, min: float = None, max: float = None):
|
|
54
|
-
data = _new_practice(term_id, MODEL)
|
|
55
|
-
data['value'] = [round(value, 2)]
|
|
54
|
+
data = _new_practice(term=term_id, model=MODEL, value=value, sd=sd, min=min, max=max)
|
|
56
55
|
if properties:
|
|
57
56
|
data['properties'] = properties
|
|
58
|
-
if sd is not None:
|
|
59
|
-
data['sd'] = [round(sd, 2)]
|
|
60
|
-
data['statsDefinition'] = PracticeStatsDefinition.MODELLED.value
|
|
61
|
-
if min is not None:
|
|
62
|
-
data['min'] = [round(min, 2)]
|
|
63
|
-
data['statsDefinition'] = PracticeStatsDefinition.MODELLED.value
|
|
64
|
-
if max is not None:
|
|
65
|
-
data['max'] = [round(max, 2)]
|
|
66
|
-
data['statsDefinition'] = PracticeStatsDefinition.MODELLED.value
|
|
67
57
|
return data
|
|
68
58
|
|
|
69
59
|
|
|
@@ -24,8 +24,7 @@ NPP_Aqua = {TemperatureLevel.LOW: 2, TemperatureLevel.MEDIUM: 4, TemperatureLeve
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
def _measurement(site: dict, value: float):
|
|
27
|
-
data = _new_measurement(TERM_ID, MODEL)
|
|
28
|
-
data['value'] = [value]
|
|
27
|
+
data = _new_measurement(term=TERM_ID, model=MODEL, value=value)
|
|
29
28
|
data['methodClassification'] = MeasurementMethodClassification.MODELLED_USING_OTHER_MEASUREMENTS.value
|
|
30
29
|
return data | get_source(site, BIBLIO_TITLE)
|
|
31
30
|
|
|
@@ -64,8 +64,7 @@ VALID_MEASUREMENT_METHOD_CLASSIFICATIONS = {
|
|
|
64
64
|
def _measurement(
|
|
65
65
|
site: dict, value: float, depthUpper: Union[int, float], depthLower: Union[int, float], date: Optional[str] = None
|
|
66
66
|
) -> dict:
|
|
67
|
-
data = _new_measurement(TERM_ID, MODEL)
|
|
68
|
-
data['value'] = [value]
|
|
67
|
+
data = _new_measurement(term=TERM_ID, model=MODEL, value=value)
|
|
69
68
|
data['depthUpper'] = int(depthUpper)
|
|
70
69
|
data['depthLower'] = int(depthLower)
|
|
71
70
|
data['methodClassification'] = MeasurementMethodClassification.MODELLED_USING_OTHER_MEASUREMENTS.value
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from hestia_earth.schema import EmissionMethodTier,
|
|
1
|
+
from hestia_earth.schema import EmissionMethodTier, TermTermType
|
|
2
2
|
from hestia_earth.utils.model import filter_list_term_type
|
|
3
3
|
from hestia_earth.utils.tools import list_sum, non_empty_list
|
|
4
4
|
|
|
@@ -70,9 +70,7 @@ TIER = EmissionMethodTier.TIER_1.value
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
def _emission(value: float):
|
|
73
|
-
emission = _new_emission(TERM_ID, MODEL)
|
|
74
|
-
emission['value'] = [value]
|
|
75
|
-
emission['statsDefinition'] = EmissionStatsDefinition.MODELLED.value
|
|
73
|
+
emission = _new_emission(term=TERM_ID, model=MODEL, value=value)
|
|
76
74
|
emission['methodTier'] = TIER
|
|
77
75
|
return emission
|
|
78
76
|
|
|
@@ -25,10 +25,9 @@ KEY_TERM_ID = 'genericGrassPlant'
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def _practice():
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return node
|
|
28
|
+
practice = _new_practice(term=TERM_ID, model=MODEL, value=100)
|
|
29
|
+
practice['key'] = linked_node(download_term(KEY_TERM_ID, TermTermType.LANDCOVER))
|
|
30
|
+
return practice
|
|
32
31
|
|
|
33
32
|
|
|
34
33
|
def _should_run(cycle: dict):
|
|
@@ -32,12 +32,6 @@ MODEL_KEY = 'pastureSystem'
|
|
|
32
32
|
VALID_SITE_TYPES = [SiteSiteType.PERMANENT_PASTURE.value]
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
def _practice(term_id: str):
|
|
36
|
-
practice = _new_practice(term_id, MODEL)
|
|
37
|
-
practice['value'] = [100]
|
|
38
|
-
return practice
|
|
39
|
-
|
|
40
|
-
|
|
41
35
|
def _run(cycle: dict):
|
|
42
36
|
end_date = cycle.get('endDate')
|
|
43
37
|
measurements = cycle.get('site', {}).get('measurements', [])
|
|
@@ -48,7 +42,7 @@ def _run(cycle: dict):
|
|
|
48
42
|
slope=slope)
|
|
49
43
|
logShouldRun(cycle, MODEL, term_id, True)
|
|
50
44
|
|
|
51
|
-
return [
|
|
45
|
+
return [_new_practice(term=term_id, model=MODEL, value=100)]
|
|
52
46
|
|
|
53
47
|
|
|
54
48
|
def _should_run(cycle: dict):
|
|
@@ -26,8 +26,7 @@ MEASUREMENT_ID = 'potentialEvapotranspirationMonthly'
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def _measurement(value: float, start_date: str, end_date: str):
|
|
29
|
-
data = _new_measurement(TERM_ID, MODEL)
|
|
30
|
-
data['value'] = [value]
|
|
29
|
+
data = _new_measurement(term=TERM_ID, model=MODEL, value=value)
|
|
31
30
|
data['startDate'] = start_date
|
|
32
31
|
data['endDate'] = end_date
|
|
33
32
|
data['methodClassification'] = MeasurementMethodClassification.MODELLED_USING_OTHER_MEASUREMENTS.value
|
|
@@ -25,8 +25,7 @@ MEASUREMENT_ID = 'potentialEvapotranspirationDaily'
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def _measurement(value: list, dates: list):
|
|
28
|
-
data = _new_measurement(TERM_ID, MODEL)
|
|
29
|
-
data['value'] = value
|
|
28
|
+
data = _new_measurement(term=TERM_ID, model=MODEL, value=value)
|
|
30
29
|
data['dates'] = dates
|
|
31
30
|
data['methodClassification'] = MeasurementMethodClassification.MODELLED_USING_OTHER_MEASUREMENTS.value
|
|
32
31
|
return data
|
|
@@ -26,8 +26,7 @@ MEASUREMENT_ID = 'precipitationMonthly'
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def _measurement(value: float, start_date: str, end_date: str):
|
|
29
|
-
data = _new_measurement(TERM_ID, MODEL)
|
|
30
|
-
data['value'] = [value]
|
|
29
|
+
data = _new_measurement(term=TERM_ID, model=MODEL, value=value)
|
|
31
30
|
data['startDate'] = start_date
|
|
32
31
|
data['endDate'] = end_date
|
|
33
32
|
data['methodClassification'] = MeasurementMethodClassification.MODELLED_USING_OTHER_MEASUREMENTS.value
|
|
@@ -25,8 +25,7 @@ MEASUREMENT_ID = 'precipitationDaily'
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def _measurement(value: list, dates: list):
|
|
28
|
-
data = _new_measurement(TERM_ID, MODEL)
|
|
29
|
-
data['value'] = value
|
|
28
|
+
data = _new_measurement(term=TERM_ID, model=MODEL, value=value)
|
|
30
29
|
data['dates'] = dates
|
|
31
30
|
data['methodClassification'] = MeasurementMethodClassification.MODELLED_USING_OTHER_MEASUREMENTS.value
|
|
32
31
|
return data
|
|
@@ -26,8 +26,7 @@ MEASUREMENT_ID = 'rainfallMonthly'
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def _measurement(value: float, start_date: str, end_date: str):
|
|
29
|
-
data = _new_measurement(TERM_ID, MODEL)
|
|
30
|
-
data['value'] = [value]
|
|
29
|
+
data = _new_measurement(term=TERM_ID, model=MODEL, value=value)
|
|
31
30
|
data['startDate'] = start_date
|
|
32
31
|
data['endDate'] = end_date
|
|
33
32
|
data['methodClassification'] = MeasurementMethodClassification.MODELLED_USING_OTHER_MEASUREMENTS.value
|
|
@@ -25,8 +25,7 @@ MEASUREMENT_ID = 'rainfallDaily'
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def _measurement(value: list, dates: list):
|
|
28
|
-
data = _new_measurement(TERM_ID, MODEL)
|
|
29
|
-
data['value'] = value
|
|
28
|
+
data = _new_measurement(term=TERM_ID, model=MODEL, value=value)
|
|
30
29
|
data['dates'] = dates
|
|
31
30
|
data['methodClassification'] = MeasurementMethodClassification.MODELLED_USING_OTHER_MEASUREMENTS.value
|
|
32
31
|
return data
|
|
@@ -24,12 +24,6 @@ RETURNS = {
|
|
|
24
24
|
TERM_ID = 'residueBurnt'
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
def _practice(value: float):
|
|
28
|
-
practice = _new_practice(TERM_ID, MODEL)
|
|
29
|
-
practice['value'] = [value]
|
|
30
|
-
return practice
|
|
31
|
-
|
|
32
|
-
|
|
33
27
|
def _should_run(cycle: dict):
|
|
34
28
|
crop_residue_incomplete = _is_term_type_incomplete(cycle, TermTermType.CROPRESIDUE)
|
|
35
29
|
products = cycle.get('products', [])
|
|
@@ -50,4 +44,4 @@ def _should_run(cycle: dict):
|
|
|
50
44
|
|
|
51
45
|
def run(cycle: dict):
|
|
52
46
|
should_run, total, value = _should_run(cycle)
|
|
53
|
-
return [
|
|
47
|
+
return [_new_practice(term=TERM_ID, model=MODEL, value=value / total * 100)] if should_run else []
|
|
@@ -34,12 +34,6 @@ RETURNS = {
|
|
|
34
34
|
TERM_ID = 'residueIncorporated'
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
def _practice(value: float):
|
|
38
|
-
practice = _new_practice(TERM_ID, MODEL)
|
|
39
|
-
practice['value'] = [value]
|
|
40
|
-
return practice
|
|
41
|
-
|
|
42
|
-
|
|
43
37
|
def _should_run(cycle: dict):
|
|
44
38
|
crop_residue_incomplete = _is_term_type_incomplete(cycle, TermTermType.CROPRESIDUE)
|
|
45
39
|
products = cycle.get('products', [])
|
|
@@ -63,4 +57,4 @@ def run(cycle: dict):
|
|
|
63
57
|
# do not try to run if any of the `residueIncorporated` terms ar added
|
|
64
58
|
has_practice = has_residue_incorporated_practice(cycle)
|
|
65
59
|
should_run, total, value = _should_run(cycle) if not has_practice else (False, None, None)
|
|
66
|
-
return [
|
|
60
|
+
return [_new_practice(term=TERM_ID, model=MODEL, value=value / total * 100)] if should_run else []
|
|
@@ -24,12 +24,6 @@ RETURNS = {
|
|
|
24
24
|
TERM_ID = 'residueLeftOnField'
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
def _practice(value: float):
|
|
28
|
-
practice = _new_practice(TERM_ID, MODEL)
|
|
29
|
-
practice['value'] = [value]
|
|
30
|
-
return practice
|
|
31
|
-
|
|
32
|
-
|
|
33
27
|
def _should_run(cycle: dict):
|
|
34
28
|
crop_residue_incomplete = _is_term_type_incomplete(cycle, TermTermType.CROPRESIDUE)
|
|
35
29
|
products = cycle.get('products', [])
|
|
@@ -51,4 +45,4 @@ def _should_run(cycle: dict):
|
|
|
51
45
|
|
|
52
46
|
def run(cycle: dict):
|
|
53
47
|
should_run, total, value = _should_run(cycle)
|
|
54
|
-
return [
|
|
48
|
+
return [_new_practice(term=TERM_ID, model=MODEL, value=value / total * 100)] if should_run else []
|
|
@@ -45,17 +45,12 @@ RETURNS = {
|
|
|
45
45
|
TERM_ID = 'residueRemoved'
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
def _practice(value: float):
|
|
49
|
-
practice = _new_practice(TERM_ID, MODEL)
|
|
50
|
-
practice['value'] = [value]
|
|
51
|
-
return practice
|
|
52
|
-
|
|
53
|
-
|
|
54
48
|
def _run_by_products(cycle: dict):
|
|
55
49
|
products = cycle.get('products', [])
|
|
56
50
|
aboveGroundCropResidueTotal = list_sum(find_term_match(products, 'aboveGroundCropResidueTotal').get('value'))
|
|
57
51
|
aboveGroundCropResidueRemoved = list_sum(find_term_match(products, 'aboveGroundCropResidueRemoved').get('value'))
|
|
58
|
-
|
|
52
|
+
value = aboveGroundCropResidueRemoved / aboveGroundCropResidueTotal * 100
|
|
53
|
+
return [_new_practice(term=TERM_ID, model=MODEL, value=value)]
|
|
59
54
|
|
|
60
55
|
|
|
61
56
|
def _should_run_by_products(cycle: dict):
|
|
@@ -91,7 +86,7 @@ def _run_by_practices(cycle: dict):
|
|
|
91
86
|
for p in cycle.get('practices', [])
|
|
92
87
|
if _is_incorporated_practice(p)
|
|
93
88
|
])
|
|
94
|
-
return [
|
|
89
|
+
return [_new_practice(term=TERM_ID, model=MODEL, value=100 - (incorporated_value or 0))]
|
|
95
90
|
|
|
96
91
|
|
|
97
92
|
def _should_run_by_practices(cycle: dict):
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
from dateutil.relativedelta import relativedelta
|
|
3
3
|
from hestia_earth.schema import TermTermType
|
|
4
|
-
from hestia_earth.utils.tools import
|
|
4
|
+
from hestia_earth.utils.tools import list_sum
|
|
5
5
|
|
|
6
6
|
from hestia_earth.models.log import logRequirements, logShouldRun, log_as_table
|
|
7
7
|
from hestia_earth.models.utils.blank_node import _gapfill_datestr, DatestrGapfillMode, DatestrFormat, _str_dates_match
|
|
@@ -11,26 +11,9 @@ from .utils import LAND_USE_TERMS_FOR_TRANSFORMATION, crop_ipcc_land_use_categor
|
|
|
11
11
|
from . import MODEL
|
|
12
12
|
|
|
13
13
|
_MAXIMUM_OFFSET_DAYS = 365 * 2
|
|
14
|
-
_OUTPUT_SIGNIFICANT_DIGITS = 3
|
|
15
14
|
_RESOURCE_USE_TERM_ID = 'landOccupationDuringCycle'
|
|
16
15
|
|
|
17
16
|
|
|
18
|
-
def _new_indicator_with_value(
|
|
19
|
-
term_id: str,
|
|
20
|
-
land_cover_id: str,
|
|
21
|
-
previous_land_cover_id: str,
|
|
22
|
-
value: float
|
|
23
|
-
) -> dict:
|
|
24
|
-
indicator = _new_indicator(
|
|
25
|
-
term=term_id,
|
|
26
|
-
model=MODEL,
|
|
27
|
-
land_cover_id=land_cover_id,
|
|
28
|
-
previous_land_cover_id=previous_land_cover_id
|
|
29
|
-
)
|
|
30
|
-
indicator["value"] = to_precision(number=value, digits=_OUTPUT_SIGNIFICANT_DIGITS) if value != 0 else 0
|
|
31
|
-
return indicator
|
|
32
|
-
|
|
33
|
-
|
|
34
17
|
def _gap_filled_date_obj(date_str: str) -> datetime:
|
|
35
18
|
return datetime.strptime(
|
|
36
19
|
_gapfill_datestr(datestr=date_str, mode=DatestrGapfillMode.MIDDLE),
|
|
@@ -151,8 +134,9 @@ def run_resource_use(
|
|
|
151
134
|
historic_date_offset=historic_date_offset
|
|
152
135
|
)
|
|
153
136
|
return [
|
|
154
|
-
|
|
155
|
-
|
|
137
|
+
_new_indicator(
|
|
138
|
+
term=term_id,
|
|
139
|
+
model=MODEL,
|
|
156
140
|
land_cover_id=i['landCover-id'],
|
|
157
141
|
previous_land_cover_id=i['previous-landCover-id'],
|
|
158
142
|
value=(i['landOccupationDuringCycle'] * i['historical-landUse-change'] / 100) / historic_date_offset
|
|
@@ -22,8 +22,7 @@ TERM_ID = 'salineWater'
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
def _measurement():
|
|
25
|
-
data = _new_measurement(TERM_ID, MODEL)
|
|
26
|
-
data['value'] = [True]
|
|
25
|
+
data = _new_measurement(term=TERM_ID, model=MODEL, value=True)
|
|
27
26
|
data['methodClassification'] = MeasurementMethodClassification.MODELLED_USING_OTHER_MEASUREMENTS.value
|
|
28
27
|
return data
|
|
29
28
|
|
|
@@ -4,11 +4,11 @@ from hestia_earth.utils.lookup import (
|
|
|
4
4
|
download_lookup, column_name, extract_grouped_data_closest_date, find_term_ids_by
|
|
5
5
|
)
|
|
6
6
|
from hestia_earth.utils.model import filter_list_term_type
|
|
7
|
-
from hestia_earth.utils.tools import non_empty_list, flatten, list_sum, safe_parse_float
|
|
7
|
+
from hestia_earth.utils.tools import non_empty_list, flatten, list_sum, safe_parse_float, omit
|
|
8
8
|
from hestia_earth.utils.emission import cycle_emissions_in_system_boundary
|
|
9
9
|
|
|
10
10
|
from hestia_earth.models.log import logRequirements, logShouldRun, log_as_table, debugValues
|
|
11
|
-
from hestia_earth.models.utils import
|
|
11
|
+
from hestia_earth.models.utils import group_by
|
|
12
12
|
from hestia_earth.models.utils.emission import _new_emission
|
|
13
13
|
from hestia_earth.models.utils.site import valid_site_type
|
|
14
14
|
from hestia_earth.models.utils.cycle import cycle_end_year
|
|
@@ -70,8 +70,7 @@ TIER = EmissionMethodTier.BACKGROUND.value
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
def _emission(term_id: str, value: float, input: dict):
|
|
73
|
-
emission = _new_emission(term_id, MODEL)
|
|
74
|
-
emission['value'] = [round(value, 7)]
|
|
73
|
+
emission = _new_emission(term=term_id, model=MODEL, value=value)
|
|
75
74
|
emission['inputs'] = [input]
|
|
76
75
|
emission['methodTier'] = TIER
|
|
77
76
|
return emission
|
|
@@ -284,7 +283,7 @@ def _should_run(cycle: dict):
|
|
|
284
283
|
logRequirements(cycle, model=MODEL, term=term_id, model_key=MODEL_KEY,
|
|
285
284
|
emissions=log_as_table(emissions),
|
|
286
285
|
emissions_per_group=log_as_table(emissions_per_group),
|
|
287
|
-
**
|
|
286
|
+
**omit(seed_input, 'input'),
|
|
288
287
|
**logs)
|
|
289
288
|
|
|
290
289
|
logShouldRun(cycle, MODEL, term_id, should_run, methodTier=TIER, model_key=MODEL_KEY)
|
|
@@ -295,7 +294,7 @@ def _should_run(cycle: dict):
|
|
|
295
294
|
if not group.get('has-all-emissions') or not should_run:
|
|
296
295
|
logRequirements(cycle, model=MODEL, term=term_id, model_key=MODEL_KEY, emission_id=emission_id,
|
|
297
296
|
**group,
|
|
298
|
-
**
|
|
297
|
+
**omit(seed_input, 'input'),
|
|
299
298
|
**logs)
|
|
300
299
|
logShouldRun(cycle, MODEL, term_id, False,
|
|
301
300
|
methodTier=TIER, model_key=MODEL_KEY, emission_id=emission_id)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from hestia_earth.utils.model import find_primary_product
|
|
2
|
+
|
|
3
|
+
from hestia_earth.models.log import logShouldRun
|
|
4
|
+
from hestia_earth.models.utils.measurement import _new_measurement
|
|
5
|
+
from hestia_earth.models.utils.site import related_cycles
|
|
6
|
+
from . import MODEL
|
|
7
|
+
|
|
8
|
+
REQUIREMENTS = {
|
|
9
|
+
"Site": {
|
|
10
|
+
"related": {
|
|
11
|
+
"Cycle": [{
|
|
12
|
+
"producst": [{
|
|
13
|
+
"@type": "Product",
|
|
14
|
+
"primary": "True",
|
|
15
|
+
"term.@id": "riceGrainInHuskFlooded"
|
|
16
|
+
}]
|
|
17
|
+
}]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
RETURNS = {
|
|
22
|
+
"Measurement": [{
|
|
23
|
+
"value": "0"
|
|
24
|
+
}]
|
|
25
|
+
}
|
|
26
|
+
TERM_ID = 'slope'
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _measurement(): return _new_measurement(term=TERM_ID, model=MODEL, value=0)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _is_valid_product(cycle: dict):
|
|
33
|
+
return (find_primary_product(cycle) or {}).get('term', {}).get('@id') == 'riceGrainInHuskFlooded'
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _run(site: dict):
|
|
37
|
+
logShouldRun(site, MODEL, TERM_ID, True)
|
|
38
|
+
return [_measurement()]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def run(site: dict):
|
|
42
|
+
is_relevant_product = any(map(_is_valid_product, related_cycles(site)))
|
|
43
|
+
# do not log failure when the product is not relevant
|
|
44
|
+
return _run(site) if is_relevant_product else []
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from hestia_earth.utils.model import find_primary_product
|
|
2
|
+
|
|
3
|
+
from hestia_earth.models.log import logShouldRun
|
|
4
|
+
from hestia_earth.models.utils.measurement import _new_measurement
|
|
5
|
+
from hestia_earth.models.utils.site import related_cycles
|
|
6
|
+
from . import MODEL
|
|
7
|
+
|
|
8
|
+
REQUIREMENTS = {
|
|
9
|
+
"Site": {
|
|
10
|
+
"related": {
|
|
11
|
+
"Cycle": [{
|
|
12
|
+
"producst": [{
|
|
13
|
+
"@type": "Product",
|
|
14
|
+
"primary": "True",
|
|
15
|
+
"term.@id": "riceGrainInHuskFlooded"
|
|
16
|
+
}]
|
|
17
|
+
}]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
RETURNS = {
|
|
22
|
+
"Measurement": [{
|
|
23
|
+
"value": "0"
|
|
24
|
+
}]
|
|
25
|
+
}
|
|
26
|
+
TERM_ID = 'slopeLength'
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _measurement(): return _new_measurement(term=TERM_ID, model=MODEL, value=0)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _is_valid_product(cycle: dict):
|
|
33
|
+
return (find_primary_product(cycle) or {}).get('term', {}).get('@id') == 'riceGrainInHuskFlooded'
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _run(site: dict):
|
|
37
|
+
logShouldRun(site, MODEL, TERM_ID, True)
|
|
38
|
+
return [_measurement()]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def run(site: dict):
|
|
42
|
+
is_relevant_product = all(map(_is_valid_product, related_cycles(site)))
|
|
43
|
+
# do not log failure when the product is not relevant
|
|
44
|
+
return _run(site) if is_relevant_product else []
|
|
@@ -32,8 +32,7 @@ STANDARD_DEPTHS = {(0, 30), (0, 50)}
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
def _measurement(value: float, date: str, term_id: str, standard_fields: dict):
|
|
35
|
-
data = _new_measurement(term_id, MODEL)
|
|
36
|
-
data["value"] = [value]
|
|
35
|
+
data = _new_measurement(term=term_id, model=MODEL, value=value)
|
|
37
36
|
data["depthUpper"] = standard_fields["depthUpper"]
|
|
38
37
|
data["depthLower"] = standard_fields["depthLower"]
|
|
39
38
|
data["methodClassification"] = MeasurementMethodClassification.MODELLED_USING_OTHER_MEASUREMENTS.value
|
|
@@ -27,18 +27,12 @@ LOOKUPS = {
|
|
|
27
27
|
TERM_ID = 'stockingDensityAnimalHousingAverage'
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
def _practice(value: float):
|
|
31
|
-
practice = _new_practice(TERM_ID, MODEL)
|
|
32
|
-
practice['value'] = [round(value, 7)]
|
|
33
|
-
return practice
|
|
34
|
-
|
|
35
|
-
|
|
36
30
|
def _run(values: list):
|
|
37
31
|
# take a weighted average
|
|
38
32
|
value = weighted_average([
|
|
39
33
|
(p.get('lookup'), p.get('value')) for p in values
|
|
40
34
|
])
|
|
41
|
-
return [
|
|
35
|
+
return [_new_practice(term=TERM_ID, model=MODEL, value=value)]
|
|
42
36
|
|
|
43
37
|
|
|
44
38
|
def _should_run(cycle: dict):
|
|
@@ -26,8 +26,7 @@ MEASUREMENT_ID = 'temperatureMonthly'
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def _measurement(value: float, start_date: str, end_date: str):
|
|
29
|
-
data = _new_measurement(TERM_ID, MODEL)
|
|
30
|
-
data['value'] = [value]
|
|
29
|
+
data = _new_measurement(term=TERM_ID, model=MODEL, value=value)
|
|
31
30
|
data['startDate'] = start_date
|
|
32
31
|
data['endDate'] = end_date
|
|
33
32
|
data['methodClassification'] = MeasurementMethodClassification.MODELLED_USING_OTHER_MEASUREMENTS.value
|
|
@@ -25,8 +25,7 @@ MEASUREMENT_ID = 'temperatureDaily'
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def _measurement(value: list, dates: list):
|
|
28
|
-
data = _new_measurement(TERM_ID, MODEL)
|
|
29
|
-
data['value'] = value
|
|
28
|
+
data = _new_measurement(term=TERM_ID, model=MODEL, value=value)
|
|
30
29
|
data['dates'] = dates
|
|
31
30
|
data['methodClassification'] = MeasurementMethodClassification.MODELLED_USING_OTHER_MEASUREMENTS.value
|
|
32
31
|
return data
|
|
@@ -25,8 +25,7 @@ BIBLIO_TITLE = 'Reducing food’s environmental impacts through producers and co
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def _measurement(site: dict, value: float):
|
|
28
|
-
data = _new_measurement(TERM_ID, MODEL)
|
|
29
|
-
data['value'] = [value]
|
|
28
|
+
data = _new_measurement(term=TERM_ID, model=MODEL, value=value)
|
|
30
29
|
data['depthUpper'] = 0
|
|
31
30
|
data['depthLower'] = 50
|
|
32
31
|
data['methodClassification'] = MeasurementMethodClassification.MODELLED_USING_OTHER_MEASUREMENTS.value
|
|
@@ -27,12 +27,6 @@ RETURNS = {
|
|
|
27
27
|
TERM_ID = 'unknownPreSeasonWaterRegime'
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
def _practice():
|
|
31
|
-
practice = _new_practice(TERM_ID, MODEL)
|
|
32
|
-
practice['value'] = [100]
|
|
33
|
-
return practice
|
|
34
|
-
|
|
35
|
-
|
|
36
30
|
def _should_run(cycle: dict):
|
|
37
31
|
practices = cycle.get('practices', [])
|
|
38
32
|
flooded_terms = get_flooded_pre_season_terms()
|
|
@@ -47,4 +41,4 @@ def _should_run(cycle: dict):
|
|
|
47
41
|
|
|
48
42
|
|
|
49
43
|
def run(cycle: dict):
|
|
50
|
-
return [
|
|
44
|
+
return [_new_practice(term=TERM_ID, model=MODEL, value=100)] if _should_run(cycle) else []
|