Skip to content

openalea/PyRATP

Repository files navigation

PyRATP

Docs Build Status Python Version License Anaconda-Server Badge

Software

Authors

  • Herve Sinoquet
  • Marc Saudreau
  • Jerome Ngao
  • Boris Adam
  • Christophe Pradal
  • Christian Fournier
  • Fabrice Bauget

Description

RATP: Radiation Absorption, Transpiration and Photosynthesis

Status

Python package

License

CecILL-C URL : https://pyratp.rtfd.io

Dependencies

  • meson-python
  • numpy
  • pandas
  • scipy
  • openalea.plantgl
  • openalea.mtg
  • QtPy

Modifications

  • Installation with make: it compiles fortran part with f2py then installs the package with setuptools and pip
  • Compute transmitted radiation for each voxel
  • Intercepted and transmitted radiation among the output results
  • leaf angle distribution for each voxel
  • Local or solar hour option for computing sun position
  • Possibility for external use of the sun computation routine

Installation

for user

  1. Install Miniforge: https://github.com/conda-forge/miniforge
  2. Create a conda environment:
mamba create -n pyratp openalea.ratp -c conda-forge -c openalea3
  1. activate the environment: mamba activate pyratp

The user has the possibility to install the package from a candicate release channel of the conda repository of openalea as follows:

mamba create -n pyratp openalea.ratp -c conda-forge -c openalea3/label/rc

The rc channel corresponds to the latest build of PyRatp when the main channel is the stable release.

For developpers Linux (python modification only)

Editable install with conda/environment.yml is not functionning because of namespace conflict. A workaround is as follow:

  1. download the repository and change to the root directory:
   git clone https://github.com/openalea/PyRATP.git
   cd PyRATP
  1. Create a conda environment with dependencies manually with:
mamba create -n pyratp  -c openalea3 -c conda-forge  openalea.plantgl openalea.mtg qtpy compilers meson-python gfortran scipy pytest jupyter
  1. activate the environment: mamba activate pyratp

  2. Build the fortran library:

meson setup builddir
meson compile -C builddir
cp builddir/src/openalea/ratp/pyratp.cpython-31*.so src/openalea/ratp
  1. modify the Python path: via the environment variable
export PYTHONPATH="$PWD/src":$PYTHONPATH

For developpers (python and fortran modifications)

Editable install with conda/environment.yml is not functionning because of namespace conflict. A workaround is as follow:

  1. download the repository and change to the root directory:
   git clone https://github.com/openalea/PyRATP.git
   cd PyRATP
  1. Create a conda environment with dependencies manually:

Using MAC and Linux:

mamba create -n pyratp_dev -c conda-forge -c openalea3 openalea.plantgl openalea.mtg qtpy compilers meson-python scipy pytest jupyter

Using Windows:

mamba create -n pyratp_dev -c conda-forge -c openalea3 openalea.plantgl openalea.mtg qtpy m2w64-toolchain meson-python scipy pytest gfortran jupyter
  1. activate the environment: mamba activate pyratp_dev

  2. Compile everything:

pip install ."[test]"

and after each modification of the python or Fortran part, run

pip install .

then restart your kernel (when using IPython) for your modifications to be taken into account.

  1. Have a look at the notebooks and scripts in example/!