AgriFoodPy

AgriFoodPy: a package for modelling food systems - Published in JOSS (2024)

https://github.com/fixourfood/agrifoodpy

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in JOSS metadata
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Psychology Social Sciences - 40% confidence
Last synced: 4 months ago · JSON representation

Repository

Collection of methods to handle food data

Basic Info
Statistics
  • Stars: 4
  • Watchers: 0
  • Forks: 5
  • Open Issues: 9
  • Releases: 2
Created almost 4 years ago · Last pushed 4 months ago
Metadata Files
Readme Contributing

README.md

AgriFoodPy

Documentation Status Tests

AgriFoodPy is a collection of methods for manipulating and modelling agrifood data. It provides modelling for a variety of aspects of the food system, including food consumption paterns, environmental impact and emissions data, population and land use. It also provides an interface to run external models by using xarray as the data container.

AgriFoodPy also provides a pipeline manager to build end-to-end simulations and analysis toolchains. Modules can also be executed in standalone mode, which does not require a pipeline to be defined.

In addition to this package, we have also pre-packaged some datasets for use with agrifood. These can be found on the agrifoodpy_data repository https://github.com/FixOurFood/agrifoodpy-data

Installation:

AgriFoodPy can be installed using pip, by running

bash pip install agrifoodpy

UK data to test the package is available from the agrifoodpy_data repository which currently can be installed using

bash pip install git+https://github.com/FixOurFood/agrifoodpy-data.git@importable

Usage:

AgriFoodPy modules can be used to manipulate food system data in standalone mode or by constructing a pipeline of modules which can be executed partially or completely.

To build a pipeline ```python from agrifoodpy.pipeline import Pipeline from agrifoodpy.utils.loaddataset import loaddataset from agrifoodpy.food.model import import matplotlib.pyplot as plt

Create pipeline object

fs = Pipeline()

Add node to load food balance sheet data from external module.

fs.addnode(loaddataset, { "datablockpath": "food", "module": "agrifoodpydata.food", "data_attr": "FAOSTAT", "coords": {"Year":np.arange(1990, 2010), "Region":229} })

Add node convert scale Food Balance Sheet by a constant

fs.addnode(fbsconvert, { "fbs":"food", "convertion_arr":1e-6 # From 1000 Tonnes to kg })

fs.run()

results = fs.datablock ```

Examples and documentation

Examples demonstrating the functionality of AgriFoodPy can be the found in the package documentation. These include the use of accessors to manipulate data and access to basic models.

Contributing

AgriFoodPy is an open-source project which aims at improving the transparency of evidence base food system interventions and policy making. As such, we are happy to hear the input and ideas from the community.

If you want to contribute, have a look at the discussions page or open a new issue

For a comprehensive guide, please refer to the contributing guidelines to open a pull request to contribute new functionality

Owner

  • Name: FixOurFood
  • Login: FixOurFood
  • Kind: organization
  • Location: United Kingdom

JOSS Publication

AgriFoodPy: a package for modelling food systems
Published
May 27, 2024
Volume 9, Issue 97, Page 6305
Authors
Juan P. Cordero ORCID
Department of Environment and Geography Wentworth Way, University of York, Heslington, York, YO10 5NG, United Kingdom
Kevin Donkers ORCID
Land, Environment, Economics and Policy Institute (LEEP), University of Exeter Business School, Exeter, United Kingdom
Ian Harrison ORCID
School of Physics and Astronomy, Cardiff University, Cardiff CF24 3AA, United Kingdom
Sarah L. Bridle ORCID
Department of Environment and Geography Wentworth Way, University of York, Heslington, York, YO10 5NG, United Kingdom
Angelina Frankowska ORCID
Centre for Environmental and Agricultural Informatics, School of Water, Energy and Environment, Cranfield University, Cranfield MK43 0AL, United Kingdom
Michelle Cain ORCID
Centre for Environmental and Agricultural Informatics, School of Water, Energy and Environment, Cranfield University, Cranfield MK43 0AL, United Kingdom
Neil Ward ORCID
School of Environmental Sciences, University of East Anglia, Norwich, United Kingdom
Jez Frendenburgh
School of Environmental Sciences, University of East Anglia, Norwich, United Kingdom
Edward Pope ORCID
Land, Environment, Economics and Policy Institute (LEEP), University of Exeter Business School, Exeter, United Kingdom
Alana Kluczkovski ORCID
Centre for Novel Agricultural Products (CNAP), Department of Biology, University of York, York, YO10 5DD, United Kingdom
Ximena Schmidt ORCID
Equitable Development and Resilience Research Group, College of Engineering, Design and Physical Science, Brunel University London, London, UB8 3PH, United Kingdom
Jacqueline Silva ORCID
Global Academy of Agriculture and Food Systems, The University of Edinburgh. Charnock Bradley Building, Easter Bush Campus, EH25 9RG.
Christian Reynolds ORCID
Centre for Food Policy, City, University of London, Northampton Square, London, EC1V 0HB, United Kingdom
Katherine Denby ORCID
Centre for Novel Agricultural Products (CNAP), Department of Biology, University of York, York, YO10 5DD, United Kingdom
Bob Doherty ORCID
School for Business and Society, University of York
Aled Jones ORCID
Global Sustainability Institute, Anglia Ruskin University, Cambridge CB1 1PT, United Kingdom
Editor
Chris Vernon ORCID

GitHub Events

Total
  • Watch event: 1
  • Pull request event: 2
  • Fork event: 1
Last Year
  • Watch event: 1
  • Pull request event: 2
  • Fork event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 81
  • Total Committers: 2
  • Avg Commits per committer: 40.5
  • Development Distribution Score (DDS): 0.123
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Juan j****o@p****k 71
Sarah Bridle g****b@s****t 10
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 38
  • Total pull requests: 48
  • Average time to close issues: 5 months
  • Average time to close pull requests: 9 days
  • Total issue authors: 5
  • Total pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.25
  • Merged pull requests: 41
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 39 minutes
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jucordero (21)
  • kanishkan91 (7)
  • kaedonkers (5)
  • sarahbridle (3)
  • jsun (1)
Pull Request Authors
  • jucordero (48)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 146 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
pypi.org: agrifoodpy

A package for modelling food systems

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 146 Last month
Rankings
Dependent packages count: 10.0%
Average: 38.8%
Dependent repos count: 67.6%
Maintainers (1)
Last synced: 4 months ago

Dependencies

setup.py pypi
.github/workflows/test-conda.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
docs/requirements.txt pypi
  • myst-parser *
  • netcdf4 *
  • sphinx-autoapi *
  • sphinx-gallery *
  • sphinx_rtd_theme *
environment.yml pypi
  • fair *