Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions example/extended_usage/beef_inputs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from datetime import date
from uuid import UUID, uuid4

from pyholos.components.animals.common import (Diet, HousingType,
ManureStateType,
Expand All @@ -8,6 +9,8 @@

global _WEATHER_SUMMARY

_DUMMY_PASTURE_LOCATION_UUID: UUID = uuid4()


def _set_beef_bulls_data() -> list[farm_inputs.BeefManagementPeriod]:
return [
Expand All @@ -20,6 +23,7 @@ def _set_beef_bulls_data() -> list[farm_inputs.BeefManagementPeriod]:
production_stage=ProductionStage.gestating,
number_of_young_animals=0,
is_milk_fed_only=False,
diet_name='custom',
diet=Diet(
crude_protein_percentage=14.8,
forage_percentage=80,
Expand All @@ -30,6 +34,7 @@ def _set_beef_bulls_data() -> list[farm_inputs.BeefManagementPeriod]:
neutral_detergent_fiber_percentage=46.44,
metabolizable_energy=2.2),
housing_type=HousingType.pasture,
pasture_location=_DUMMY_PASTURE_LOCATION_UUID,
manure_handling_system=ManureStateType.pasture,
weather_summary=_WEATHER_SUMMARY),
farm_inputs.BeefManagementPeriod(
Expand All @@ -41,6 +46,7 @@ def _set_beef_bulls_data() -> list[farm_inputs.BeefManagementPeriod]:
production_stage=ProductionStage.gestating,
number_of_young_animals=0,
is_milk_fed_only=False,
diet_name='custom',
diet=Diet(
crude_protein_percentage=12.44,
forage_percentage=97,
Expand All @@ -51,6 +57,7 @@ def _set_beef_bulls_data() -> list[farm_inputs.BeefManagementPeriod]:
neutral_detergent_fiber_percentage=53.478,
metabolizable_energy=1.965),
housing_type=HousingType.pasture,
pasture_location=_DUMMY_PASTURE_LOCATION_UUID,
manure_handling_system=ManureStateType.pasture,
weather_summary=_WEATHER_SUMMARY),
farm_inputs.BeefManagementPeriod(
Expand All @@ -62,6 +69,7 @@ def _set_beef_bulls_data() -> list[farm_inputs.BeefManagementPeriod]:
production_stage=ProductionStage.gestating,
number_of_young_animals=0,
is_milk_fed_only=False,
diet_name='custom',
diet=Diet(
crude_protein_percentage=15.35,
forage_percentage=100,
Expand All @@ -72,6 +80,7 @@ def _set_beef_bulls_data() -> list[farm_inputs.BeefManagementPeriod]:
neutral_detergent_fiber_percentage=49.3,
metabolizable_energy=2.1),
housing_type=HousingType.confined_no_barn,
pasture_location=None,
manure_handling_system=ManureStateType.deep_bedding,
weather_summary=_WEATHER_SUMMARY)
]
Expand All @@ -88,6 +97,7 @@ def _set_beef_cows_data() -> list[farm_inputs.BeefManagementPeriod]:
production_stage=ProductionStage.gestating,
number_of_young_animals=0,
is_milk_fed_only=False,
diet_name='custom',
diet=Diet(
crude_protein_percentage=14.8,
forage_percentage=80,
Expand All @@ -98,6 +108,7 @@ def _set_beef_cows_data() -> list[farm_inputs.BeefManagementPeriod]:
neutral_detergent_fiber_percentage=46.44,
metabolizable_energy=2.2),
housing_type=HousingType.pasture,
pasture_location=_DUMMY_PASTURE_LOCATION_UUID,
manure_handling_system=ManureStateType.pasture,
weather_summary=_WEATHER_SUMMARY),
farm_inputs.BeefManagementPeriod(
Expand All @@ -109,6 +120,7 @@ def _set_beef_cows_data() -> list[farm_inputs.BeefManagementPeriod]:
production_stage=ProductionStage.gestating,
number_of_young_animals=0,
is_milk_fed_only=False,
diet_name='custom',
diet=Diet(
crude_protein_percentage=12.44,
forage_percentage=97,
Expand All @@ -119,6 +131,7 @@ def _set_beef_cows_data() -> list[farm_inputs.BeefManagementPeriod]:
neutral_detergent_fiber_percentage=53.478,
metabolizable_energy=1.965),
housing_type=HousingType.pasture,
pasture_location=_DUMMY_PASTURE_LOCATION_UUID,
manure_handling_system=ManureStateType.pasture,
weather_summary=_WEATHER_SUMMARY),
farm_inputs.BeefManagementPeriod(
Expand All @@ -130,6 +143,7 @@ def _set_beef_cows_data() -> list[farm_inputs.BeefManagementPeriod]:
production_stage=ProductionStage.gestating,
number_of_young_animals=0,
is_milk_fed_only=False,
diet_name='custom',
diet=Diet(
crude_protein_percentage=15.35,
forage_percentage=100,
Expand All @@ -140,6 +154,7 @@ def _set_beef_cows_data() -> list[farm_inputs.BeefManagementPeriod]:
neutral_detergent_fiber_percentage=49.3,
metabolizable_energy=2.1),
housing_type=HousingType.confined_no_barn,
pasture_location=None,
manure_handling_system=ManureStateType.deep_bedding,
weather_summary=_WEATHER_SUMMARY)
]
Expand All @@ -156,6 +171,7 @@ def _set_beef_calf_data() -> list[farm_inputs.BeefManagementPeriod]:
production_stage=ProductionStage.gestating,
number_of_young_animals=0,
is_milk_fed_only=True,
diet_name='custom',
diet=Diet(
crude_protein_percentage=12.44,
forage_percentage=97,
Expand All @@ -166,6 +182,7 @@ def _set_beef_calf_data() -> list[farm_inputs.BeefManagementPeriod]:
neutral_detergent_fiber_percentage=53.478,
metabolizable_energy=1.965),
housing_type=HousingType.confined_no_barn,
pasture_location=None,
manure_handling_system=ManureStateType.deep_bedding,
weather_summary=_WEATHER_SUMMARY),
farm_inputs.BeefManagementPeriod(
Expand All @@ -177,6 +194,7 @@ def _set_beef_calf_data() -> list[farm_inputs.BeefManagementPeriod]:
production_stage=ProductionStage.gestating,
number_of_young_animals=0,
is_milk_fed_only=False,
diet_name='custom',
diet=Diet(
crude_protein_percentage=14.8,
forage_percentage=80,
Expand All @@ -187,6 +205,7 @@ def _set_beef_calf_data() -> list[farm_inputs.BeefManagementPeriod]:
neutral_detergent_fiber_percentage=46.44,
metabolizable_energy=2.2),
housing_type=HousingType.pasture,
pasture_location=_DUMMY_PASTURE_LOCATION_UUID,
manure_handling_system=ManureStateType.pasture,
weather_summary=_WEATHER_SUMMARY)
]
Expand All @@ -202,6 +221,7 @@ def _set_beef_finisher_data() -> list[farm_inputs.BeefManagementPeriod]:
production_stage=ProductionStage.gestating,
number_of_young_animals=0,
is_milk_fed_only=False,
diet_name='custom',
diet=Diet(
crude_protein_percentage=12.72,
forage_percentage=10,
Expand All @@ -212,6 +232,7 @@ def _set_beef_finisher_data() -> list[farm_inputs.BeefManagementPeriod]:
neutral_detergent_fiber_percentage=21.95,
metabolizable_energy=2.92),
housing_type=HousingType.confined_no_barn,
pasture_location=None,
manure_handling_system=ManureStateType.deep_bedding,
weather_summary=_WEATHER_SUMMARY)

Expand All @@ -228,6 +249,7 @@ def _set_beef_stocker_and_backgrounder_data() -> list[farm_inputs.BeefManagement
production_stage=ProductionStage.gestating,
number_of_young_animals=0,
is_milk_fed_only=False,
diet_name='custom',
diet=Diet(
crude_protein_percentage=12.28,
forage_percentage=65,
Expand All @@ -238,6 +260,7 @@ def _set_beef_stocker_and_backgrounder_data() -> list[farm_inputs.BeefManagement
neutral_detergent_fiber_percentage=42.025,
metabolizable_energy=2.48),
housing_type=HousingType.confined_no_barn,
pasture_location=None,
manure_handling_system=ManureStateType.deep_bedding,
weather_summary=_WEATHER_SUMMARY)
return [management_period]
Expand Down
9 changes: 4 additions & 5 deletions example/extended_usage/field_inputs.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
from pyholos.components.animals.common import (ManureAnimalSourceTypes,
ManureLocationSourceType,
ManureStateType)
from pyholos.components.land_management.common import (FertilizerBlends,
HarvestMethod,
IrrigationType,
ManureApplicationTypes,
TillageType)
from pyholos.components.land_management.common import (
FertilizerApplicationMethodologies, FertilizerBlends, HarvestMethod,
IrrigationType, ManureApplicationTypes, TillageType)
from pyholos.components.land_management.crop import CropType
from pyholos.farm.farm_inputs import FieldAnnualData, FieldsInput, WeatherData

Expand All @@ -22,6 +20,7 @@ def set_field_data(weather_data: WeatherData) -> FieldsInput:
tillage_type=TillageType.Reduced,
harvest_method=HarvestMethod.CashCrop,
nitrogen_fertilizer_rate=100,
fertilizer_application_method=FertilizerApplicationMethodologies.IncorporatedOrPartiallyInjected,
fertilizer_blend=FertilizerBlends.Custom,
irrigation_type=IrrigationType.Irrigated,
amount_of_irrigation=0,
Expand Down
Loading