RUFAS.data_structures.events module#

This module defines the various BaseFieldManagementEvent classes and helper functions

Events are simple classes that will facilitate scheduling of different management operations. At their core, they are simply pairs of attributes (year and day), indicating when particular operations should occur. Children of the main BaseFieldManagementEvent class can extend the functionality by adding additional attributes specific to the type of management operation. For example, the HarvestEvent contains the operation attribute, which specifies which specific harvest method will be used when harvesting a crop, and a crop_reference attribute, which specifies which crop that is presently growing in a field will be harvested.

class RUFAS.data_structures.events.BaseFieldManagementEvent(year: int = 1, day: int = 120)#

Bases: object

Class that will facilitate scheduling of different management operations.

Parameters#

yearint, default 1

Year of the simulation on which the event should occur.

dayint, default 120

Julian day of the year on which the event should occur.

Attributes#

yearint

Year of the simulation on which the event should occur.

dayint

Julian day of the year on which the event should occur.

Notes#

An event can specify when a crop is planted or harvested, when a manure/fertilizer amendment should occur.

__init__(year: int = 1, day: int = 120)#
occurs_today(time: RufasTime) bool#

Checks if the event occurs on the current day in the current year..

Parameters#

timeRufasTime

RufasTime object that contains the current day and year.

Returns#

bool

True if event occurs on the current day and year, false if not.

property date_occurs: date#

Gets the date when the event occurs.

class RUFAS.data_structures.events.PlantingEvent(crop_reference: str, heat_scheduled_harvest: bool = False, year: int = 1, day: int = 120)#

Bases: BaseFieldManagementEvent

A child of BaseFieldManagementEvent class that dictates when a crop will be planted and how it will eventually be harvested.

Parameters#

crop_referencestr

Name of the crop to be planted in the ground.

heat_scheduled_harvestbool, default=False

Flag indicating if the crop will be harvested when it has a certain amount of heat units.

__init__(crop_reference: str, heat_scheduled_harvest: bool = False, year: int = 1, day: int = 120) None#
class RUFAS.data_structures.events.HarvestEvent(crop_reference: str, operation: HarvestOperation = HarvestOperation.HARVEST_KILL, year: int = 1, day: int = 240)#

Bases: BaseFieldManagementEvent

A child of BaseFieldManagementEvent class that determines when (and how) a harvest operation should occur for a crop.

Parameters#

crop_referencestr

Name of the crop to be harvested.

operationHarvestOperation, default=HarvestOperation.HARVEST_KILL

A harvest operation from the Harvest Operations enum.

__init__(crop_reference: str, operation: HarvestOperation = HarvestOperation.HARVEST_KILL, year: int = 1, day: int = 240)#
class RUFAS.data_structures.events.TillageEvent(tillage_depth: float, incorporation_fraction: float, mixing_fraction: float, implement: TillageImplement, year: int = 1, day: int = 160)#

Bases: BaseFieldManagementEvent

A child of BaseFieldManagementEvent class that defines a tillage application to be applied on a specific day of a year.

Parameters#

tillage_depthfloat

The lowest depth the tilling implement reaches (mm).

incorporation_fractionfloat

Fraction of soil surface pool incorporated into the soil profile (unitless).

mixing_fractionfloat

Fraction of pool in each layer mixed and redistributed back into the soil profile (unitless).

implementTillageImplement

Tillage implement that is being used to execute this tillage application.

__init__(tillage_depth: float, incorporation_fraction: float, mixing_fraction: float, implement: TillageImplement, year: int = 1, day: int = 160)#
class RUFAS.data_structures.events.ManureEvent(nitrogen_mass: float, phosphorus_mass: float, manure_type: ManureType, manure_supplement_method: ManureSupplementMethod, field_coverage: float, application_depth: float, surface_remainder_fraction: float, year: int, day: int)#

Bases: BaseFieldManagementEvent

A child of BaseFieldManagementEvent class that defines how manure much manure such be requested and applied to a field.

Parameters#

yearint

Year in which this manure application occurs.

dayint

Day in which this manure application occurs.

nitrogen_massfloat

Minimum mass of nitrogen that should be contained in this manure application (kg).

phosphorus_massfloat

Minimum mass of phosphorus that should be contained in this manure application (kg).

manure_typeManureType

The type of manure for which the application request will be made.

manure_supplement_methodManureSupplementMethod

The method that the event will use to supplement nutrient deficiencies.

field_coveragefloat

Fraction of the field covered by this manure application (unitless).

application_depthfloat

Depth that manure is injected into the soil at (mm).

surface_remainder_fractionfloat

Fraction of manure applied that remains on the soil surface (unitless).

__init__(nitrogen_mass: float, phosphorus_mass: float, manure_type: ManureType, manure_supplement_method: ManureSupplementMethod, field_coverage: float, application_depth: float, surface_remainder_fraction: float, year: int, day: int)#
class RUFAS.data_structures.events.FertilizerEvent(mix_name: str, nitrogen_mass: float, phosphorus_mass: float, potassium_mass: float, depth: float, surface_remainder_fraction: float, year: int, day: int)#

Bases: BaseFieldManagementEvent

A child of BaseFieldManagementEvent class that defines the parameters of a single fertilizer application.

Parameters#

mix_namestr

Name of the fertilizer mix being used.

yearint

Year in which this application occurs.

dayint

Day on which this application occurs.

nitrogen_massfloat

Minimum mass of nitrogen that should be in this application (kg).

phosphorus_massfloat

Minimum mass of phosphorus that should be in this application (kg).

potassium_massfloat

Minimum mass of potassium that should be in this application (kg).

depthfloat

Depth at which fertilizer is injected into the soil.

surface_remainder_fractionfloat

Fraction of fertilizer that remains on the soil surface after application.

__init__(mix_name: str, nitrogen_mass: float, phosphorus_mass: float, potassium_mass: float, depth: float, surface_remainder_fraction: float, year: int, day: int)#