Code Monkey home page Code Monkey logo

lpy's Introduction

Build Status Build status

OpenAlea Lab

Documentation

Official documentation is available at openalea.github.io

Install

To install OpenAlea use conda

If you want to retrieve the code from git, use git clone. Then use this command that will retrieve all the submodules::

git submodule update --init --recursive

Contribute

If you want to contribute to code, please have a look to github workflow

lpy's People

Contributors

antoki avatar cgodin avatar cokelaer avatar dbarbeau avatar ethan13310 avatar fredboudon avatar gbaty avatar j-levy avatar jvail avatar jwintz avatar karamokos avatar pradal avatar ricomos avatar rocsg avatar tristancabel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lpy's Issues

input() not working

Hi, I am trying to use input() in our code in the L-Py GUI. However when I click run, it lags and endlessly tries to load. Eventually I just press ^C in the terminal to interrupt it. I am on macOS Monterey with L-Py on python 3.9. On another laptop (Windows) with a python 3.8 version of L-Py, it gives an error message about sys.stdin (might be another name, can't quite remember but can confirm it was "sys").

Is this normal? I had thought pure python code should work. Is there any alternative method?

accessing the turtle directly

Hi,

Is there a way of accessing the turtle commands from Lpy? E.g. if we want to use turtle.write() to label things during modelling is there a way that this can be done?

Many thanks!

Lsystem.animate() shows a blank PlantGL window in Python 3

I recently ported my Python2 code involving OpenAlea mtg and lpy libraries into Python3. With Python3, the Lsystem.animate() now can't invoke PlantGL viewer to show the Lpy animation, instead it shows a blank PlantGL canvas. It was working just fine in Python2 though. Any advice on how to resolve this?
FYI, Lsystem.plot() plot the image just fine in both Python 2 and Python 3 version.

Get attributes back when launching lpy by batch processing

Hello,

I am using a Lsystem and I would like to do a sensitivity analysis.
I wrote a python script to execute the lpy file and I want to get some attributes of the Lsystem back (for instance a dictionnary).
Presently, I use MyLsystem.derive() to execute the .lpy file but no access to attributes is possible. It seems close the Lsystem.
Is there an other method than .derive() to use ?

Kind regards,
Simon

Can't run lpy

Hello, I have installed anaconda and lpy as instructed, I created the environment and activated it, but when I type in lpy nothing happens. do I miss something? I do I access the visual editor?

Thank you very much!

Can't Open Saved PLY File

from openalea.lpy import *

lsystem = Lsystem("massart.lpy")

for lstring in lsystem:
    scene = lsystem.sceneInterpretation(lstring)

scene.save("test.ply")

It did save the test.ply but I can't open it due to error saying Error reading 'vertex_indeces' of 'face' number 8525.

After conda installation, can't run lpy

I'm on linux.
I have created conda enviroment with conda create -n lpy openalea.lpy -c openalea and activated it.
Running lpy gives:

+(lpy) dawid@dawid-Swanky:~/gitrepos/mycelium2d$ lpy
Traceback (most recent call last):
  File "/home/dawid/miniconda3/envs/lpy/bin/lpy", line 11, in <module>
    load_entry_point('VPlants.Lpy==2.7.0', 'gui_scripts', 'lpy')()
  File "/home/dawid/miniconda3/envs/lpy/lib/python2.7/site-packages/pkg_resources/__init__.py", line 572, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/dawid/miniconda3/envs/lpy/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2755, in load_entry_point
    return ep.load()
  File "/home/dawid/miniconda3/envs/lpy/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2408, in load
    return self.resolve()
  File "/home/dawid/miniconda3/envs/lpy/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2414, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/dawid/miniconda3/envs/lpy/lib/python2.7/site-packages/VPlants.Lpy-2.7.0-py2.7-linux-x86_64.egg/openalea/lpy/__init__.py", line 2, in <module>
    from __lpy_kernel__ import *
ImportError: libboost_python.so.1.66.0: cannot open shared object file: No such file or directory

conda list prints that it installed libboost 1.65.1 habcd387_4 so I guess it just installed wrong version of libboost.
I will try install libboost 1.66.0 manually and will tell you if it solves the problem.

Installing Lpy on Windows

Hi,
I am trying to install Lpy on a Windows 10 machine from Conda.

I have installed Conda but I can't install Lpy
The command conda create -n lpy openalea.lpy openalea.plantgl 'boost =1.66.0' -c openalea raises the following error:

Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
  - openalea.lpy
  - openalea.plantgl

Lpy Probleme installation with conda

Dear all,

After running the conda installation for lpy on Linux platform. I have the following error :

Preparing transaction: done
Verifying transaction: done
Executing transaction: failed
ERROR conda.core.link:_execute(481): An error occurred while uninstalling package 'defaults::certifi-2018.1.18-py27_0'.
OSError(13, 'Permission denied')
Attempting to roll back.

Rolling back transaction: done

OSError(13, 'Permission denied')

Could I have some suggestions ?

I thank you in advance for your help,

Didier

Add lpy file in sphinx doc

Hi all,

I have a lpy file on Windows and I would like to add this file in a documentation using Sphinx but don't know how to make the link to a non .py file

TY

Bus error when running lpy

I am simulating osx-64 on an M1 mac and am using openalea.lpy version 3.9.2. Running lpy gives the following errors:

qt.qpa.window: <QNSWindow: 0x7fab8a882260; contentView=<QNSView: 0x7fab8a881e60; QCocoaWindow(0x600002504d10, window=QWidgetWindow(0x60000365db60, name="QWidgetClassWindow"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug.
qt.qpa.window: <QNSWindow: 0x7fab7a6b2100; contentView=<QNSView: 0x7fab7a6a8c00; QCocoaWindow(0x6000025180b0, window=QWidgetWindow(0x600003628c60, name="dockWidgetContents_2Window"))>> has active key-value observers (KVO)! These will stop working now that the window is recreated, and will result in exceptions when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug.
The constructor with a shareWidget is deprecated, use the regular contructor instead.
The constructor with a shareWidget is deprecated, use the regular contructor instead.
zsh: bus error lpy

For some reason, I am unable to download later versions of openalea.lpy using conda, so I am unable to see if later versions have the same behavior.

IPython shell missing on Windows

On Windows, the conda installation works !!!
However, the IPython shell is missing while both qtconsole, jupyter and ipykernel have been installed.

Can't install on Ubuntu 20.04 - UnsatisfiableError

Hello,
Using the command from the documentation conda create -n lpy openalea.lpy -c openalea throws an error on Ubuntu 20.04.

The error :

UnsatisfiableError: The following specifications were found to be incompatible with your CUDA driver:

  - feature:/linux-64::__cuda==10.2=0

Your installed CUDA driver is: 10.2

After some snooping around, it seems the error is not directly related to CUDA driver but rather to other unsatisfied dependecies. I tried some of the workarounds proposed in issue #12 , but to no avail.

Any advice on how to install on a recent Ubuntu install ?

Regards,
Arnaud Bouvry
Liège University

As of Jul 2023: Problems Installing Lpy binaries using Conda

I'm trying to install lpy using conda on one existing environment
conda install openalea.lpy -c fredboudon -c conda-forge
and one new environment:
conda create -n lpy openalea.lpy -c fredboudon -c conda-forge

For the existing environment, strangely after installation and calling "lpy", there is nothing happening. However, for the new environment, "lpy" works and the visual lpy editor appear.
What did I do wrong for the existing environment?

"Segmentation fault (core dumped)" when running in the terminal

OS:ubuntu20.04
I installed the binaries using conda following the instructions in the doc and everything worked well until I restarted my computer. After that I could not run the lpy normally.
When I type conda activate lpy, that's ok. However, when I enter lpy, the lpy main window would flash and close soon with the terminal telling me:
Segmentation fault (core dumped)
I have no idea about what's going on...

Issue with installing lpy on Mac

Hi,

I was having trouble running lpy because qhull wasn't installed. Here is how I got it working:

Created a conda environment:
conda create --name lpy python=3.9

activated the environment:
conda activate lpy

installed quhull:
conda install qhull

installed lpy:
conda install openalea.lpy -c fredboudon -c conda-forge

Export to ply from python

Hi,

I am looking for a way to export a scene to ply format from within python.

Is this possible?

Thanks!

Test Segmentation fault after conda installation

conda create -n lpy -c openalea -c conda-forge openalea.lpy boost=1.66.0 nose
conda activate lpy

git clone https://github.com/openalea/lpy
cd lpy/test
nosetests

Result :

.........................................../home/artzet_s/code/lpy_test/lpy/test/lpytest/multiscalexmatching.lpy:49: UserWarning: Multiscale context and Regular Expression not compatible
  warnings.warn('Multiscale context and Regular Expression not compatible')
/home/artzet_s/code/lpy_test/lpy/test/lpytest/multiscalexmatching.lpy:21: UserWarning: Multiscale context and Regular Expression not compatible
  warnings.warn('Multiscale context and Regular Expression not compatible')
....................<string>:14: Warning: No parameter dictionnay found in arguments. 
..............<string>:28: Warning: No parameter dictionnay found in arguments. 
<string>:31: Warning: No parameter dictionnay found in arguments. 
....<string>:12: Warning: No parameter dictionnay found in arguments. 
<string>:14: Warning: No parameter dictionnay found in arguments. 
................./home/artzet_s/code/lpy_test/lpy/test/test_lpytest.py:14: Warning: Invalid Color value 3 in setColor (maximum is -1)
  l.iterate()
............<string>:9: Warning: No parameter dictionnay found in arguments. 
<string>:10: Warning: No parameter dictionnay found in arguments. 
.test_emptyline.lpy:8: Warning: IndentationWarning: missing indent.
............................../home/artzet_s/code/lpy_test/lpy/test/test_memory.py:36: UserWarning: GlobalContext has not lpy symbols
  warnings.warn("GlobalContext has not lpy symbols")
............<string>:18: Warning: Found symbol '#' after Lstring. Considered as begining of comments
...<string>:3: Warning: Found symbol '#' after Lstring. Considered as begining of comments
<string>:8: Warning: Found symbol '#' after Lstring. Considered as begining of comments
<string>:15: Warning: Found symbol '#' after Lstring. Considered as begining of comments
<string>:3: Warning: Found symbol '#' after Lstring. Considered as begining of comments
<string>:8: Warning: Found symbol '#' after Lstring. Considered as begining of comments
<string>:15: Warning: Found symbol '#' after Lstring. Considered as begining of comments
.<string>:3: Warning: Found symbol '#' after Lstring. Considered as begining of comments
<string>:8: Warning: Found symbol '#' after Lstring. Considered as begining of comments
<string>:15: Warning: Found symbol '#' after Lstring. Considered as begining of comments
....Segmentation fault (core dumped)

Conda packages :

# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64
_libgcc_mutex=0.1=conda_forge
ann=1.1.2=0
backports=1.0=py_2
backports.os=0.1.1=py27_1001
backports.shutil_get_terminal_size=1.0.0=py_3
backports_abc=0.5=py_1
boost=1.66.0=py27_1
boost-cpp=1.66.0=1
bzip2=1.0.8=h516909a_2
ca-certificates=2019.11.28=hecc5488_0
cairo=1.14.6=4
certifi=2019.11.28=py27_0
cgal=4.11.0=0
configparser=3.7.3=py27_1
contextlib2=0.6.0.post1=py_0
decorator=4.4.1=py_0
enum34=1.1.6=py27_1002
expat=2.2.5=he1b5a44_1004
fontconfig=2.12.1=4
freetype=2.7=1
future=0.18.2=py27_0
futures=3.3.0=py27_0
gettext=0.19.8.1=hc5be6a0_1002
glib=2.51.4=0
gmp=6.1.2=hf484d3e_1000
graphite2=1.3.13=hf484d3e_1000
harfbuzz=1.4.3=0
icu=58.2=hf484d3e_1000
importlib_metadata=1.3.0=py27_0
ipykernel=4.10.0=py27_1
ipython=5.8.0=py27_0
ipython_genutils=0.2.0=py_1
jpeg=9c=h14c3975_1001
jupyter_client=5.3.3=py27_1
jupyter_core=4.6.1=py27_0
libblas=3.8.0=14_openblas
libcblas=3.8.0=14_openblas
libffi=3.2.1=he1b5a44_1006
libgcc-ng=9.2.0=h24d8f2e_1
libgfortran-ng=7.3.0=hdf63c60_3
libgomp=9.2.0=h24d8f2e_1
libiconv=1.15=h516909a_1005
liblapack=3.8.0=14_openblas
libopenblas=0.3.7=h5ec1e0e_6
libpng=1.6.37=hed695b0_0
libqglviewer=2.6.4=1
libsodium=1.0.17=h516909a_0
libstdcxx-ng=9.2.0=hdf63c60_1
libtiff=4.0.10=hc3755c2_1005
libuuid=2.32.1=h14c3975_1000
libxcb=1.13=h14c3975_1002
libxml2=2.9.9=h13577e0_2
lz4-c=1.8.3=he1b5a44_1001
more-itertools=5.0.0=py_0
mpfr=4.0.2=he80fd80_0
ncurses=6.1=hf484d3e_1002
nose=1.3.7=py27_1003
numpy=1.16.5=py27h95a1406_0
openalea-core=2.0.2=pypi_0
openalea-deploy=2.1.6=pypi_0
openalea-lpy=2.7.1=pypi_0
openalea-plantgl=2.23.2=pypi_0
openalea-vpltk=2.0.1=pypi_0
openalea.core=2.0.1=py27_1
openalea.deploy=2.1.6=py27_0
openalea.lpy=2.7.1=2
openalea.plantgl=2.23.2=py27he6552ab_1
openalea.vpltk=2.0.2=py27_0
openmp_impl=4.5=0_gnu
openssl=1.0.2u=h516909a_0
pango=1.40.4=0
path.py=11.5.2=py_0
pathlib2=2.3.5=py27_0
pcre=8.43=he1b5a44_0
pexpect=4.7.0=py27_0
pickleshare=0.7.5=py27_1000
pip=19.3.1=py27_0
pixman=0.34.0=h14c3975_1003
prompt_toolkit=1.0.15=py_1
pthread-stubs=0.4=h14c3975_1001
ptyprocess=0.6.0=py_1001
pygments=2.5.2=py_0
pyopengl=3.1.5=py_0
pyqglviewer=1.0.0=py27_1
pyqt=4.11.4=py27_3
python=2.7.15=h938d71a_1006
python-dateutil=2.8.1=py_0
pyzmq=18.1.1=py27h1768529_0
qhull=2015.2=0
qt=4.8.7=ha8c56c7_9
qtconsole=4.6.0=py_0
readline=7.0=hf8c457e_1001
scandir=1.10.0=py27h516909a_0
setuptools=44.0.0=py27_0
simplegeneric=0.8.1=py_1
singledispatch=3.4.0.3=py27_1000
sip=4.18=py27_1
six=1.13.0=py27_0
sqlite=3.28.0=h8b20d00_0
tk=8.6.10=hed695b0_0
tornado=5.1.1=py27h14c3975_1000
traitlets=4.3.3=py27_0
wcwidth=0.1.8=py_0
wheel=0.33.6=py27_0
xorg-kbproto=1.0.7=h14c3975_1002
xorg-libice=1.0.10=h516909a_0
xorg-libsm=1.2.3=h84519dc_1000
xorg-libx11=1.6.9=h516909a_0
xorg-libxau=1.0.9=h14c3975_0
xorg-libxdmcp=1.1.3=h516909a_0
xorg-libxext=1.3.4=h516909a_0
xorg-libxrender=0.9.10=h516909a_1002
xorg-libxt=1.2.0=h516909a_0
xorg-renderproto=0.11.1=h14c3975_1002
xorg-xextproto=7.3.0=h14c3975_1002
xorg-xproto=7.0.31=h14c3975_1007
xz=5.2.4=h14c3975_1001
zeromq=4.3.2=he1b5a44_2
zipp=0.6.0=py_0
zlib=1.2.11=h516909a_1006
zstd=1.4.4=h3b9ef0a_1

No module named 'openalea.lpy.__lpy_kernel__'

Dear sir,when I use lpy, it reports that the lpy kernel package is missing. Does the current version not include this package? Looking forward to your answers and help, thank you very much!

[bug] indentation error on comments

The .lpy interpreter says that in the following example is an indentation error, caused by the comments. I would expect that the interpreter ignores them.

Reproduction steps:

test.lpy

Axiom: F
decomposition: # beginning of decomposition rules.
               # These rules are applied recursively after each production step
               # usefull to decompose a module into a structure
F --> F

script.py

l = Lsystem("test.lpy")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.