Skip to content

Commit

Permalink
Merge pull request #27 from fredboudon/master
Browse files Browse the repository at this point in the history
Update LPy to the new fresh Py3 version
  • Loading branch information
pradal authored Mar 31, 2022
2 parents 1a89959 + aa387bb commit a8328fe
Show file tree
Hide file tree
Showing 439 changed files with 61,113 additions and 7,148 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/conda-package-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Building Package using Conda

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]


jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
#max-parallel: 5
matrix:
os: [ macos-latest, ubuntu-latest]
env:
- CONDA_PY: "37"
CONDA_NPY: "111"
- CONDA_PY: "38"
CONDA_NPY: "116"
- CONDA_PY: "39"
CONDA_NPY: "119"

environment: anaconda_build

steps:
- uses: actions/checkout@v2

- name: Add conda to system path
run: |
# Add conda to system path
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Setup conda
run: |
# Setup conda
sudo conda config --add channels conda-forge
sudo conda config --add channels fredboudon
sudo conda config --set always_yes yes
sudo conda config --set remote_read_timeout_secs 600
sudo conda config --set auto_update_conda False
sudo conda install conda-build anaconda-client
- name: Build
env:
CONDA_PY: ${{ matrix.env.CONDA_PY }}
CONDA_NPY: ${{ matrix.env.CONDA_NPY }}
run: |
# Build
if [[ "$CONDA_PY" = "" ]]; then
echo "CONDA_PY is not defined"
exit -1
fi
if [[ "$CONDA_NPY" = "" ]]; then
echo "CONDA_NPY is not defined"
exit -1
fi
export PYTHON_VERSION=${CONDA_PY:0:1}.${CONDA_PY:1:1}
export NUMPY_VERSION=${CONDA_NPY:0:1}.${CONDA_NPY:1:2}
export BUILD_CMD="sudo conda build . --python=$PYTHON_VERSION"
export BUILD_OUTPUT=`$BUILD_CMD --output`
if [[ "$BUILD_OUTPUT" = "" ]]; then
echo "PACKAGE NAME is not defined"
exit -1
fi
echo "BUILD_OUTPUT=$BUILD_OUTPUT" >> $GITHUB_ENV
$BUILD_CMD
- name: Login
env:
ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
ANACONDA_PASSWORD: ${{ secrets.ANACONDA_PASSWORD }}
run: |
# Login
if [[ "$ANACONDA_LOGIN" = "" ]]; then
echo "ANACONDA_LOGIN is not defined"
exit -1
fi
SESSION_UID=$(uuidgen)
anaconda login --username $ANACONDA_LOGIN --password $ANACONDA_PASSWORD --hostname $SESSION_UID
- name: Deploy
env:
ANACONDA_OWNER: ${{ secrets.ANACONDA_OWNER }}
BUILD_OUTPUT: ${{ env.BUILD_OUTPUT }}
run: |
# Deploy
if [[ "$ANACONDA_OWNER" = "" ]]; then
echo "ANACONDA_OWNER is not defined"
exit -1
fi
echo "PACKAGE NAME:" $BUILD_OUTPUT
if [[ "$BUILD_OUTPUT" = "" ]]; then
echo "PACKAGE NAME is not defined"
exit -1
fi
anaconda upload --skip-existing $BUILD_OUTPUT -u $ANACONDA_OWNER --no-progress
37 changes: 34 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ src/openalea/lpy/gui/logdialog.py
src/openalea/lpy/gui/logindialog.py
src/openalea/lpy/gui/lpymainwindow.py
src/openalea/lpy/gui/lpyprefwidget.py
src/openalea/lpy/gui/lpyresources_rc.py
src/openalea/lpy/gui/py2exe_release.py
#src/openalea/lpy/gui/lpyresources_rc.py
src/openalea/lpy/gui/scalarfloatmetaedit.py
src/openalea/lpy/gui/scalarmetaedit.py

# lpy temp file
*.lpy~
*.py~
\#*\#

# C extensions
build-scons
Expand All @@ -28,11 +31,12 @@ build-scons_qt5
*.so
*.dll
*.dblite
*.lib
*.o

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
Expand All @@ -47,6 +51,9 @@ var/
.installed.cfg
*.egg

# build/


# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down Expand Up @@ -80,5 +87,29 @@ doc/_build/doctrees
.idea/
cmake-build-debug/

# Windows config folders
.vscode
.vs

# build folders
build*

# C extensions
*.so
*.dll
*.dblite
*.lib


# build-scons
# build-scons_noqt
# build-scons_qt4
# build-scons_qt5

# PyBuilder
target/
target/

.vscode
build-cmake

.DS_Store
94 changes: 94 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# --- CMake Modules

cmake_minimum_required(VERSION 3.12)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include("Anaconda")
include("pywrapper")

# --- L-Py Project

project(lpy_project CXX)

# --- Build setup

set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)

if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif("${isSystemDir}" STREQUAL "-1")



# --- CXX11 Compilation

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")

# --- (Win32) Multithreaded Compilation

if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif()

## When linking, Python libs are required, so I advised I could use: "target_library_link(targetname ${Python3_LIBRARIES})"
## But AppleClang has difficulties linking with Python3_LIBRARIES, I don't know why.
## It DOES link with it, but when running it crashes mysteriously on a Python Malloc (what???)
## instead, I use this undefined dynamic_lookup flag to let the dynamic libraries be found when run.
if (APPLE)
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup")
endif()

## ###################################################################
## Dependencies
## ###################################################################

# --- Python

find_package (Python3 COMPONENTS Interpreter Development REQUIRED)
include_directories(${Python3_INCLUDE_DIRS})

# --- Libraries

find_package(Threads REQUIRED)
find_package(Qt5Core CONFIG REQUIRED)
find_package(Qt5Concurrent CONFIG REQUIRED)
find_package(PlantGL REQUIRED)

set(Boost_NO_SYSTEM_PATHS ON)
set(Boost_USE_MULTITHREAD ON)
set(Boost_USE_STATIC_LIBS OFF)
set(BUILD_SHARED_LIBS ON)

if (USE_CONDA)
set(boost_python python)
else()
set(boost_python python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
endif()

find_package(Boost COMPONENTS system ${boost_python} REQUIRED)

# --- Include Directories

include_directories("src/cpp")

include_directories(${Boost_INCLUDE_DIR})

# --- Library Directory

if (DEFINED CONDA_ENV)
link_directories("${CONDA_ENV}/lib")
endif()

# --- Source Directories

add_subdirectory("src/cpp")
add_subdirectory("src/wrapper")

install_share("share" "lpy")
77 changes: 61 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
.. image:: https://img.shields.io/badge/License-GPL-blue.svg
:target: https://opensource.org/licenses/GPL-3.0

.. image:: https://travis-ci.org/openalea/lpy.svg?branch=master
:target: https://travis-ci.org/openalea/lpy
.. image:: https://github.com/fredboudon/lpy/actions/workflows/conda-package-build.yml/badge.svg
:target: https://github.com/fredboudon/lpy/actions/workflows/conda-package-build.yml
:alt: Github Actions Continuous Integration Status

.. image:: https://ci.appveyor.com/api/projects/status/88n43wd5kektlwkf/branch/master?svg=true
.. image:: https://ci.appveyor.com/api/projects/status/8bd8xhc9wy0bee0k/branch/master?svg=true
:target: https://ci.appveyor.com/project/fredboudon/lpy
:alt: AppVeyor Continuous Integration Status

.. image:: https://readthedocs.org/projects/lpy/badge/?version=latest
:target: http://lpy.readthedocs.io/en/latest/
.. image:: https://readthedocs.org/projects/lpy/badge/?version=latest
:target: https://lpy.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status


=======
Expand All @@ -17,39 +20,81 @@ L-Py

L-systems were conceived as a mathematical framework for modeling growth of plants.
L-Py is a simulation software that mixes L-systems construction with the Python high-level modeling language.

In addition to this software module, an integrated visual development environment has been developed that facilitates the creation of plant models.
In particular, easy to use optimization tools have been integrated.
Thanks to Python and its modular approach, this framework makes it possible to integrate a variety of tools defined in different modeling context,
in particular tools from the OpenAlea platform. Additionally, it can be integrated as a simple growth simulation module
Thanks to Python and its modular approach, this framework makes it possible to integrate a variety of tools defined in different modeling context, in particular tools from the OpenAlea platform. Additionally, it can be integrated as a simple growth simulation module
into more complex computational pipelines.

**L-Py** is released under a **CeCILL** license, which is compatible to the **GNU GPL**.

.. image:: doc/_images/screenshot2-3d.png
:scale: 50%

=======
Gallery
=======

.. image:: doc/_images/gallery/gallery.png
:scale: 50%

Examples of models created with L-Py. Images credits: C. Godin, J. Chopard, F. Boudon. Models credits: C. Godin, F. Boudon, F. Normand, I. Grechi, E. Costes, M. Beziz, Y. Caraglio et al.

=============
Installation
=============


``L-Py`` distribution is based on the ``conda`` software environment management system.
To install conda, you may refer to its installation page: https://docs.conda.io/projects/conda/en/latest/user-guide/install/

To install L-Py, you need to create an environment (named for instance lpy) :

.. code-block:: bash
.. contents::
>>> conda create -n lpy openalea.lpy -c fredboudon -c conda-forge
The package ``openalea.lpy`` is retrieved from the ``fredboudon`` channel (developement) and its dependencies will be taken from ``conda-forge`` channel.

Then, you need to activate the L-Py environment

.. code-block:: bash
>>> conda activate lpy
And then run L-Py

.. code-block:: bash
>>> lpy
=============
Documentation
=============

A previous version of the documentation is available at `<http://openalea.gforge.inria.fr/dokuwiki/doku.php?id=packages:vplants:lpy:main>`_
Future documentation will be available at `<http://lpy.readthedocs.io/en/latest/>`_
Documentation is available at `<http://lpy.readthedocs.io/en/latest/>`_


A previous version of the documentation was also available on `OpenAlea website <http://openalea.gforge.inria.fr/dokuwiki/doku.php?id=packages:vplants:lpy:main>`_

Help and Support
----------------

Please open an **Issue** if you need support or that you run into any error (Installation, Runtime, etc.).
Please open an **Issue** if you need support or you run into any error (Installation, Runtime, etc.).
We'll try to resolve it as soon as possible.

=============
Authors
-------

* Frédéric Boudon

With contributions of Christophe Godin, Christophe Pradal et al.
=============

L-Py was mainly developped by Frédéric Boudon with different contributions from Christophe Godin, Christophe Pradal et al.


==============
Citation
==============
If you find our work useful in your research, please consider citing:

- F. Boudon, T. Cokelaer, C. Pradal, P. Prusinkiewicz and C. Godin, L-Py: an L-system simulation framework for modeling plant architecture development based on a dynamic language, Frontiers in Plant Science, 30 May 2012.


Loading

0 comments on commit a8328fe

Please sign in to comment.