pyholos 0.0.1__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 pyholos might be problematic. Click here for more details.
- pyholos/__init__.py +0 -0
- pyholos/common.py +141 -0
- pyholos/common2.py +157 -0
- pyholos/components/__init__.py +0 -0
- pyholos/components/animals/__init__.py +0 -0
- pyholos/components/animals/beef.py +766 -0
- pyholos/components/animals/common.py +2301 -0
- pyholos/components/animals/dairy.py +341 -0
- pyholos/components/animals/sheep.py +412 -0
- pyholos/components/common.py +170 -0
- pyholos/components/land_management/__init__.py +0 -0
- pyholos/components/land_management/carbon/__init__.py +0 -0
- pyholos/components/land_management/carbon/climate.py +863 -0
- pyholos/components/land_management/carbon/management.py +21 -0
- pyholos/components/land_management/carbon/relative_biomass_information.py +410 -0
- pyholos/components/land_management/carbon/tillage.py +88 -0
- pyholos/components/land_management/common.py +220 -0
- pyholos/components/land_management/crop.py +1233 -0
- pyholos/components/land_management/field_system.py +458 -0
- pyholos/components/land_management/utils.py +66 -0
- pyholos/config.py +49 -0
- pyholos/core_constants.py +20 -0
- pyholos/defaults.py +116 -0
- pyholos/farm/__init__.py +0 -0
- pyholos/farm/enums.py +54 -0
- pyholos/farm/farm.py +101 -0
- pyholos/farm/farm_inputs.py +633 -0
- pyholos/farm/farm_settings.py +542 -0
- pyholos/launching.py +86 -0
- pyholos/postprocessing/__init__.py +0 -0
- pyholos/postprocessing/plots.py +164 -0
- pyholos/postprocessing/postprocessing.py +38 -0
- pyholos/resources/holos/Table_16_Livestock_Coefficients_BeefAndDairy_Cattle_Provider.csv +21 -0
- pyholos/resources/holos/Table_21_Average_Milk_Production_For_Dairy_Cows_By_Province.csv +23 -0
- pyholos/resources/holos/Table_22_Livestock_Coefficients_For_Sheep.csv +28 -0
- pyholos/resources/holos/Table_29_Percentage_Total_Manure_Produced_In_Systems.csv +56 -0
- pyholos/resources/holos/Table_30_Default_Bedding_Material_Composition_Provider.csv +28 -0
- pyholos/resources/holos/Table_50_Fuel_Energy_Requirement_Estimates_By_Region.csv +81 -0
- pyholos/resources/holos/Table_51_Herbicide_Energy_Requirement_Estimates_By_Region.csv +81 -0
- pyholos/resources/holos/Table_61_Fractions_of_dairy_cattle_N_volatilized.csv +25 -0
- pyholos/resources/holos/Table_62_Fractions_of_swine_N_volatilized.csv +25 -0
- pyholos/resources/holos/Table_6_Manure_Types_And_Default_Composition.csv +126 -0
- pyholos/resources/holos/Table_7_Relative_Biomass_Information.csv +112 -0
- pyholos/resources/holos/Table_9_Default_Values_For_Nitrogen_Lignin_In_Crops.csv +72 -0
- pyholos/resources/holos/Table_Tillage_Factor.csv +13 -0
- pyholos/resources/holos/feeds.csv +223 -0
- pyholos/resources/holos/main_tables.py +493 -0
- pyholos/resources/holos/small_area_yields.csv +167159 -0
- pyholos/resources/soil_landscapes_of_canada_v3r2.zip +0 -0
- pyholos/soil.py +439 -0
- pyholos/utils.py +83 -0
- pyholos-0.0.1.dist-info/METADATA +16 -0
- pyholos-0.0.1.dist-info/RECORD +55 -0
- pyholos-0.0.1.dist-info/WHEEL +4 -0
- pyholos-0.0.1.dist-info/licenses/LICENSE +677 -0
|
@@ -0,0 +1,766 @@
|
|
|
1
|
+
from datetime import date
|
|
2
|
+
|
|
3
|
+
from pyholos import utils
|
|
4
|
+
from pyholos.common import Component, EnumGeneric, HolosVar
|
|
5
|
+
from pyholos.components.animals.common import (
|
|
6
|
+
AnimalCoefficientData, AnimalType, Bedding, BeddingMaterialType, Diet,
|
|
7
|
+
DietAdditiveType, HousingType, LivestockEmissionConversionFactorsData,
|
|
8
|
+
ManureStateType, Milk, ProductionStage,
|
|
9
|
+
get_ammonia_emission_factor_for_storage_of_beef_and_dairy_cattle_manure,
|
|
10
|
+
get_beef_and_dairy_cattle_coefficient_data,
|
|
11
|
+
get_beef_and_dairy_cattle_feeding_activity_coefficient,
|
|
12
|
+
get_default_methane_producing_capacity_of_manure,
|
|
13
|
+
get_fraction_of_organic_nitrogen_mineralized_data)
|
|
14
|
+
from pyholos.components.common import ComponentType
|
|
15
|
+
from pyholos.config import DATE_FMT
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class GroupNames(EnumGeneric):
|
|
19
|
+
bulls: str = "Bulls"
|
|
20
|
+
replacement_heifers: str = "Replacement heifers"
|
|
21
|
+
cows: str = "Cows"
|
|
22
|
+
calves: str = "Calves"
|
|
23
|
+
heifers: str = "Heifers"
|
|
24
|
+
steers: str = "Steers"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class BeefBase(Component):
|
|
28
|
+
def __init__(self):
|
|
29
|
+
super().__init__()
|
|
30
|
+
|
|
31
|
+
self.name = HolosVar(
|
|
32
|
+
name="Name",
|
|
33
|
+
value="Beef")
|
|
34
|
+
self.component_type = HolosVar(
|
|
35
|
+
name="Component Type",
|
|
36
|
+
value="H.Core.Models.Animals.Beef")
|
|
37
|
+
self.group_name = HolosVar(
|
|
38
|
+
name="Group Name",
|
|
39
|
+
value=None)
|
|
40
|
+
self.group_type = HolosVar(
|
|
41
|
+
name="Group Type",
|
|
42
|
+
value=None)
|
|
43
|
+
self.management_period_name = HolosVar(
|
|
44
|
+
name="Management Period Name",
|
|
45
|
+
value=None)
|
|
46
|
+
self.group_pairing_number = HolosVar(
|
|
47
|
+
name="Group Pairing Number",
|
|
48
|
+
value=None)
|
|
49
|
+
self.management_period_start_date = HolosVar(
|
|
50
|
+
name="Management Period Start Date",
|
|
51
|
+
value=None)
|
|
52
|
+
self.management_period_days = HolosVar(
|
|
53
|
+
name="Management Period Days",
|
|
54
|
+
value=None)
|
|
55
|
+
self.number_of_animals = HolosVar(
|
|
56
|
+
name="Number Of Animals",
|
|
57
|
+
value=None)
|
|
58
|
+
self.production_stage = HolosVar(
|
|
59
|
+
name="Production Stage",
|
|
60
|
+
value=None)
|
|
61
|
+
self.number_of_young_animals = HolosVar(
|
|
62
|
+
name="Number Of Young Animals",
|
|
63
|
+
value=None)
|
|
64
|
+
self.animals_are_milk_fed_only = HolosVar(
|
|
65
|
+
name="Animals Are Milk Fed Only",
|
|
66
|
+
value=None)
|
|
67
|
+
self.start_weight = HolosVar(
|
|
68
|
+
name="Start Weight",
|
|
69
|
+
value=None)
|
|
70
|
+
self.end_weight = HolosVar(
|
|
71
|
+
name="End Weight",
|
|
72
|
+
value=None)
|
|
73
|
+
self.average_daily_gain = HolosVar(
|
|
74
|
+
name="Average Daily Gain",
|
|
75
|
+
value=None)
|
|
76
|
+
self.milk_production = HolosVar(
|
|
77
|
+
name="Milk Production",
|
|
78
|
+
value=None)
|
|
79
|
+
self.milk_fat_content = HolosVar(
|
|
80
|
+
name="Milk Fat Content",
|
|
81
|
+
value=None)
|
|
82
|
+
self.milk_protein_content_as_percentage = HolosVar(
|
|
83
|
+
name="Milk Protein Content As Percentage",
|
|
84
|
+
value=None)
|
|
85
|
+
self.diet_additive_type = HolosVar(
|
|
86
|
+
name="Diet Additive Type",
|
|
87
|
+
value=None)
|
|
88
|
+
self.methane_conversion_factor_of_diet = HolosVar(
|
|
89
|
+
name="Methane Conversion Factor Of Diet",
|
|
90
|
+
value=None)
|
|
91
|
+
|
|
92
|
+
self.methane_conversion_factor_adjusted = HolosVar(
|
|
93
|
+
name="Methane Conversion Factor Adjusted",
|
|
94
|
+
value=0)
|
|
95
|
+
"""deprecated"""
|
|
96
|
+
|
|
97
|
+
self.feed_intake = HolosVar(
|
|
98
|
+
name="Feed Intake",
|
|
99
|
+
value=None)
|
|
100
|
+
self.crude_protein = HolosVar(
|
|
101
|
+
name="Crude Protein",
|
|
102
|
+
value=None)
|
|
103
|
+
self.forage = HolosVar(
|
|
104
|
+
name="Forage",
|
|
105
|
+
value=None)
|
|
106
|
+
self.tdn = HolosVar(
|
|
107
|
+
name="TDN",
|
|
108
|
+
value=None)
|
|
109
|
+
self.ash_content_of_diet = HolosVar(
|
|
110
|
+
name="Ash Content Of Diet",
|
|
111
|
+
value=None)
|
|
112
|
+
self.starch = HolosVar(
|
|
113
|
+
name="Starch",
|
|
114
|
+
value=None)
|
|
115
|
+
self.fat = HolosVar(
|
|
116
|
+
name="Fat",
|
|
117
|
+
value=None)
|
|
118
|
+
self.me = HolosVar(
|
|
119
|
+
name="ME",
|
|
120
|
+
value=None)
|
|
121
|
+
self.ndf = HolosVar(
|
|
122
|
+
name="NDF",
|
|
123
|
+
value=None)
|
|
124
|
+
self.dietary_net_energy_concentration = HolosVar(
|
|
125
|
+
name="Dietary Net Energy Concentration",
|
|
126
|
+
value=None)
|
|
127
|
+
self.housing_type = HolosVar(
|
|
128
|
+
name="Housing Type",
|
|
129
|
+
value=None)
|
|
130
|
+
self.gain_coefficient = HolosVar(
|
|
131
|
+
name="Gain Coefficient",
|
|
132
|
+
value=None)
|
|
133
|
+
self.user_defined_bedding_rate = HolosVar(
|
|
134
|
+
name="User Defined Bedding Rate",
|
|
135
|
+
value=None)
|
|
136
|
+
self.total_carbon_kilograms_dry_matter_for_bedding = HolosVar(
|
|
137
|
+
name="Total Carbon Kilograms Dry Matter For Bedding",
|
|
138
|
+
value=None)
|
|
139
|
+
self.total_nitrogen_kilograms_dry_matter_for_bedding = HolosVar(
|
|
140
|
+
name="Total Nitrogen Kilograms Dry Matter For Bedding",
|
|
141
|
+
value=None)
|
|
142
|
+
self.moisture_content_of_bedding_material = HolosVar(
|
|
143
|
+
name="Moisture Content Of Bedding Material",
|
|
144
|
+
value=None)
|
|
145
|
+
self.activity_coefficient_of_feeding_situation = HolosVar(
|
|
146
|
+
name="Activity Coefficient Of Feeding Situation",
|
|
147
|
+
value=None)
|
|
148
|
+
|
|
149
|
+
self.maintenance_coefficient = HolosVar(
|
|
150
|
+
name="Maintenance Coefficient",
|
|
151
|
+
value=None)
|
|
152
|
+
"""(MJ day⁻¹ kg⁻¹) C_f_adjusted"""
|
|
153
|
+
|
|
154
|
+
self.methane_conversion_factor_of_manure = HolosVar(
|
|
155
|
+
name="Methane Conversion Factor Of Manure",
|
|
156
|
+
value=None)
|
|
157
|
+
self.n2o_direct_emission_factor = HolosVar(
|
|
158
|
+
name="N2O Direct Emission Factor",
|
|
159
|
+
value=None)
|
|
160
|
+
|
|
161
|
+
self.emission_factor_volatilization = HolosVar(
|
|
162
|
+
name="Emission Factor Volatilization",
|
|
163
|
+
value=None)
|
|
164
|
+
"""(kg N2O-N (kg N)^-1) EF_volatilization
|
|
165
|
+
"""
|
|
166
|
+
|
|
167
|
+
self.volatilization_fraction = HolosVar(
|
|
168
|
+
name="Volatilization Fraction",
|
|
169
|
+
value=None)
|
|
170
|
+
self.emission_factor_leaching = HolosVar(
|
|
171
|
+
name="Emission Factor Leaching",
|
|
172
|
+
value=None)
|
|
173
|
+
self.fraction_leaching = HolosVar(
|
|
174
|
+
name="Fraction Leaching",
|
|
175
|
+
value=None)
|
|
176
|
+
|
|
177
|
+
self.ash_content = HolosVar(
|
|
178
|
+
name="Ash Content",
|
|
179
|
+
value=8.0)
|
|
180
|
+
"""deprecated"""
|
|
181
|
+
|
|
182
|
+
self.methane_producing_capacity_of_manure = HolosVar(
|
|
183
|
+
name="Methane Producing Capacity Of Manure",
|
|
184
|
+
value=None)
|
|
185
|
+
self.fraction_of_organic_nitrogen_immobilized = HolosVar(
|
|
186
|
+
name="Fraction Of Organic Nitrogen Immobilized",
|
|
187
|
+
value=None)
|
|
188
|
+
self.fraction_of_organic_nitrogen_nitrified = HolosVar(
|
|
189
|
+
name="Fraction Of Organic Nitrogen Nitrified",
|
|
190
|
+
value=None)
|
|
191
|
+
self.fraction_of_organic_nitrogen_mineralized = HolosVar(
|
|
192
|
+
name="Fraction Of Organic Nitrogen Mineralized",
|
|
193
|
+
value=None)
|
|
194
|
+
self.manure_state_type = HolosVar(
|
|
195
|
+
name="Manure State Type",
|
|
196
|
+
value=None)
|
|
197
|
+
self.ammonia_emission_factor_for_manure_storage = HolosVar(
|
|
198
|
+
name="Ammonia Emission Factor For Manure Storage",
|
|
199
|
+
value=None)
|
|
200
|
+
|
|
201
|
+
self._animal_coefficient_data: AnimalCoefficientData | None = None
|
|
202
|
+
|
|
203
|
+
def get_animal_coefficient_data(self):
|
|
204
|
+
self._animal_coefficient_data = get_beef_and_dairy_cattle_coefficient_data(animal_type=self.group_type.value)
|
|
205
|
+
|
|
206
|
+
def update_name(self, name: str):
|
|
207
|
+
self.name.value = ' '.join((self.name.value, name))
|
|
208
|
+
|
|
209
|
+
def update_component_type(self, component_type: str):
|
|
210
|
+
self.component_type.value = '.'.join((self.component_type.value, component_type))
|
|
211
|
+
|
|
212
|
+
def set_feeding_activity_coefficient(
|
|
213
|
+
self,
|
|
214
|
+
housing_type: HousingType
|
|
215
|
+
):
|
|
216
|
+
self.activity_coefficient_of_feeding_situation.value = get_beef_and_dairy_cattle_feeding_activity_coefficient(
|
|
217
|
+
housing_type=housing_type)
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
class Beef(BeefBase):
|
|
221
|
+
def __init__(
|
|
222
|
+
self,
|
|
223
|
+
name: str,
|
|
224
|
+
component_type: ComponentType,
|
|
225
|
+
group_name: GroupNames,
|
|
226
|
+
animal_type: AnimalType,
|
|
227
|
+
management_period_name: str,
|
|
228
|
+
group_pairing_number: int,
|
|
229
|
+
management_period_start_date: date,
|
|
230
|
+
management_period_days: int,
|
|
231
|
+
number_of_animals: int,
|
|
232
|
+
production_stage: ProductionStage,
|
|
233
|
+
number_of_young_animals: int,
|
|
234
|
+
is_milk_fed_only: bool,
|
|
235
|
+
milk_data: Milk,
|
|
236
|
+
diet: Diet,
|
|
237
|
+
housing_type: HousingType,
|
|
238
|
+
manure_handling_system: ManureStateType,
|
|
239
|
+
manure_emission_factors: LivestockEmissionConversionFactorsData,
|
|
240
|
+
start_weight: float = None,
|
|
241
|
+
end_weight: float = None,
|
|
242
|
+
diet_additive_type: DietAdditiveType = DietAdditiveType.NONE,
|
|
243
|
+
bedding_material_type: BeddingMaterialType = BeddingMaterialType.NONE,
|
|
244
|
+
):
|
|
245
|
+
"""
|
|
246
|
+
|
|
247
|
+
Args:
|
|
248
|
+
name: Component description
|
|
249
|
+
component_type: ComponentType class instance
|
|
250
|
+
group_name: GroupNames member
|
|
251
|
+
animal_type: AnimalType class instance
|
|
252
|
+
management_period_name: given name for the management period
|
|
253
|
+
group_pairing_number: number of paired animals
|
|
254
|
+
management_period_start_date: starting date for the management period
|
|
255
|
+
management_period_days: number of days of the management period
|
|
256
|
+
number_of_animals: number of animals
|
|
257
|
+
production_stage: ProductionStage class instance
|
|
258
|
+
number_of_young_animals: number of young animals
|
|
259
|
+
is_milk_fed_only: used to indicate when animals are not consuming forage but only milk (distinction needed for calculate enteric methane for beef calves)
|
|
260
|
+
milk_data: class object that contains all required milk production data
|
|
261
|
+
diet: class object that contains all required diet data
|
|
262
|
+
housing_type: HousingType class instance
|
|
263
|
+
manure_handling_system: ManureStateType class instance
|
|
264
|
+
manure_emission_factors: LivestockEmissionConversionFactorsData class instance
|
|
265
|
+
diet_additive_type: type of the diet additive
|
|
266
|
+
start_weight: (kg) animal weight at the beginning of the management period
|
|
267
|
+
end_weight: (kg) animal weight at the end of the management period
|
|
268
|
+
bedding_material_type: bedding material type
|
|
269
|
+
|
|
270
|
+
"""
|
|
271
|
+
super().__init__()
|
|
272
|
+
self.update_name(name=name)
|
|
273
|
+
self.update_component_type(component_type.to_str())
|
|
274
|
+
|
|
275
|
+
self.group_name.value = group_name.value
|
|
276
|
+
self.group_type.value = animal_type.value
|
|
277
|
+
self.management_period_name.value = management_period_name
|
|
278
|
+
self.group_pairing_number.value = group_pairing_number
|
|
279
|
+
self.management_period_start_date.value = management_period_start_date.strftime(DATE_FMT)
|
|
280
|
+
self.management_period_days.value = management_period_days
|
|
281
|
+
self.number_of_animals.value = number_of_animals
|
|
282
|
+
self.production_stage.value = production_stage.value
|
|
283
|
+
self.number_of_young_animals.value = number_of_young_animals
|
|
284
|
+
self.animals_are_milk_fed_only.value = str(is_milk_fed_only)
|
|
285
|
+
|
|
286
|
+
self.get_animal_coefficient_data()
|
|
287
|
+
self.maintenance_coefficient.value = self._animal_coefficient_data.baseline_maintenance_coefficient
|
|
288
|
+
self.gain_coefficient.value = self._animal_coefficient_data.gain_coefficient
|
|
289
|
+
|
|
290
|
+
self.start_weight.value = self._animal_coefficient_data.default_initial_weight if start_weight is None else start_weight
|
|
291
|
+
self.end_weight.value = self._animal_coefficient_data.default_final_weight if end_weight is None else end_weight
|
|
292
|
+
|
|
293
|
+
self.average_daily_gain.value = (self.end_weight.value - self.start_weight.value) / management_period_days
|
|
294
|
+
self.milk_production.value = milk_data.production
|
|
295
|
+
self.milk_fat_content.value = milk_data.fat_content
|
|
296
|
+
self.milk_protein_content_as_percentage.value = milk_data.protein_content_as_percentage
|
|
297
|
+
|
|
298
|
+
self.diet_additive_type.value = diet_additive_type.value
|
|
299
|
+
self.methane_conversion_factor_adjusted.value = 0
|
|
300
|
+
self.feed_intake.value = 0
|
|
301
|
+
|
|
302
|
+
self.crude_protein.value = diet.crude_protein_percentage
|
|
303
|
+
self.forage.value = diet.forage_percentage
|
|
304
|
+
self.tdn.value = diet.total_digestible_nutrient_percentage
|
|
305
|
+
self.ash_content_of_diet.value = diet.ash_percentage
|
|
306
|
+
self.starch.value = diet.starch_percentage
|
|
307
|
+
self.fat.value = diet.fat_percentage
|
|
308
|
+
self.me.value = diet.metabolizable_energy
|
|
309
|
+
self.ndf.value = diet.neutral_detergent_fiber_percentage
|
|
310
|
+
|
|
311
|
+
self.dietary_net_energy_concentration.value = diet.calc_dietary_net_energy_concentration_for_beef()
|
|
312
|
+
self.methane_conversion_factor_of_diet.value = diet.calc_methane_conversion_factor(animal_type=animal_type)
|
|
313
|
+
|
|
314
|
+
self.housing_type.value = housing_type.value
|
|
315
|
+
|
|
316
|
+
bedding = Bedding(
|
|
317
|
+
housing_type=housing_type,
|
|
318
|
+
bedding_material_type=bedding_material_type,
|
|
319
|
+
animal_type=animal_type)
|
|
320
|
+
|
|
321
|
+
self.user_defined_bedding_rate.value = bedding.user_defined_bedding_rate.value
|
|
322
|
+
self.total_carbon_kilograms_dry_matter_for_bedding.value = bedding.total_carbon_kilograms_dry_matter_for_bedding.value
|
|
323
|
+
self.total_nitrogen_kilograms_dry_matter_for_bedding.value = bedding.total_nitrogen_kilograms_dry_matter_for_bedding.value
|
|
324
|
+
self.moisture_content_of_bedding_material.value = bedding.moisture_content_of_bedding_material.value
|
|
325
|
+
|
|
326
|
+
self.set_feeding_activity_coefficient(housing_type=housing_type)
|
|
327
|
+
|
|
328
|
+
self.methane_producing_capacity_of_manure.value = get_default_methane_producing_capacity_of_manure(
|
|
329
|
+
is_pasture=housing_type.is_pasture(),
|
|
330
|
+
animal_type=animal_type)
|
|
331
|
+
|
|
332
|
+
fraction_of_organic_nitrogen_mineralized_data = get_fraction_of_organic_nitrogen_mineralized_data(
|
|
333
|
+
state_type=manure_handling_system,
|
|
334
|
+
animal_type=animal_type)
|
|
335
|
+
|
|
336
|
+
self.manure_state_type.value = manure_handling_system.value
|
|
337
|
+
self.fraction_of_organic_nitrogen_immobilized.value = fraction_of_organic_nitrogen_mineralized_data.fraction_immobilized
|
|
338
|
+
self.fraction_of_organic_nitrogen_nitrified.value = fraction_of_organic_nitrogen_mineralized_data.fraction_nitrified
|
|
339
|
+
self.fraction_of_organic_nitrogen_mineralized.value = fraction_of_organic_nitrogen_mineralized_data.fraction_mineralized
|
|
340
|
+
|
|
341
|
+
self.ammonia_emission_factor_for_manure_storage.value = (
|
|
342
|
+
get_ammonia_emission_factor_for_storage_of_beef_and_dairy_cattle_manure(
|
|
343
|
+
storage_type=manure_handling_system))
|
|
344
|
+
|
|
345
|
+
self.methane_conversion_factor_of_manure.value = manure_emission_factors.MethaneConversionFactor
|
|
346
|
+
self.n2o_direct_emission_factor.value = manure_emission_factors.N2ODirectEmissionFactor
|
|
347
|
+
self.volatilization_fraction.value = manure_emission_factors.VolatilizationFraction
|
|
348
|
+
self.emission_factor_volatilization.value = manure_emission_factors.EmissionFactorVolatilization
|
|
349
|
+
self.fraction_leaching.value = manure_emission_factors.LeachingFraction
|
|
350
|
+
self.emission_factor_leaching.value = manure_emission_factors.EmissionFactorLeach
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
class Bulls(Beef):
|
|
354
|
+
animal_type = AnimalType.beef_bulls
|
|
355
|
+
component_type = ComponentType.cow_calf
|
|
356
|
+
|
|
357
|
+
def __init__(
|
|
358
|
+
self,
|
|
359
|
+
management_period_name: str,
|
|
360
|
+
group_pairing_number: int,
|
|
361
|
+
management_period_start_date: date,
|
|
362
|
+
management_period_days: int,
|
|
363
|
+
number_of_animals: int,
|
|
364
|
+
production_stage: ProductionStage,
|
|
365
|
+
number_of_young_animals: int,
|
|
366
|
+
is_milk_fed_only: bool,
|
|
367
|
+
milk_data: Milk,
|
|
368
|
+
diet: Diet,
|
|
369
|
+
housing_type: HousingType,
|
|
370
|
+
manure_handling_system: ManureStateType,
|
|
371
|
+
manure_emission_factors: LivestockEmissionConversionFactorsData,
|
|
372
|
+
start_weight: float = None,
|
|
373
|
+
end_weight: float = None,
|
|
374
|
+
diet_additive_type: DietAdditiveType = DietAdditiveType.NONE,
|
|
375
|
+
bedding_material_type: BeddingMaterialType = BeddingMaterialType.NONE,
|
|
376
|
+
):
|
|
377
|
+
"""
|
|
378
|
+
|
|
379
|
+
Args:
|
|
380
|
+
management_period_name: given name for the management period
|
|
381
|
+
group_pairing_number: number of paired animals
|
|
382
|
+
management_period_start_date: starting date for the management period
|
|
383
|
+
management_period_days: number of days of the management period
|
|
384
|
+
number_of_animals: number of animals
|
|
385
|
+
production_stage: ProductionStage class instance
|
|
386
|
+
number_of_young_animals: number of young animals
|
|
387
|
+
is_milk_fed_only: used to indicate when animals are not consuming forage but only milk (distinction needed for calculate enteric methane for beef calves)
|
|
388
|
+
start_weight: (kg) animal weight at the beginning of the management period
|
|
389
|
+
end_weight: (kg) animal weight at the end of the management period
|
|
390
|
+
milk_data: class object that contains all required milk production data
|
|
391
|
+
diet: class object that contains all required diet data
|
|
392
|
+
diet_additive_type: type of the diet additive
|
|
393
|
+
bedding_material_type: bedding material type
|
|
394
|
+
"""
|
|
395
|
+
super().__init__(
|
|
396
|
+
name='Cow-Calf',
|
|
397
|
+
component_type=self.component_type,
|
|
398
|
+
group_name=GroupNames.bulls,
|
|
399
|
+
animal_type=self.animal_type,
|
|
400
|
+
|
|
401
|
+
**utils.get_local_args(locals())
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
class ReplacementHeifers(Beef):
|
|
406
|
+
animal_type = AnimalType.beef_replacement_heifers
|
|
407
|
+
component_type = ComponentType.cow_calf
|
|
408
|
+
|
|
409
|
+
def __init__(
|
|
410
|
+
self,
|
|
411
|
+
management_period_name: str,
|
|
412
|
+
group_pairing_number: int,
|
|
413
|
+
management_period_start_date: date,
|
|
414
|
+
management_period_days: int,
|
|
415
|
+
number_of_animals: int,
|
|
416
|
+
production_stage: ProductionStage,
|
|
417
|
+
number_of_young_animals: int,
|
|
418
|
+
is_milk_fed_only: bool,
|
|
419
|
+
milk_data: Milk,
|
|
420
|
+
diet: Diet,
|
|
421
|
+
housing_type: HousingType,
|
|
422
|
+
manure_handling_system: ManureStateType,
|
|
423
|
+
manure_emission_factors: LivestockEmissionConversionFactorsData,
|
|
424
|
+
start_weight: float = None,
|
|
425
|
+
end_weight: float = None,
|
|
426
|
+
diet_additive_type: DietAdditiveType = DietAdditiveType.NONE,
|
|
427
|
+
bedding_material_type: BeddingMaterialType = BeddingMaterialType.NONE,
|
|
428
|
+
):
|
|
429
|
+
"""
|
|
430
|
+
|
|
431
|
+
Args:
|
|
432
|
+
management_period_name: given name for the management period
|
|
433
|
+
group_pairing_number: number of paired animals
|
|
434
|
+
management_period_start_date: starting date for the management period
|
|
435
|
+
management_period_days: number of days of the management period
|
|
436
|
+
number_of_animals: number of animals
|
|
437
|
+
production_stage: ProductionStage class instance
|
|
438
|
+
number_of_young_animals: number of young animals
|
|
439
|
+
is_milk_fed_only: used to indicate when animals are not consuming forage but only milk (distinction needed for calculate enteric methane for beef calves)
|
|
440
|
+
start_weight: (kg) animal weight at the beginning of the management period
|
|
441
|
+
end_weight: (kg) animal weight at the end of the management period
|
|
442
|
+
milk_data: class object that contains all required milk production data
|
|
443
|
+
diet: class object that contains all required diet data
|
|
444
|
+
diet_additive_type: type of the diet additive
|
|
445
|
+
bedding_material_type: bedding material type
|
|
446
|
+
"""
|
|
447
|
+
super().__init__(
|
|
448
|
+
name='Cow-Calf',
|
|
449
|
+
component_type=self.component_type,
|
|
450
|
+
group_name=GroupNames.replacement_heifers,
|
|
451
|
+
animal_type=self.animal_type,
|
|
452
|
+
|
|
453
|
+
**utils.get_local_args(locals())
|
|
454
|
+
)
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
class Cows(Beef):
|
|
458
|
+
animal_type = AnimalType.beef_cow_lactating
|
|
459
|
+
component_type = ComponentType.cow_calf
|
|
460
|
+
|
|
461
|
+
def __init__(
|
|
462
|
+
self,
|
|
463
|
+
management_period_name: str,
|
|
464
|
+
group_pairing_number: int,
|
|
465
|
+
management_period_start_date: date,
|
|
466
|
+
management_period_days: int,
|
|
467
|
+
number_of_animals: int,
|
|
468
|
+
production_stage: ProductionStage,
|
|
469
|
+
number_of_young_animals: int,
|
|
470
|
+
is_milk_fed_only: bool,
|
|
471
|
+
milk_data: Milk,
|
|
472
|
+
diet: Diet,
|
|
473
|
+
housing_type: HousingType,
|
|
474
|
+
manure_handling_system: ManureStateType,
|
|
475
|
+
manure_emission_factors: LivestockEmissionConversionFactorsData,
|
|
476
|
+
start_weight: float = None,
|
|
477
|
+
end_weight: float = None,
|
|
478
|
+
diet_additive_type: DietAdditiveType = DietAdditiveType.NONE,
|
|
479
|
+
bedding_material_type: BeddingMaterialType = BeddingMaterialType.NONE,
|
|
480
|
+
):
|
|
481
|
+
"""
|
|
482
|
+
|
|
483
|
+
Args:
|
|
484
|
+
management_period_name: given name for the management period
|
|
485
|
+
group_pairing_number: number of paired animals
|
|
486
|
+
management_period_start_date: starting date for the management period
|
|
487
|
+
management_period_days: number of days of the management period
|
|
488
|
+
number_of_animals: number of animals
|
|
489
|
+
production_stage: ProductionStage class instance
|
|
490
|
+
number_of_young_animals: number of young animals
|
|
491
|
+
is_milk_fed_only: used to indicate when animals are not consuming forage but only milk (distinction needed for calculate enteric methane for beef calves)
|
|
492
|
+
start_weight: (kg) animal weight at the beginning of the management period
|
|
493
|
+
end_weight: (kg) animal weight at the end of the management period
|
|
494
|
+
milk_data: class object that contains all required milk production data
|
|
495
|
+
diet: class object that contains all required diet data
|
|
496
|
+
diet_additive_type: type of the diet additive
|
|
497
|
+
bedding_material_type: bedding material type
|
|
498
|
+
"""
|
|
499
|
+
super().__init__(
|
|
500
|
+
name='Cow-Calf',
|
|
501
|
+
component_type=self.component_type,
|
|
502
|
+
group_name=GroupNames.cows,
|
|
503
|
+
animal_type=self.animal_type,
|
|
504
|
+
|
|
505
|
+
**utils.get_local_args(locals())
|
|
506
|
+
)
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
class Calves(Beef):
|
|
510
|
+
animal_type = AnimalType.beef_calf
|
|
511
|
+
component_type = ComponentType.cow_calf
|
|
512
|
+
|
|
513
|
+
def __init__(
|
|
514
|
+
self,
|
|
515
|
+
management_period_name: str,
|
|
516
|
+
group_pairing_number: int,
|
|
517
|
+
management_period_start_date: date,
|
|
518
|
+
management_period_days: int,
|
|
519
|
+
number_of_animals: int,
|
|
520
|
+
production_stage: ProductionStage,
|
|
521
|
+
number_of_young_animals: int,
|
|
522
|
+
is_milk_fed_only: bool,
|
|
523
|
+
milk_data: Milk,
|
|
524
|
+
diet: Diet,
|
|
525
|
+
housing_type: HousingType,
|
|
526
|
+
manure_handling_system: ManureStateType,
|
|
527
|
+
manure_emission_factors: LivestockEmissionConversionFactorsData,
|
|
528
|
+
start_weight: float = None,
|
|
529
|
+
end_weight: float = None,
|
|
530
|
+
diet_additive_type: DietAdditiveType = DietAdditiveType.NONE,
|
|
531
|
+
bedding_material_type: BeddingMaterialType = BeddingMaterialType.NONE,
|
|
532
|
+
):
|
|
533
|
+
"""
|
|
534
|
+
|
|
535
|
+
Args:
|
|
536
|
+
management_period_name: given name for the management period
|
|
537
|
+
group_pairing_number: number of paired animals
|
|
538
|
+
management_period_start_date: starting date for the management period
|
|
539
|
+
management_period_days: number of days of the management period
|
|
540
|
+
number_of_animals: number of animals
|
|
541
|
+
production_stage: ProductionStage class instance
|
|
542
|
+
number_of_young_animals: number of young animals
|
|
543
|
+
is_milk_fed_only: used to indicate when animals are not consuming forage but only milk (distinction needed for calculate enteric methane for beef calves)
|
|
544
|
+
start_weight: (kg) animal weight at the beginning of the management period
|
|
545
|
+
end_weight: (kg) animal weight at the end of the management period
|
|
546
|
+
milk_data: class object that contains all required milk production data
|
|
547
|
+
diet: class object that contains all required diet data
|
|
548
|
+
diet_additive_type: type of the diet additive
|
|
549
|
+
bedding_material_type: bedding material type
|
|
550
|
+
"""
|
|
551
|
+
super().__init__(
|
|
552
|
+
name='Cow-Calf',
|
|
553
|
+
component_type=self.component_type,
|
|
554
|
+
group_name=GroupNames.calves,
|
|
555
|
+
animal_type=self.animal_type,
|
|
556
|
+
|
|
557
|
+
**utils.get_local_args(locals())
|
|
558
|
+
)
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
class FinishingHeifers(Beef):
|
|
562
|
+
animal_type = AnimalType.beef_finishing_heifer
|
|
563
|
+
component_type = ComponentType.finishing
|
|
564
|
+
|
|
565
|
+
def __init__(
|
|
566
|
+
self,
|
|
567
|
+
management_period_name: str,
|
|
568
|
+
group_pairing_number: int,
|
|
569
|
+
management_period_start_date: date,
|
|
570
|
+
management_period_days: int,
|
|
571
|
+
number_of_animals: int,
|
|
572
|
+
production_stage: ProductionStage,
|
|
573
|
+
number_of_young_animals: int,
|
|
574
|
+
is_milk_fed_only: bool,
|
|
575
|
+
milk_data: Milk,
|
|
576
|
+
diet: Diet,
|
|
577
|
+
housing_type: HousingType,
|
|
578
|
+
manure_handling_system: ManureStateType,
|
|
579
|
+
manure_emission_factors: LivestockEmissionConversionFactorsData,
|
|
580
|
+
start_weight: float = None,
|
|
581
|
+
end_weight: float = None,
|
|
582
|
+
diet_additive_type: DietAdditiveType = DietAdditiveType.NONE,
|
|
583
|
+
bedding_material_type: BeddingMaterialType = BeddingMaterialType.NONE,
|
|
584
|
+
):
|
|
585
|
+
"""
|
|
586
|
+
|
|
587
|
+
Args:
|
|
588
|
+
management_period_name: given name for the management period
|
|
589
|
+
group_pairing_number: number of paired animals
|
|
590
|
+
management_period_start_date: starting date for the management period
|
|
591
|
+
management_period_days: number of days of the management period
|
|
592
|
+
number_of_animals: number of animals
|
|
593
|
+
production_stage: ProductionStage class instance
|
|
594
|
+
number_of_young_animals: number of young animals
|
|
595
|
+
is_milk_fed_only: used to indicate when animals are not consuming forage but only milk (distinction needed for calculate enteric methane for beef calves)
|
|
596
|
+
start_weight: (kg) animal weight at the beginning of the management period
|
|
597
|
+
end_weight: (kg) animal weight at the end of the management period
|
|
598
|
+
milk_data: class object that contains all required milk production data
|
|
599
|
+
diet: class object that contains all required diet data
|
|
600
|
+
diet_additive_type: type of the diet additive
|
|
601
|
+
bedding_material_type: bedding material type
|
|
602
|
+
"""
|
|
603
|
+
super().__init__(
|
|
604
|
+
name='Finisher',
|
|
605
|
+
component_type=self.component_type,
|
|
606
|
+
group_name=GroupNames.heifers,
|
|
607
|
+
animal_type=self.animal_type,
|
|
608
|
+
|
|
609
|
+
**utils.get_local_args(locals())
|
|
610
|
+
)
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
class FinishingSteers(Beef):
|
|
614
|
+
animal_type = AnimalType.beef_finishing_steer
|
|
615
|
+
component_type = ComponentType.finishing
|
|
616
|
+
|
|
617
|
+
def __init__(
|
|
618
|
+
self,
|
|
619
|
+
management_period_name: str,
|
|
620
|
+
group_pairing_number: int,
|
|
621
|
+
management_period_start_date: date,
|
|
622
|
+
management_period_days: int,
|
|
623
|
+
number_of_animals: int,
|
|
624
|
+
production_stage: ProductionStage,
|
|
625
|
+
number_of_young_animals: int,
|
|
626
|
+
is_milk_fed_only: bool,
|
|
627
|
+
milk_data: Milk,
|
|
628
|
+
diet: Diet,
|
|
629
|
+
housing_type: HousingType,
|
|
630
|
+
manure_handling_system: ManureStateType,
|
|
631
|
+
manure_emission_factors: LivestockEmissionConversionFactorsData,
|
|
632
|
+
start_weight: float = None,
|
|
633
|
+
end_weight: float = None,
|
|
634
|
+
diet_additive_type: DietAdditiveType = DietAdditiveType.NONE,
|
|
635
|
+
bedding_material_type: BeddingMaterialType = BeddingMaterialType.NONE,
|
|
636
|
+
):
|
|
637
|
+
"""
|
|
638
|
+
|
|
639
|
+
Args:
|
|
640
|
+
management_period_name: given name for the management period
|
|
641
|
+
group_pairing_number: number of paired animals
|
|
642
|
+
management_period_start_date: starting date for the management period
|
|
643
|
+
management_period_days: number of days of the management period
|
|
644
|
+
number_of_animals: number of animals
|
|
645
|
+
production_stage: ProductionStage class instance
|
|
646
|
+
number_of_young_animals: number of young animals
|
|
647
|
+
is_milk_fed_only: used to indicate when animals are not consuming forage but only milk (distinction needed for calculate enteric methane for beef calves)
|
|
648
|
+
start_weight: (kg) animal weight at the beginning of the management period
|
|
649
|
+
end_weight: (kg) animal weight at the end of the management period
|
|
650
|
+
milk_data: class object that contains all required milk production data
|
|
651
|
+
diet: class object that contains all required diet data
|
|
652
|
+
diet_additive_type: type of the diet additive
|
|
653
|
+
bedding_material_type: bedding material type
|
|
654
|
+
"""
|
|
655
|
+
super().__init__(
|
|
656
|
+
name='Finisher',
|
|
657
|
+
component_type=self.component_type,
|
|
658
|
+
group_name=GroupNames.steers,
|
|
659
|
+
animal_type=self.animal_type,
|
|
660
|
+
|
|
661
|
+
**utils.get_local_args(locals())
|
|
662
|
+
)
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
class BackgrounderHeifer(Beef):
|
|
666
|
+
animal_type = AnimalType.beef_backgrounder_heifer
|
|
667
|
+
component_type = ComponentType.backgrounding
|
|
668
|
+
|
|
669
|
+
def __init__(
|
|
670
|
+
self,
|
|
671
|
+
management_period_name: str,
|
|
672
|
+
group_pairing_number: int,
|
|
673
|
+
management_period_start_date: date,
|
|
674
|
+
management_period_days: int,
|
|
675
|
+
number_of_animals: int,
|
|
676
|
+
production_stage: ProductionStage,
|
|
677
|
+
number_of_young_animals: int,
|
|
678
|
+
is_milk_fed_only: bool,
|
|
679
|
+
milk_data: Milk,
|
|
680
|
+
diet: Diet,
|
|
681
|
+
housing_type: HousingType,
|
|
682
|
+
manure_handling_system: ManureStateType,
|
|
683
|
+
manure_emission_factors: LivestockEmissionConversionFactorsData,
|
|
684
|
+
start_weight: float = None,
|
|
685
|
+
end_weight: float = None,
|
|
686
|
+
diet_additive_type: DietAdditiveType = DietAdditiveType.NONE,
|
|
687
|
+
bedding_material_type: BeddingMaterialType = BeddingMaterialType.NONE,
|
|
688
|
+
):
|
|
689
|
+
"""
|
|
690
|
+
|
|
691
|
+
Args:
|
|
692
|
+
management_period_name: given name for the management period
|
|
693
|
+
group_pairing_number: number of paired animals
|
|
694
|
+
management_period_start_date: starting date for the management period
|
|
695
|
+
management_period_days: number of days of the management period
|
|
696
|
+
number_of_animals: number of animals
|
|
697
|
+
production_stage: ProductionStage class instance
|
|
698
|
+
number_of_young_animals: number of young animals
|
|
699
|
+
is_milk_fed_only: used to indicate when animals are not consuming forage but only milk (distinction needed for calculate enteric methane for beef calves)
|
|
700
|
+
start_weight: (kg) animal weight at the beginning of the management period
|
|
701
|
+
end_weight: (kg) animal weight at the end of the management period
|
|
702
|
+
milk_data: class object that contains all required milk production data
|
|
703
|
+
diet: class object that contains all required diet data
|
|
704
|
+
diet_additive_type: type of the diet additive
|
|
705
|
+
bedding_material_type: bedding material type
|
|
706
|
+
"""
|
|
707
|
+
super().__init__(
|
|
708
|
+
name='Stockers & Backgrounders',
|
|
709
|
+
component_type=self.component_type,
|
|
710
|
+
group_name=GroupNames.heifers,
|
|
711
|
+
animal_type=self.animal_type,
|
|
712
|
+
|
|
713
|
+
**utils.get_local_args(locals())
|
|
714
|
+
)
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
class BackgrounderSteer(Beef):
|
|
718
|
+
animal_type = AnimalType.beef_backgrounder_steer
|
|
719
|
+
component_type = ComponentType.backgrounding
|
|
720
|
+
|
|
721
|
+
def __init__(
|
|
722
|
+
self,
|
|
723
|
+
management_period_name: str,
|
|
724
|
+
group_pairing_number: int,
|
|
725
|
+
management_period_start_date: date,
|
|
726
|
+
management_period_days: int,
|
|
727
|
+
number_of_animals: int,
|
|
728
|
+
production_stage: ProductionStage,
|
|
729
|
+
number_of_young_animals: int,
|
|
730
|
+
is_milk_fed_only: bool,
|
|
731
|
+
milk_data: Milk,
|
|
732
|
+
diet: Diet,
|
|
733
|
+
housing_type: HousingType,
|
|
734
|
+
manure_handling_system: ManureStateType,
|
|
735
|
+
manure_emission_factors: LivestockEmissionConversionFactorsData,
|
|
736
|
+
start_weight: float = None,
|
|
737
|
+
end_weight: float = None,
|
|
738
|
+
diet_additive_type: DietAdditiveType = DietAdditiveType.NONE,
|
|
739
|
+
bedding_material_type: BeddingMaterialType = BeddingMaterialType.NONE,
|
|
740
|
+
):
|
|
741
|
+
"""
|
|
742
|
+
|
|
743
|
+
Args:
|
|
744
|
+
management_period_name: given name for the management period
|
|
745
|
+
group_pairing_number: number of paired animals
|
|
746
|
+
management_period_start_date: starting date for the management period
|
|
747
|
+
management_period_days: number of days of the management period
|
|
748
|
+
number_of_animals: number of animals
|
|
749
|
+
production_stage: ProductionStage class instance
|
|
750
|
+
number_of_young_animals: number of young animals
|
|
751
|
+
is_milk_fed_only: used to indicate when animals are not consuming forage but only milk (distinction needed for calculate enteric methane for beef calves)
|
|
752
|
+
start_weight: (kg) animal weight at the beginning of the management period
|
|
753
|
+
end_weight: (kg) animal weight at the end of the management period
|
|
754
|
+
milk_data: class object that contains all required milk production data
|
|
755
|
+
diet: class object that contains all required diet data
|
|
756
|
+
diet_additive_type: type of the diet additive
|
|
757
|
+
bedding_material_type: bedding material type
|
|
758
|
+
"""
|
|
759
|
+
super().__init__(
|
|
760
|
+
name='Stockers & Backgrounders',
|
|
761
|
+
component_type=self.component_type,
|
|
762
|
+
group_name=GroupNames.steers,
|
|
763
|
+
animal_type=self.animal_type,
|
|
764
|
+
|
|
765
|
+
**utils.get_local_args(locals())
|
|
766
|
+
)
|