XPalm

A crop model for Oil Palm

https://github.com/palmstudio/xpalm.jl

Science Score: 44.0%

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

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.1%) to scientific vocabulary

Keywords from Contributors

plants interpretability hacking mesh matrix-exponential standardization pde numeric fspm pinn
Last synced: 6 months ago · JSON representation ·

Repository

A crop model for Oil Palm

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

README.md

XPalm - Growth and yield model for oil palm

Dev Build Status Coverage ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

Overview

XPalm is a process-based model for simulating oil palm (Elaeis guineensis) growth and development. The model simulates key physiological processes including:

  • Phenology and development
  • Carbon assimilation and allocation
  • Water balance
  • Reproductive organ development
  • Yield components

XPalm diagram

Figure 1. Simplified diagram of the component models used in XPalm. The numbering is associated to the computational flow, from the first models to execute to the last.

XPalm implements a multiscale approach, modeling processes at different organizational levels:

Scene: Environment and canopy-level processes Plant: Whole palm processes Phytomer: Individual growth unit processes Organ: Leaf, internode and reproductive organ processes

The model uses a daily time step and requires standard meteorological inputs (temperature, radiation, rainfall...).

The model also includes a submodule VPalm to design palm tree mockups from a set of architectural parameters and allometric equations. It is designed to integrate smoothly with the physiological models from the package.

The model is implemented in the Julia programming language, which is a high-level, high-performance dynamic programming language for technical computing.

Example outputs

Here are some example outputs from the model, showing the evolution of variables at different scales:

Scene level:

Leaf area index (LAI) at the scene level over time:

scene level

Plant level:

Maintenance respiration (Rm), absorbed PPFD (aPPFD), biomass of bunches harvested, and leaf area at the plant level over time:

plant level

Leaf level:

Leaf area at the level of the individual leaf over time:

leaf level

Soil level:

Fraction of transpirable soil water (FTSW) over time:

soil level

Installation

Install XPalm using Julia's package manager, typing ] in the Julia REPL (i.e. the console) to enter the Pkg REPL mode and then typing:

julia pkg> add XPalm

To use the package, type the following in the Julia REPL:

julia using XPalm

Quick Start

From the Julia REPL, load the package:

julia using XPalm

The easiest way of running the model

The easiest way to run the model is to use the template notebook provided by the package. To run the notebook, you need to install the Pluto package first by running ] add Pluto. Then, you can run the notebook using the following commands in the Julia REPL:

julia using Pluto, XPalm XPalm.notebook("xpalm_notebook.jl")

This command will create a new Pluto notebook (named "xpalm_notebook.jl") in the current directory, and open it automatically for you.

Once closed, you can re-open this notebook by running the same command again. If the file already exists, it will be opened automatically.

Programmatically running the model

Basic simulation

Run a simple simulation using default parameters and meteorological data:

```julia using XPalm, CSV, DataFrames

Load example meteorological data

meteo = CSV.read(joinpath(dirname(dirname(pathof(XPalm))), "0-data/meteo.csv"), DataFrame)

Run simulation

df = xpalm(meteo, DataFrame; vars = Dict("Scene" => (:lai,)), # Request LAI as output ) ```

!!! note You need to install the CSV and DataFrames packages to run the example above. You can install them by running ] add CSV DataFrames.

Advanced Usage

Customize palm parameters and request multiple outputs:

```julia

Read the parameters from a YAML file (provided in the example folder of the package).

using YAML parameters = YAML.loadfile(joinpath(dirname(dirname(pathof(XPalm))), "examples/xpalmparameters.yml"))

Load example meteorological data

meteo = CSV.read(joinpath(dirname(dirname(pathof(XPalm))), "0-data/meteo.csv"), DataFrame)

Create palm with custom parameters

p = XPalm.Palm(parameters=parameters)

Run simulation with multiple outputs

results = xpalm( meteo, DataFrame, vars = Dict( "Scene" => (:lai,), "Plant" => (:leafarea, :biomassbunch_harvested), "Soil" => (:ftsw,) ), palm = p, ) ```

You can also import the parameters from a JSON file using the JSON package:

julia using JSON # You first need to install the JSON package by running `] add JSON` params = open(joinpath(dirname(dirname(pathof(XPalm))), "examples/xpalm_parameters.json"), "r") do io JSON.parse(io; dicttype=Dict{String,Any}, inttype=Int64) end

!!! note The configuration file must contain all the parameters required by the model. Template files are available from the examples folder.

Importing the models

The models are available from the Models submodule. To import all models, you can use the following command:

julia using XPalm using XPalm.Models

More examples

The package provides an example script in the examples folder. To run it, you first have to place your working directory inside the folder, and then activate its environement by running ] activate ..

You can also find example applications in the Xpalm applications Github repository.

VPalm

The package also includes a submodule VPalm that is an automaton that builds 3d mockups of palm plants from architectural parameters and allometric equations. It also integrates a biomechanical model to compute the leaf bending and torsion using the biomass of each leaf.

You can run VPalm simply by loading the submodule. Here is an example to load VPalm default parameters and build a palm tree with a multiscale architecture defined using the Multiscale Tree Graph format (MTG).

```julia using XPalm using XPalm.VPalm using PlantGeom, CairoMakie

Load example parameters

file = joinpath(dirname(dirname(pathof(XPalm))), "test", "references", "vpalm-parameterfile.yml") parameters = readparameters(file)

mtg = build_mockup(parameters)

plantviz(mtg, color = :green) ```

palm plant

Code to reproduce this image To reproduce the image above, you can use the following code snippet. It will create a mockup of a palm plant with colored segments based on their type. ```julia using XPalm using XPalm.VPalm using PlantGeom, CairoMakie file = joinpath(dirname(dirname(pathof(XPalm))), "test", "references", "vpalm-parameter_file.yml") parameters = read_parameters(file) mtg = build_mockup(parameters; merge_scale=:leaflet) traverse!(mtg) do node if symbol(node) == "Petiole" petiole_and_rachis_segments = descendants(node, symbol=["PetioleSegment", "RachisSegment"]) colormap = cgrad([colorant"peachpuff4", colorant"blanchedalmond"], length(petiole_and_rachis_segments), scale=:log2) for (i, seg) in enumerate(petiole_and_rachis_segments) seg[:color_type] = colormap[i] end elseif symbol(node) == "Leaflet" node[:color_type] = :mediumseagreen elseif symbol(node) == "Leaf" # This will color the snags node[:color_type] = :peachpuff4 end end f, ax, p = plantviz(mtg, color=:color_type) save("palm_mockup.png", f, size=(1200, 800), px_per_unit=3, update=false) ```

Note that the MTG is built with the following scales: ["Plant", "Stem", "Phytomer", "Internode", "Leaf", "Petiole", "PetioleSegment", "Rachis", "RachisSegment", "Leaflet", "LeafletSegment"].

Funding

This work is supported by the PalmStudio research project, funded by the SMART Research Institute and CIRAD.

Owner

  • Name: PalmStudio research project
  • Login: PalmStudio
  • Kind: organization

Oil Palm modelling

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: 'XPalm.jl : A model for Oil Palm '
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - orcid: 'https://orcid.org/0000-0002-0808-1461'
    given-names: Rémi
    family-names: Vezy
    email: remi.vezy@cirad.fr
    affiliation: CIRAD
  - given-names: Raphael
    name-particle: P.A.
    family-names: Perez
    email: raphael.perez@cirad.fr
    affiliation: CIRAD
    orcid: 'https://orcid.org/0000-0001-5270-9212'
  - given-names: Thomas
    family-names: Arsouze
    email: thomas.arsouze@cirad.fr
    affiliation: CIRAD
    orcid: 'https://orcid.org/0000-0002-8871-6120'
  - given-names: Jean
    family-names: Dauzat
    affiliation: CIRAD
identifiers:
  - type: swh
    value: 'swh:1:dir:a92b3660e4387b5ffc4a915c849bea7c0808b199'
repository-code: 'https://github.com/PalmStudio/XPalm.jl'
url: 'https://palmstudio.github.io/XPalm.jl/stable/'
abstract: >-
  XPalm is a process-based model for simulating oil palm
  (Elaeis guineensis) growth and development. The model
  simulates key physiological processes at different
  organizational levels, using a multiscale approach.
keywords:
  - FSPM
  - Oil Palm
  - Elaeis guineensis
  - Modeling
  - Growth
  - Development
  - Julia language
license: MIT
commit: f5842c4ea02aafa48443311f46a82a0c3fcba32a
version: 0.3.3
date-released: '2025-06-04'

GitHub Events

Total
  • Create event: 30
  • Commit comment event: 28
  • Release event: 6
  • Issues event: 49
  • Watch event: 4
  • Delete event: 19
  • Member event: 1
  • Issue comment event: 28
  • Push event: 222
  • Pull request review comment event: 1
  • Pull request review event: 8
  • Pull request event: 37
Last Year
  • Create event: 30
  • Commit comment event: 28
  • Release event: 6
  • Issues event: 49
  • Watch event: 4
  • Delete event: 19
  • Member event: 1
  • Issue comment event: 28
  • Push event: 222
  • Pull request review comment event: 1
  • Pull request review event: 8
  • Pull request event: 37

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 466
  • Total Committers: 7
  • Avg Commits per committer: 66.571
  • Development Distribution Score (DDS): 0.137
Past Year
  • Commits: 267
  • Committers: 6
  • Avg Commits per committer: 44.5
  • Development Distribution Score (DDS): 0.112
Top Committers
Name Email Commits
Rémi Vezy V****Y 402
raphael perez r****z@c****r 34
thomasarsouze t****e@z****m 12
github-actions[bot] 4****] 8
Samuel-AMAP s****n@c****r 7
CompatHelper Julia c****y@j****g 2
dependabot[bot] 4****] 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 59
  • Total pull requests: 36
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 21 days
  • Total issue authors: 6
  • Total pull request authors: 5
  • Average comments per issue: 0.32
  • Average comments per pull request: 0.17
  • Merged pull requests: 26
  • Bot issues: 0
  • Bot pull requests: 6
Past Year
  • Issues: 53
  • Pull requests: 35
  • Average time to close issues: 4 days
  • Average time to close pull requests: 5 days
  • Issue authors: 6
  • Pull request authors: 5
  • Average comments per issue: 0.28
  • Average comments per pull request: 0.14
  • Merged pull requests: 25
  • Bot issues: 0
  • Bot pull requests: 6
Top Authors
Issue Authors
  • VEZY (48)
  • thomasarsouze (4)
  • rpaperez (2)
  • Samuel-amap (2)
  • lailanhabibah (2)
  • JuliaTagBot (1)
Pull Request Authors
  • VEZY (24)
  • Samuel-amap (6)
  • github-actions[bot] (4)
  • thomasarsouze (4)
  • dependabot[bot] (3)
Top Labels
Issue Labels
VPalm (6) hypothesis (1) enhancement (1) documentation (1)
Pull Request Labels
dependencies (3) github_actions (1)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 9
juliahub.com: XPalm

A crop model for Oil Palm

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 8.4%
Average: 22.4%
Dependent packages count: 36.3%
Last synced: 6 months ago

Dependencies

.github/workflows/CI.yml actions
  • actions/checkout v2 composite
  • codecov/codecov-action v2 composite
  • julia-actions/cache v1 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-docdeploy v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/CompatHelper.yml actions