Skip to main content

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

license python Code style: black

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

livestock_generation-0.2.2.tar.gz (37.1 kB view details)

Uploaded Source

Built Distribution

livestock_generation-0.2.2-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

Details for the file livestock_generation-0.2.2.tar.gz.

File metadata

  • Download URL: livestock_generation-0.2.2.tar.gz
  • Upload date:
  • Size: 37.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.0 Linux/5.15.0-106-generic

File hashes

Hashes for livestock_generation-0.2.2.tar.gz
Algorithm Hash digest
SHA256 e7ddff22334fbf9177f705b41c2788471ab1a5f8ebf1fda799fb9829bb90d9f9
MD5 3731bff2ac080b44be990bb55c72103b
BLAKE2b-256 74dadb0e5d12baf809e60be4314085a936bfe50e3dd4c4d54ccdf9a4b103ff6b

See more details on using hashes here.

File details

Details for the file livestock_generation-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for livestock_generation-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b31302f05b8faed30534a692f79fec99514bcfceba1b237cc56a328b8ce47178
MD5 fafcd004a54fdcf181c9c072f105aff7
BLAKE2b-256 bd86f2fde02122e80a0d0d358b147a56d7411fe97517b514ac0fa21474f610dd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page