livestock_generation.livestock_exports

This module contains a class to calculate exports of milk, protein, and total protein from a livestock system under different scenarios.

The class Exports contains methods to calculate the total kilograms of milk exported for each scenario, the total beef weight exported from the entire system for each scenario, and the total protein exported by the entire system, assuming specific milk and beef protein contents.

Module Contents

Classes

Exports

A class to calculate exports of milk, protein, and total protein from a livestock system under different scenarios.

class livestock_generation.livestock_exports.Exports(ef_country, calibration_year, target_year, scenario_inputs_df)[source]

A class to calculate exports of milk, protein, and total protein from a livestock system under different scenarios.

sc_class

An instance for fetching scenario data.

Type:

ScenarioDataFetcher

loader_class

An instance for loading necessary data.

Type:

Loader

data_manager_class

An instance for managing livestock data.

Type:

DataManager

ef_country

The country code for export calculations.

Type:

str

Parameters:
  • ef_country (str) – The country code for which the exports are being calculated.

  • calibration_year (int) – The year used for calibration purposes in the analysis.

  • target_year (int) – The year for which the exports are being calculated.

  • scenario_inputs_df (DataFrame) – A pandas DataFrame containing scenario inputs necessary for calculations.

compute_system_milk_exports(scenario_animal_data, baseline_animal_data)[source]

Calculates the total kilograms of milk exported for each scenario.

Parameters:
  • scenario_animal_data (DataFrame) – Animal data for different scenarios.

  • baseline_animal_data (DataFrame) – Baseline animal data.

Returns:

A DataFrame with index as scenarios and columns for total milk in kg.

Return type:

DataFrame

compute_system_protien_exports(scenario_animal_data, baseline_animal_data)[source]

Calculates the total beef weight exported from the entire system for each scenario.

Parameters:
  • scenario_animal_data (DataFrame) – Animal data for different scenarios.

  • baseline_animal_data (DataFrame) – Baseline animal data.

Returns:

A DataFrame with index as scenarios and columns for carcass weight in kg and by beef systems.

Return type:

DataFrame

compute_system_total_protein_exports(scenario_animal_data, baseline_animal_data)[source]

Calculates the total protein exported by the entire system, assuming specific milk and beef protein contents.

Parameters:
  • scenario_animal_data (DataFrame) – Animal data for different scenarios.

  • baseline_animal_data (DataFrame) – Baseline animal data.

Returns:

A DataFrame with index as scenarios and columns for total protein, milk protein, and beef protein in kg.

Return type:

DataFrame