XPalm

A process-based model for simulating oil palm (Elaeis guineensis) growth and development.
https://github.com/palmstudio/xpalm.jl

Category: Consumption
Sub Category: Agriculture and Nutrition

Keywords from Contributors

plants

Last synced: about 4 hours ago
JSON representation

Repository metadata

A crop model for Oil Palm

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:

pkg> add XPalm

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

using XPalm

Quick Start

From the Julia REPL, load the package:

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:

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:

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:

# Read the parameters from a YAML file (provided in the example folder of the package).
using YAML
parameters = YAML.load_file(joinpath(dirname(dirname(pathof(XPalm))), "examples/xpalm_parameters.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" => (:leaf_area, :biomass_bunch_harvested),
        "Soil" => (:ftsw,)
    ),
    palm = p,
)

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

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:

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).

using XPalm
using XPalm.VPalm
using PlantGeom, CairoMakie

# Load example parameters
file = joinpath(dirname(dirname(pathof(XPalm))), "test", "references", "vpalm-parameter_file.yml")
parameters = read_parameters(file)

mtg = build_mockup(parameters)

plantviz(mtg, color = :green)

palm plant

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.

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.

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'

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 3 days ago

Total Commits: 467
Total Committers: 7
Avg Commits per committer: 66.714
Development Distribution Score (DDS): 0.139

Commits in past year: 141
Committers in past year: 6
Avg Commits per committer in past year: 23.5
Development Distribution Score (DDS) in past year: 0.213

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
dependabot[bot] 4****] 2
CompatHelper Julia c****y@j****g 2

Committer domains:


Issue and Pull Request metadata

Last synced: about 1 month ago

Total issues: 61
Total pull requests: 46
Average time to close issues: about 1 month
Average time to close pull requests: about 1 month
Total issue authors: 6
Total pull request authors: 5
Average comments per issue: 0.2
Average comments per pull request: 0.15
Merged pull request: 32
Bot issues: 0
Bot pull requests: 12

Past year issues: 45
Past year pull requests: 34
Past year average time to close issues: 3 days
Past year average time to close pull requests: 6 days
Past year issue authors: 6
Past year pull request authors: 5
Past year average comments per issue: 0.16
Past year average comments per pull request: 0.15
Past year merged pull request: 20
Past year bot issues: 0
Past year bot pull requests: 10

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/palmstudio/xpalm.jl

Top Issue Authors

  • VEZY (48)
  • Samuel-amap (4)
  • thomasarsouze (4)
  • rpaperez (2)
  • lailanhabibah (2)
  • JuliaTagBot (1)

Top Pull Request Authors

  • VEZY (24)
  • github-actions[bot] (8)
  • Samuel-amap (6)
  • dependabot[bot] (4)
  • thomasarsouze (4)

Top Issue Labels

  • VPalm (6)
  • hypothesis (1)
  • enhancement (1)
  • documentation (1)

Top Pull Request Labels

  • dependencies (4)
  • github_actions (2)

Package metadata

juliahub.com: XPalm

A crop model for Oil Palm

  • Homepage: https://palmstudio.github.io/XPalm.jl/dev/
  • Documentation: https://docs.juliahub.com/General/XPalm/stable/
  • Licenses: MIT
  • Latest release: 0.5.0 (published 7 months ago)
  • Last Synced: 2026-01-11T13:36:29.190Z (3 days ago)
  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 8.429%
    • Average: 22.378%
    • Dependent packages count: 36.328%

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

Score: -Infinity