Skip to content

FFC model - #110

Merged
jucordero merged 8 commits into
mainfrom
ffc_model
Aug 5, 2026
Merged

jucordero merged 8 commits into
mainfrom
ffc_model

Conversation

@jucordero

Copy link
Copy Markdown
Collaborator

Description

This PR implements several food system models and functionalities into AgriFoodPy:

Functionality:

  • Pipeline parser using yaml file descriptors
  • Ability to call constructors in the yaml file parser for rapid node characterisation
  • New function decorator to call arbitrary functions as pipeline nodes and capture their outputs to write into the datablock
  • New options for land plotting accessor function

Models:

  • Projecting food balance sheets by population
  • Projecting datasets along the Year dimension
  • Land scaling as a function of production change
  • Production scaling as a function of land use change

Checklist

jucordero and others added 8 commits May 5, 2026 16:05
* Changes to food scaling function

* scale above threshold, deprecated drop in tests

* Guard against fallback being defined but origin being not

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* accept scalar conv_arr, fixed conversion, input params in pipeline mode

* unit tests, fixed behaviour of scale parameter

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
* added land conversion methods

* unit tests and docs

* fixed mask and value_array validation in add_category
* added food scaling from land function

* Update agrifoodpy/food/model.py

multiple sum

Co-authored-by: Juan Pablo Cordero <[email protected]>

* Update agrifoodpy/food/model.py

Co-authored-by: Juan Pablo Cordero <[email protected]>

* Update agrifoodpy/food/model.py

removed land_dimension option

Co-authored-by: Juan Pablo Cordero <[email protected]>

* Update agrifoodpy/food/model.py

Co-authored-by: Juan Pablo Cordero <[email protected]>

* added unittest and characters limit

* Update agrifoodpy/food/model.py

Co-authored-by: Juan Pablo Cordero <[email protected]>

* Update agrifoodpy/food/model.py

Co-authored-by: Juan Pablo Cordero <[email protected]>

* Update agrifoodpy/food/model.py

Co-authored-by: Juan Pablo Cordero <[email protected]>

* removed datablock and out_key from food_scaling_from_land

---------

Co-authored-by: Juan Pablo Cordero <[email protected]>
* projecting food balance sheet by population

* Removed stale tests

* fixed docs, guards for zero denoms, consistent docs

* changed labelling for no show parameters in plot functions

* unit tests
* additional scalings and new parser constructor

* updated docs
* multiple return keys for tuple returning functions

* return key validation and tuple keys

* fixed docstrings
* options for land plot

* updated label values
@jucordero jucordero changed the title Ffc model FFC model Aug 5, 2026
@jucordero
jucordero merged commit 7a4eb2a into main Aug 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants