RUFAS.data_structures.manure_nutrients module#

class RUFAS.data_structures.manure_nutrients.ManureNutrients(*, manure_type: ManureType | None = None, manure_type_unit: MeasurementUnits = MeasurementUnits.UNITLESS, nitrogen: float = 0.0, nitrogen_unit: MeasurementUnits = MeasurementUnits.KILOGRAMS, phosphorus: float = 0.0, phosphorus_unit: MeasurementUnits = MeasurementUnits.KILOGRAMS, potassium: float = 0.0, potassium_unit: MeasurementUnits = MeasurementUnits.KILOGRAMS, dry_matter: float = 0.0, dry_matter_unit: MeasurementUnits = MeasurementUnits.KILOGRAMS, total_manure_mass: float = 0.0, total_manure_mass_unit: MeasurementUnits = MeasurementUnits.KILOGRAMS)#

Bases: object

A class to store the relevant manure nutrient information to be passed to the crop and soil module

manure_type: ManureType | None = None#

Type of manure.

manure_type_unit: MeasurementUnits = 'unitless'#

Unit for manure_type

nitrogen: float = 0.0#

Amount of accumulated manure nitrogen derived from the manure module, kg.

nitrogen_unit: MeasurementUnits = 'kg'#

Unit for nitrogen

phosphorus: float = 0.0#

Amount of accumulated manure phosphorus derived from the manure module, kg.

phosphorus_unit: MeasurementUnits = 'kg'#

Unit for phosphorus

potassium: float = 0.0#

Amount of accumulated manure potassium derived from the manure module, kg.

potassium_unit: MeasurementUnits = 'kg'#

Unit for potassium

dry_matter: float = 0.0#

Amount of accumulated dry matter derived from the manure module, kg.

dry_matter_unit: MeasurementUnits = 'kg'#

Unit for dry_matter

total_manure_mass: float = 0.0#

Amount of accumulated manure mass derived from the manure module, kg.

__init__(*, manure_type: ManureType | None = None, manure_type_unit: MeasurementUnits = MeasurementUnits.UNITLESS, nitrogen: float = 0.0, nitrogen_unit: MeasurementUnits = MeasurementUnits.KILOGRAMS, phosphorus: float = 0.0, phosphorus_unit: MeasurementUnits = MeasurementUnits.KILOGRAMS, potassium: float = 0.0, potassium_unit: MeasurementUnits = MeasurementUnits.KILOGRAMS, dry_matter: float = 0.0, dry_matter_unit: MeasurementUnits = MeasurementUnits.KILOGRAMS, total_manure_mass: float = 0.0, total_manure_mass_unit: MeasurementUnits = MeasurementUnits.KILOGRAMS) None#
total_manure_mass_unit: MeasurementUnits = 'kg'#

Unit for total_manure_mass

property units_dict: dict[str, MeasurementUnits]#

Creates a dictionary of unit labels for each property in the ManureNutrients class.

This method iterates over all attributes of the instance, filtering for those ending with “_unit”, and constructs a dictionary where each key corresponds to the name of a nutrient or property (e.g., ‘nitrogen_unit’, ‘phosphorus_unit’, etc.), and each value is the unit of measurement (e.g., ‘kg’, ‘unitless’).

Returns#

dict[MeasurementUnits, MeasurementUnits]

A dictionary where keys are the names of attributes representing the units of nutrients and properties, and values are the respective units of measurement.

property dry_matter_fraction: float#

Calculate the dry matter fraction of the manure.

Returns#

float

The dry matter fraction of the manure, unitless, between 0 and 1.

property nitrogen_composition: float#

Calculate the nitrogen composition of the manure.

Returns#

float

The nitrogen composition of the manure, unitless, between 0 and 1.

property phosphorus_composition: float#

Calculate the phosphorus composition of the manure.

Returns#

float

The phosphorus composition of the manure, unitless, between 0 and 1.

reset_values() ManureNutrients#

Return a new ManureNutrients with all numeric nutrient/mass fields zeroed out, but keeping the manure‐type and units unchanged.