A tool that uses Ireland specific data to generate a baseline and scenario livestock herds for sheep and cattle.
Project description
🐄🐏 Livstock generation tool for cattle herds and sheep flocks
Based on the GOBLIN (General Overview for a Backcasting approach of Livestock INtensification) Cattle herd module. The package is designed to take as inputs the scenario parameters, while outputing dataframes of animal parameters for scenarios and the chosen baseline year. It also contains classes to export milk and beef outputs.
The package contains libraries for both catchment and national herd generation. For national herd generation, the package is shipped with key data for past herd numbers, concentrate feed inputs, and animal features. The catchment level herd numbers rely on data derived from CSO Ireland.
The package is structured as:
src/
│
├── livestock_generation/
│ └── ... (other modules and sub-packages)
│
├── geo_livestock_generation/
| └── ... (other modules and sub-packages)
The geo_livestock_generation
modules are used for catchment level analysis, while the livestock_generation
modules are used for national
level analysis.
The package is currently parameterised for Ireland, the framework can be adapted for other contexts.
Outputs dataframes based on scenario inputs in relation to:
- Livestock by cohort
- Livestock population
- Daily milk
- Live weight
- Forage type
- Grazing type
- Concentrate input type and quantity
- Time outdoors, indoors and stabled
- Wool
- Manure management systems
- Daily spread systems
- Number bought and sold
Installation
Install from git hub.
pip install "livestock_generation@git+https://github.com/GOBLIN-Proj/livestock_generation.git@main"
Install from PyPI
pip install livestock_generation
Usage
from livestock_generation.livestock import AnimalData
from livestock_generation.livestock_exports import Exports
import pandas as pd
import os
def main():
# Create the DataFrame with the provided data, this represents scenario inputs
path = "./data/"
scenario_dataframe = pd.read_csv(os.path.join(path, "scenario_input_dataframe.csv"))
# create additional parameters
baseline_year = 2020
target_year = 2050
ef_country = "ireland"
# create classes for the generation of animal data and livestock ouput data
animal_class = AnimalData(ef_country, baseline_year, target_year, scenario_dataframe)
export_class = Exports(ef_country, baseline_year, target_year, scenario_dataframe)
# create dataframe for baseline year animals
baseline_data = animal_class.create_baseline_animal_dataframe()
# create dataframe for scenarios animals
scenario_data = animal_class.create_animal_dataframe()
scenario_data.to_csv("./data/example_scenario_animal_data_test.csv")
if __name__ == "__main__":
main()
License
This project is licensed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file livestock_generation-0.2.1.tar.gz
.
File metadata
- Download URL: livestock_generation-0.2.1.tar.gz
- Upload date:
- Size: 37.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.0 Linux/5.15.0-105-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad16bb0429702fe678b5442e645819d3166b55706c8cabda84a1bfef9fb67368 |
|
MD5 | 3b52c1cb01c615d9c14b684e8ae4a872 |
|
BLAKE2b-256 | 74f287cd05d5f0da6e3235ed2ba5d0ebe59e560cc0b774da841622810133e272 |
File details
Details for the file livestock_generation-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: livestock_generation-0.2.1-py3-none-any.whl
- Upload date:
- Size: 41.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.0 Linux/5.15.0-105-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d00deac0369e31e6f0fd4721843bfd77a7c95c913fc3f6e2961b22d6f8076b3c |
|
MD5 | 6fd2ec3b6df5bffe182a9892b0feae65 |
|
BLAKE2b-256 | 809ef8f4077203336443c4c8b5185f2b5e0ca2825e2553dc7fe172bc887d6558 |