fredboudon / lpy Goto Github PK
View Code? Open in Web Editor NEWThis project forked from openalea/lpy
An open source python version of the Lindenmayer Systems.
License: Other
This project forked from openalea/lpy
An open source python version of the Lindenmayer Systems.
License: Other
I can't open lpystudio under Python 3.8. The issue seems to be related to an incompatibility with jupyter-client.
Below the error log:
from openalea.lpy.gui.lpystudio import main
main()
Traceback (most recent call last):
File "~\envs\py38\lib\site-packages\traitlets\traitlets.py", line 528, in get
value = obj._trait_values[self.name]
KeyError: 'iopub_socket'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "~\envs\py38\lib\site-packages\traitlets\traitlets.py", line 528, in get
value = obj._trait_values[self.name]
KeyError: 'iopub_thread'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "\py38\lib\site-packages\openalea.lpy-3.4.0-py3.8.egg\openalea\lpy\gui\lpystudio.py", line 1095, in main
w = LPyWindow()
File "\envs\py38\lib\site-packages\openalea.lpy-3.4.0-py3.8.egg\openalea\lpy\gui\lpystudio.py", line 106, in __init__
lpydock.initDocks(self)
File "\envs\py38\lib\site-packages\openalea.lpy-3.4.0-py3.8.egg\openalea\lpy\gui\lpydock.py", line 84, in initDocks
set_shell_widget(lpywidget)
File "\envs\py38\lib\site-packages\openalea.lpy-3.4.0-py3.8.egg\openalea\lpy\gui\lpyshell.py", line 41, in set_shell_widget
ipython_widget = LpyShellWidget(lpywidget.interpreterDock)
File "\envs\py38\lib\site-packages\openalea.lpy-3.4.0-py3.8.egg\openalea\lpy\gui\lpyshell.py", line 24, in __init__
self.kernel_manager.start_kernel(show_banner=False)
File "\envs\py38\lib\site-packages\ipykernel\inprocess\manager.py", line 46, in start_kernel
self.kernel = InProcessKernel(parent=self, session=self.session)
File "\envs\py38\lib\site-packages\ipykernel\inprocess\ipkernel.py", line 72, in __init__
super(InProcessKernel, self).__init__(**traits)
File "\envs\py38\lib\site-packages\ipykernel\ipkernel.py", line 71, in __init__
self.shell.displayhook.pub_socket = self.iopub_socket
File "\envs\py38\lib\site-packages\traitlets\traitlets.py", line 556, in __get__
return self.get(obj, cls)
File "\envs\py38\lib\site-packages\traitlets\traitlets.py", line 535, in get
value = self._validate(obj, dynamic_default())
File "\envs\py38\lib\site-packages\ipykernel\inprocess\ipkernel.py", line 67, in _default_iopub_socket
return self.iopub_thread.background_socket
File "\envs\py38\lib\site-packages\traitlets\traitlets.py", line 556, in __get__
return self.get(obj, cls)
File "\envs\py38\lib\site-packages\traitlets\traitlets.py", line 535, in get
value = self._validate(obj, dynamic_default())
File "\envs\py38\lib\site-packages\ipykernel\inprocess\ipkernel.py", line 59, in _default_iopub_thread
thread = IOPubThread(self._underlying_iopub_socket)
File "\envs\py38\lib\site-packages\ipykernel\iostream.py", line 71, in __init__
self._setup_event_pipe()
File "\envs\py38\lib\site-packages\ipykernel\iostream.py", line 90, in _setup_event_pipe
self._event_puller = ZMQStream(pipe_in, self.io_loop)
File "\envs\py38\lib\site-packages\zmq\eventloop\zmqstream.py", line 127, in __init__
self._init_io_state()
File "\envs\py38\lib\site-packages\zmq\eventloop\zmqstream.py", line 552, in _init_io_state
self.io_loop.add_handler(self.socket, self._handle_events, self.io_loop.READ)
File "\envs\py38\lib\site-packages\tornado\platform\asyncio.py", line 100, in add_handler
self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
File "\envs\py38\lib\asyncio\events.py", line 501, in add_reader
raise NotImplementedError
NotImplementedError
I'm running openalea.plantgl and openalea.lpy from @fredboudon sources under Win 10.
(py38) C:\>conda list
# packages in environment at C:\Users\rbarillot\AppData\Local\Continuum\anaconda2\envs\py38:
#
# Name Version Build Channel
ann 1.1.3 h6538335_0 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.1 py_0 conda-forge
boost 1.72.0 py38h96a391d_0 conda-forge
boost-cpp 1.72.0 h89d28cc_2 conda-forge
bzip2 1.0.8 he774522_3 conda-forge
ca-certificates 2020.6.20 hecda079_0 conda-forge
certifi 2020.6.20 py38h32f6830_0 conda-forge
cgal-cpp 5.0.3 h9a563aa_0 conda-forge
colorama 0.4.3 py_0 conda-forge
decorator 4.4.2 py_0 conda-forge
eigen 3.3.7 he980bc4_1001 conda-forge
entrypoints 0.3 py38h32f6830_1001 conda-forge
icu 67.1 h33f27b4_0 conda-forge
intel-openmp 2020.2 254
ipykernel 5.3.4 py38h5ca1d4c_0 conda-forge
ipython 7.18.1 py38h1cdfbd6_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
jedi 0.17.2 py38h32f6830_0 conda-forge
jpeg 9d he774522_0 conda-forge
jupyter_client 5.3.4 py38_1 conda-forge
jupyter_core 4.6.3 py38h32f6830_1 conda-forge
libblas 3.8.0 16_mkl conda-forge
libcblas 3.8.0 16_mkl conda-forge
libclang 10.0.1 default_hf44288c_1 conda-forge
liblapack 3.8.0 16_mkl conda-forge
libpng 1.6.37 ha81a0f5_2 conda-forge
libqglviewer 2.6.4 3 fredboudon
libsodium 1.0.17 h2fa13f4_0 conda-forge
lz4-c 1.9.2 h62dcd97_2 conda-forge
mkl 2020.1 216
mpfr 4.0.2 h62dcd97_1 conda-forge
mpir 3.0.0 he025d50_1002 conda-forge
numpy 1.19.1 py38h72c728b_0 conda-forge
openalea-lpy 3.4.0 pypi_0 pypi
openalea-plantgl 3.4.1 pypi_0 pypi
openalea.lpy 3.4.0 py38h74a9793_1 fredboudon
openalea.plantgl 3.4.1 py38hff33a65_1 fredboudon
openssl 1.1.1g he774522_1 conda-forge
parso 0.7.1 pyh9f0ad1d_0 conda-forge
pickleshare 0.7.5 py38h32f6830_1001 conda-forge
pip 20.2.2 py_0 conda-forge
prompt-toolkit 3.0.6 py_0 conda-forge
pygments 2.6.1 py_0 conda-forge
pyopengl 3.1.5 py_0 conda-forge
pyqglviewer 1.1.0 py38h74a9793_2 fredboudon
pyqt 5.12.3 py38h6538335_1 conda-forge
pyqt5-sip 4.19.18 pypi_0 pypi
pyqtwebengine 5.12.1 pypi_0 pypi
python 3.8.5 h60c2a47_7_cpython conda-forge
python-dateutil 2.8.1 py_0 conda-forge
python_abi 3.8 1_cp38 conda-forge
pywin32 227 py38hfa6e2cd_0 conda-forge
pyzmq 19.0.2 py38h77b9d75_0 conda-forge
qhull 2019.1 h7266db4_0 conda-forge
qt 5.12.6 hb2cf2c5_0 conda-forge
qtconsole 4.7.6 pyh9f0ad1d_0 conda-forge
qtpy 1.9.0 py_0 conda-forge
setuptools 50.0.0 py38h32f6830_0 conda-forge
six 1.15.0 pyh9f0ad1d_0 conda-forge
sqlite 3.33.0 he774522_0 conda-forge
tornado 6.0.4 py38hfa6e2cd_0 conda-forge
traitlets 4.3.3 py38h32f6830_1 conda-forge
vc 14.1 h869be7e_1 conda-forge
vs2015_runtime 14.16.27012 h30e32a0_2 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_1 conda-forge
wheel 0.35.1 pyh9f0ad1d_0 conda-forge
wincertstore 0.2 py38_1003 conda-forge
xz 5.2.5 h62dcd97_1 conda-forge
zeromq 4.3.2 ha925a31_3 conda-forge
zlib 1.2.11 h62dcd97_1009 conda-forge
zstd 1.4.5 h1f3a1b7_2 conda-forge
Deleting the last object in the object editor of the lpy gui make the application crash
Is there a way in L-py to ensure that tree branches do not overlap, or model interaction with the environment e.g. nearby trees / a wall?
edit- redacted
[lang=FR]
ajouter une vue hiérarchique
dans la pratique, on prend des modèles existants, on les dupliques, on les fait évoluer
mais on a une très mauvaise vue de ce qui se fait actuellement
on aimerait pouvoir les regrouper dans une vue hiérarchique
idéalement, on aimerait avoir une vue en 2 parties:
On veut pouvoir :
On peut commencer par implémenter de quoi importer et exporter un panel JSON
Il faut formaliser un lien dans le code pour qu'il vienne charger le fichier de paramètres
Puis formaliser l'archive (quels fichiers, quels types, quels liens entre les fichiers)
Il devrait être possible de charger dans Lpy, et d'exporter depuis Lpy :
Tested on:
reproduce:
python -m openalea.lpy.gui.objectpanel
[*] message in the console:
External WM_DESTROY received for QWidgetWindow(0x227ca5b27e0, name="objectViewWindow") , parent: QWidgetWindow(0x227ca5b18e0, name="ObjectDialogWindow") , transient parent: QWindow(0x0)
edit-redacted
We had developed our script in the past based on Python 2.7.6 openalea.lpy (http://openalea.gforge.inria.fr/dokuwiki/doku.php)
. Now it seems that our code is pretty much obsolete as most involved packages are deprecated by now. May I confirm with you that one should no longer refer to http://openalea.gforge.inria.fr/dokuwiki/doku.php for installing Lpy? It might be good to mark it so on the website to avoid confusion with the current github lpy version.
This github lpy code seems to be Python 3 based, so we would like to port our code accordingly (Windows platform) to use openalea.lpy module in our code (https://lpy.readthedocs.io/en/latest/user/integration.html), but so far we have no luck in installing it from the source based on https://lpy.readthedocs.io/en/latest/user/installing.html#installing-from-sources. We encountered error during the lpy compilation at the "cmake" step
cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}
-DCMAKE_PREFIX_PATH=${CONDA_PREFIX}
-DCMAKE_BUILD_TYPE=Release
-LAH ..
which was executed from within the "/build". The error message is: "CMake Error: The source directory "D:/Code/lpy/build/text" does not exist." I only have "D:/Code/lpy/test" directory by the cloned lpy folder. Please advise how to proceed with this? Thank you!
Use of new contexts make the model to crash
A simple conda create -y -n test -c conda-forge jupyterlab
and then conda install -c fredboudon -c conda-forge openalea.lpy
does only work after conda downgrades jupyter_client.
jupyter_client conda-forge/noarch::jupyter_client-6.~ --> conda-forge/linux-64::jupyter_client-5.3.4-py38_1
I suppose the dependency comes from lpy. Is it possible to upgrade jupyter_client in lpy?
jv@jv:~$ conda create -y -n test1 -c fredboudon -c conda-forge jupyterlab
Collecting package metadata (current_repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.8.3
latest version: 4.8.5
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: /home/jv/miniconda3/envs/test1
added / updated specs:
- jupyterlab
The following packages will be downloaded:
package | build
---------------------------|-----------------
async_generator-1.10 | py_0 18 KB conda-forge
cffi-1.14.3 | py38h5bae8af_0 226 KB conda-forge
chardet-3.0.4 |py38h32f6830_1007 170 KB conda-forge
jupyter_client-6.1.7 | py_0 76 KB conda-forge
jupyterlab_pygments-0.1.1 | pyh9f0ad1d_0 7 KB conda-forge
nbclient-0.5.0 | py_0 60 KB conda-forge
nbconvert-6.0.5 | py38h32f6830_0 513 KB conda-forge
nest-asyncio-1.4.0 | py_1 9 KB conda-forge
python-3.8.5 |h1103e12_8_cpython 22.0 MB conda-forge
setuptools-49.6.0 | py38h32f6830_1 940 KB conda-forge
terminado-0.9.1 | py38h32f6830_0 25 KB conda-forge
------------------------------------------------------------
Total: 23.9 MB
The following NEW packages will be INSTALLED:
_libgcc_mutex conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge
_openmp_mutex conda-forge/linux-64::_openmp_mutex-4.5-1_gnu
argon2-cffi conda-forge/linux-64::argon2-cffi-20.1.0-py38h1e0a361_1
async_generator conda-forge/noarch::async_generator-1.10-py_0
attrs conda-forge/noarch::attrs-20.2.0-pyh9f0ad1d_0
backcall conda-forge/noarch::backcall-0.2.0-pyh9f0ad1d_0
backports conda-forge/noarch::backports-1.0-py_2
backports.functoo~ conda-forge/noarch::backports.functools_lru_cache-1.6.1-py_0
bleach conda-forge/noarch::bleach-3.2.1-pyh9f0ad1d_0
brotlipy conda-forge/linux-64::brotlipy-0.7.0-py38h1e0a361_1000
ca-certificates conda-forge/linux-64::ca-certificates-2020.6.20-hecda079_0
certifi conda-forge/linux-64::certifi-2020.6.20-py38h32f6830_0
cffi conda-forge/linux-64::cffi-1.14.3-py38h5bae8af_0
chardet conda-forge/linux-64::chardet-3.0.4-py38h32f6830_1007
cryptography conda-forge/linux-64::cryptography-3.1-py38h766eaa4_0
decorator conda-forge/noarch::decorator-4.4.2-py_0
defusedxml conda-forge/noarch::defusedxml-0.6.0-py_0
entrypoints conda-forge/linux-64::entrypoints-0.3-py38h32f6830_1001
idna conda-forge/noarch::idna-2.10-pyh9f0ad1d_0
importlib-metadata conda-forge/linux-64::importlib-metadata-1.7.0-py38h32f6830_0
importlib_metadata conda-forge/noarch::importlib_metadata-1.7.0-0
ipykernel conda-forge/linux-64::ipykernel-5.3.4-py38h23f93f0_0
ipython conda-forge/linux-64::ipython-7.18.1-py38h1cdfbd6_0
ipython_genutils conda-forge/noarch::ipython_genutils-0.2.0-py_1
jedi conda-forge/linux-64::jedi-0.15.2-py38_0
jinja2 conda-forge/noarch::jinja2-2.11.2-pyh9f0ad1d_0
json5 conda-forge/noarch::json5-0.9.5-pyh9f0ad1d_0
jsonschema conda-forge/linux-64::jsonschema-3.2.0-py38h32f6830_1
jupyter_client conda-forge/noarch::jupyter_client-6.1.7-py_0
jupyter_core conda-forge/linux-64::jupyter_core-4.6.3-py38h32f6830_1
jupyterlab conda-forge/noarch::jupyterlab-2.2.8-py_0
jupyterlab_pygmen~ conda-forge/noarch::jupyterlab_pygments-0.1.1-pyh9f0ad1d_0
jupyterlab_server conda-forge/noarch::jupyterlab_server-1.2.0-py_0
ld_impl_linux-64 conda-forge/linux-64::ld_impl_linux-64-2.35-h769bd43_9
libffi conda-forge/linux-64::libffi-3.2.1-he1b5a44_1007
libgcc-ng conda-forge/linux-64::libgcc-ng-9.3.0-h24d8f2e_16
libgomp conda-forge/linux-64::libgomp-9.3.0-h24d8f2e_16
libsodium conda-forge/linux-64::libsodium-1.0.18-h516909a_0
libstdcxx-ng conda-forge/linux-64::libstdcxx-ng-9.3.0-hdf63c60_16
markupsafe conda-forge/linux-64::markupsafe-1.1.1-py38h1e0a361_1
mistune conda-forge/linux-64::mistune-0.8.4-py38h1e0a361_1001
nbclient conda-forge/noarch::nbclient-0.5.0-py_0
nbconvert conda-forge/linux-64::nbconvert-6.0.5-py38h32f6830_0
nbformat conda-forge/noarch::nbformat-5.0.7-py_0
ncurses conda-forge/linux-64::ncurses-6.2-he1b5a44_1
nest-asyncio conda-forge/noarch::nest-asyncio-1.4.0-py_1
notebook conda-forge/linux-64::notebook-6.1.4-py38h32f6830_0
openssl conda-forge/linux-64::openssl-1.1.1h-h516909a_0
packaging conda-forge/noarch::packaging-20.4-pyh9f0ad1d_0
pandoc conda-forge/linux-64::pandoc-2.10.1-h516909a_0
pandocfilters conda-forge/noarch::pandocfilters-1.4.2-py_1
parso pkgs/main/noarch::parso-0.5.2-py_0
pexpect conda-forge/linux-64::pexpect-4.8.0-py38h32f6830_1
pickleshare conda-forge/linux-64::pickleshare-0.7.5-py38h32f6830_1001
pip conda-forge/noarch::pip-20.2.3-py_0
prometheus_client conda-forge/noarch::prometheus_client-0.8.0-pyh9f0ad1d_0
prompt-toolkit conda-forge/noarch::prompt-toolkit-3.0.7-py_0
ptyprocess conda-forge/noarch::ptyprocess-0.6.0-py_1001
pycparser conda-forge/noarch::pycparser-2.20-pyh9f0ad1d_2
pygments conda-forge/noarch::pygments-2.7.1-py_0
pyopenssl conda-forge/noarch::pyopenssl-19.1.0-py_1
pyparsing conda-forge/noarch::pyparsing-2.4.7-pyh9f0ad1d_0
pyrsistent conda-forge/linux-64::pyrsistent-0.17.3-py38h1e0a361_0
pysocks conda-forge/linux-64::pysocks-1.7.1-py38h32f6830_1
python conda-forge/linux-64::python-3.8.5-h1103e12_8_cpython
python-dateutil conda-forge/noarch::python-dateutil-2.8.1-py_0
python_abi conda-forge/linux-64::python_abi-3.8-1_cp38
pyzmq conda-forge/linux-64::pyzmq-19.0.2-py38ha71036d_0
readline conda-forge/linux-64::readline-8.0-he28a2e2_2
requests conda-forge/noarch::requests-2.24.0-pyh9f0ad1d_0
send2trash conda-forge/noarch::send2trash-1.5.0-py_0
setuptools conda-forge/linux-64::setuptools-49.6.0-py38h32f6830_1
six conda-forge/noarch::six-1.15.0-pyh9f0ad1d_0
sqlite conda-forge/linux-64::sqlite-3.33.0-h4cf870e_0
terminado conda-forge/linux-64::terminado-0.9.1-py38h32f6830_0
testpath conda-forge/noarch::testpath-0.4.4-py_0
tk conda-forge/linux-64::tk-8.6.10-hed695b0_0
tornado conda-forge/linux-64::tornado-6.0.4-py38h1e0a361_1
traitlets conda-forge/noarch::traitlets-5.0.4-py_0
urllib3 conda-forge/noarch::urllib3-1.25.10-py_0
wcwidth conda-forge/noarch::wcwidth-0.2.5-pyh9f0ad1d_1
webencodings conda-forge/noarch::webencodings-0.5.1-py_1
wheel conda-forge/noarch::wheel-0.35.1-pyh9f0ad1d_0
xz conda-forge/linux-64::xz-5.2.5-h516909a_1
zeromq conda-forge/linux-64::zeromq-4.3.2-he1b5a44_3
zipp conda-forge/noarch::zipp-3.1.0-py_0
zlib conda-forge/linux-64::zlib-1.2.11-h516909a_1009
Downloading and Extracting Packages
nbclient-0.5.0 | 60 KB | ##################################### | 100%
setuptools-49.6.0 | 940 KB | ##################################### | 100%
python-3.8.5 | 22.0 MB | ##################################### | 100%
nest-asyncio-1.4.0 | 9 KB | ##################################### | 100%
terminado-0.9.1 | 25 KB | ##################################### | 100%
nbconvert-6.0.5 | 513 KB | ##################################### | 100%
async_generator-1.10 | 18 KB | ##################################### | 100%
jupyterlab_pygments- | 7 KB | ##################################### | 100%
cffi-1.14.3 | 226 KB | ##################################### | 100%
jupyter_client-6.1.7 | 76 KB | ##################################### | 100%
chardet-3.0.4 | 170 KB | ##################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate test1
#
# To deactivate an active environment, use
#
# $ conda deactivate
jv@jv:~$ conda activate test1
(test1) jv@jv:~$ conda install -c fredboudon -c conda-forge openalea.lpy
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.8.3
latest version: 4.8.5
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: /home/jv/miniconda3/envs/test1
added / updated specs:
- openalea.lpy
The following NEW packages will be INSTALLED:
ann conda-forge/linux-64::ann-1.1.3-he1b5a44_0
boost conda-forge/linux-64::boost-1.72.0-py38h9de70de_0
boost-cpp conda-forge/linux-64::boost-cpp-1.72.0-h9359b55_3
bzip2 conda-forge/linux-64::bzip2-1.0.8-h516909a_3
cgal-cpp conda-forge/linux-64::cgal-cpp-5.0.3-h4548ac7_1
dbus conda-forge/linux-64::dbus-1.13.6-he372182_0
eigen conda-forge/linux-64::eigen-3.3.7-hc9558a2_1001
expat conda-forge/linux-64::expat-2.2.9-he1b5a44_2
fontconfig conda-forge/linux-64::fontconfig-2.13.1-h1056068_1002
freetype conda-forge/linux-64::freetype-2.10.2-he06d7ca_0
gettext conda-forge/linux-64::gettext-0.19.8.1-hc5be6a0_1002
glib conda-forge/linux-64::glib-2.66.0-h0dae87d_0
gmp conda-forge/linux-64::gmp-6.2.0-he1b5a44_2
gst-plugins-base conda-forge/linux-64::gst-plugins-base-1.14.5-h0935bb2_2
gstreamer conda-forge/linux-64::gstreamer-1.14.5-h36ae1b5_2
icu conda-forge/linux-64::icu-67.1-he1b5a44_0
jpeg conda-forge/linux-64::jpeg-9d-h516909a_0
krb5 conda-forge/linux-64::krb5-1.17.1-hfafb76e_3
libblas conda-forge/linux-64::libblas-3.8.0-17_openblas
libcblas conda-forge/linux-64::libcblas-3.8.0-17_openblas
libclang conda-forge/linux-64::libclang-10.0.1-default_hde54327_1
libedit conda-forge/linux-64::libedit-3.1.20191231-he28a2e2_2
libevent conda-forge/linux-64::libevent-2.1.10-hcdb4288_2
libgfortran-ng conda-forge/linux-64::libgfortran-ng-7.5.0-hdf63c60_16
libglu conda-forge/linux-64::libglu-9.0.0-he1b5a44_1001
libiconv conda-forge/linux-64::libiconv-1.16-h516909a_0
liblapack conda-forge/linux-64::liblapack-3.8.0-17_openblas
libllvm10 conda-forge/linux-64::libllvm10-10.0.1-he513fc3_3
libopenblas conda-forge/linux-64::libopenblas-0.3.10-pthreads_hb3c22a3_4
libpng conda-forge/linux-64::libpng-1.6.37-hed695b0_2
libpq conda-forge/linux-64::libpq-12.3-h5513abc_0
libqglviewer fredboudon/linux-64::libqglviewer-2.6.4-3
libuuid conda-forge/linux-64::libuuid-2.32.1-h14c3975_1000
libxcb conda-forge/linux-64::libxcb-1.13-h14c3975_1002
libxkbcommon conda-forge/linux-64::libxkbcommon-0.10.0-he1b5a44_0
libxml2 conda-forge/linux-64::libxml2-2.9.10-h68273f3_2
lz4-c conda-forge/linux-64::lz4-c-1.9.2-he1b5a44_3
mpfr conda-forge/linux-64::mpfr-4.0.2-he80fd80_1
mysql-common conda-forge/linux-64::mysql-common-8.0.21-2
mysql-libs conda-forge/linux-64::mysql-libs-8.0.21-hf3661c5_2
nspr conda-forge/linux-64::nspr-4.29-he1b5a44_0
nss conda-forge/linux-64::nss-3.57-he751ad9_0
numpy conda-forge/linux-64::numpy-1.19.1-py38hbc27379_2
openalea.lpy fredboudon/linux-64::openalea.lpy-3.4.0-py38h6bb024c_1
openalea.plantgl fredboudon/linux-64::openalea.plantgl-3.4.0-py38hde49c1d_0
pcre conda-forge/linux-64::pcre-8.44-he1b5a44_0
pthread-stubs conda-forge/linux-64::pthread-stubs-0.4-h14c3975_1001
pyopengl conda-forge/noarch::pyopengl-3.1.5-py_0
pyqglviewer fredboudon/linux-64::pyqglviewer-1.1.0-py38h6bb024c_2
pyqt conda-forge/linux-64::pyqt-5.12.3-py38ha8c2ead_3
qhull conda-forge/linux-64::qhull-2015.2-hc9558a2_1001
qt conda-forge/linux-64::qt-5.12.9-h1f2b2cb_0
qtconsole conda-forge/noarch::qtconsole-4.7.7-pyh9f0ad1d_0
qtpy conda-forge/noarch::qtpy-1.9.0-py_0
xorg-fixesproto conda-forge/linux-64::xorg-fixesproto-5.0-h14c3975_1002
xorg-kbproto conda-forge/linux-64::xorg-kbproto-1.0.7-h14c3975_1002
xorg-libx11 conda-forge/linux-64::xorg-libx11-1.6.12-h516909a_0
xorg-libxau conda-forge/linux-64::xorg-libxau-1.0.9-h14c3975_0
xorg-libxdmcp conda-forge/linux-64::xorg-libxdmcp-1.1.3-h516909a_0
xorg-libxfixes conda-forge/linux-64::xorg-libxfixes-5.0.3-h516909a_1004
xorg-xextproto conda-forge/linux-64::xorg-xextproto-7.3.0-h14c3975_1002
xorg-xproto conda-forge/linux-64::xorg-xproto-7.0.31-h14c3975_1007
zstd conda-forge/linux-64::zstd-1.4.5-h6597ccf_2
The following packages will be REMOVED:
nbclient-0.5.0-py_0
The following packages will be SUPERSEDED by a higher-priority channel:
jupyter_client conda-forge/noarch::jupyter_client-6.~ --> conda-forge/linux-64::jupyter_client-5.3.4-py38_1
The following packages will be DOWNGRADED:
nbconvert 6.0.5-py38h32f6830_0 --> 5.6.1-py38h32f6830_1
Proceed ([y]/n)?
Hello,
I'm trying to get the current vector position of the turtle and save it in a variable for later use how can this be achieved in Lpy?
Thank you.
Hi, Is there a way of running .lpy files directly from the terminal and saving the output to .ply without the plantGL viewer?
Hi,
The following code produce SetWidth(1)SetColor(3)F(X.length)
is raising unwanted warnings in my lsystem:
openalea\lpy\gui\simulation.py:808: Warning: Invalid Color value 3 in setColor (maximum is -1)
@fredboudon pointed out that my code was also having GetPos-like functions that may call a supplementary turtle which does not work fine with setcolor
Thks
edit-redacted
In order to align lpy and pgljupyter some functionality should be moved from pgljupyter to lpy. I propose these changes, api:
JSON schema should be moved to shared folder in lpy:
https://github.com/jvail/plantgl-jupyter/tree/master/pgljupyter/schema
API
param file validation
https://github.com/jvail/plantgl-jupyter/blob/d1d05b108b5a13d6faa47c4382e2b76d0f339169/pgljupyter/editors.py#L807-L824
e.g. validate_params(params)
make default, valid param dict
https://github.com/jvail/plantgl-jupyter/blob/d1d05b108b5a13d6faa47c4382e2b76d0f339169/pgljupyter/editors.py#L55-L68
e.g. get_default_params()
extract params from "old style init function" to replace it with json file
https://github.com/jvail/plantgl-jupyter/blob/d1d05b108b5a13d6faa47c4382e2b76d0f339169/pgljupyter/widgets.py#L327-L332
e.g. init_to_params(lpycode)
re-evaluate on param dict change
https://github.com/jvail/plantgl-jupyter/blob/d1d05b108b5a13d6faa47c4382e2b76d0f339169/pgljupyter/widgets.py#L383-L389
e.g. set_params(params)
On va découpler les paramètres (courbes, fonctions, etc.) et le code Lpy/Python
Mais on voudrait que, lorsqu'on charge le modèle (soit un ensemble de paramètres), le modèle expose une interface qui garantit que les fonctions doivent exister et doivent remplir leur rôle. (c'est un peu comme avoir plusieurs classes qui héritent d'une classe mère)
(à voir comment représenter ça pour un néophyte, pour que la visualisation mentale qu'il a de son "modèle" soit claire)
Tested on:
Steps to reproduce:
python -m openalea.lpy.gui.objectpanel
.You would expect : not a crash
You get : a crash with this traceback
Traceback (most recent call last):
File "c:\users\jonathan\miniconda3\envs\lpy\lib\site-packages\openalea.lpy-3.8.0-py3.8.egg\openalea\lpy\gui\objectpanel.py", line 105, in __transmit_valueChanged__
self.panel.retrieveObject(self)
File "c:\users\jonathan\miniconda3\envs\lpy\lib\site-packages\openalea.lpy-3.8.0-py3.8.egg\openalea\lpy\gui\objectpanel.py", line 456, in retrieveObject
object,objectid = managerDialog.getEditedObject()
TypeError: cannot unpack non-iterable NoneType object
I haven't tested if this happens with Python 3.7 and Python 3.8 too. (openalea.lpy is built for Python 3.7, 3.8 and 3.9 on anaconda.org)
When I rearrange tabs in the code editor, and then select another tab, the code is not immediately updated.
I need to go back to the previous tab and come back again for the text displayed in the editor to be updated.
conda create -v -y -n lpy -c fredboudon openalea.lpy
Collecting package metadata (current_repodata.json): ...working... Unable to retrieve repodata (response: 404) for https://conda.anaconda.org/fredboudon/linux-64/current_repodata.json
libQGLViewer has bindings for version 2.6.X but version 2.7.2 has better support for QOpenGLWidget instead of QGLWidget (which causes some glitches)
At some point we'll need to debug the bindings with version 2.7.2 to avoid these glitches
In [1]: import vmlab
...: from vmlab.models import vmango
...: import faulthandler; faulthandler.enable()
...:
...: model = vmango.drop_processes('geometry')
...:
...: setup = vmlab.create_setup(
...: model=model,
...: start_date='2003-06-01',
...: end_date='2004-06-01',
...: setup_toml='vmango.toml',
...: output_vars={
...: 'harvest__nb_fruit_harvested': None
...: }
...: )
...:
...: ds = vmlab.run(setup, model)
Current thread 0x00007f4425b17740 (most recent call first):
File "<string>", line 71 in __p_0_0_A_idx_
File "/home/jvail/dev/jvail/vmango-lab/vmlab/processes/topology.py", line 80 in initialize
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/xsimlab/process.py", line 394 in execute
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/xsimlab/process.py", line 530 in execute
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/xsimlab/model.py", line 842 in _execute_process
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/xsimlab/model.py", line 1023 in execute
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/xsimlab/drivers.py", line 336 in _run
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/xsimlab/drivers.py", line 472 in run_model
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/xsimlab/xr_accessor.py", line 823 in run
File "/home/jvail/dev/jvail/vmango-lab/vmlab/vmlab.py", line 534 in run
File "<ipython-input-1-434ba7f6d1ab>", line 17 in <module>
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3441 in run_code
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3361 in run_ast_nodes
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3169 in run_cell_async
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/IPython/core/async_helpers.py", line 68 in _pseudo_sync_runner
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2944 in _run_cell
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2898 in run_cell
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/IPython/terminal/interactiveshell.py", line 555 in interact
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/IPython/terminal/interactiveshell.py", line 564 in mainloop
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/IPython/terminal/ipapp.py", line 356 in start
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/traitlets/config/application.py", line 845 in launch_instance
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/IPython/__init__.py", line 126 in start_ipython
File "/home/jvail/miniconda3/envs/vmango-numpy-py38/bin/ipython", line 11 in <module>
Segmentation fault
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
PyDict_GetItemWithError (op=0x0, key=<numpy._DTypeMeta at remote 0x55a30fc51aa0>)
at /home/conda/feedstock_root/build_artifacts/python-split_1620713755437/work/Objects/dictobject.c:1437
1437 in /home/conda/feedstock_root/build_artifacts/python-split_1620713755437/work/Objects/dictobject.c
(gdb)
(gdb)
(gdb) backtrace
#0 PyDict_GetItemWithError (op=0x0, key=<numpy._DTypeMeta at remote 0x55a30fc51aa0>)
at /home/conda/feedstock_root/build_artifacts/python-split_1620713755437/work/Objects/dictobject.c:1437
fredboudon/vmango-lab#1 0x00007f247cbd44c5 in PyArray_GetCastingImpl ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-x86_64-linux-gnu.so
fredboudon/vmango-lab#2 0x00007f247cbd49c9 in PyArray_GetCastSafety ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-x86_64-linux-gnu.so
fredboudon/vmango-lab#3 0x00007f247cc735bb in PyArray_EquivTypes.part.0 ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-x86_64-linux-gnu.so
fredboudon/vmango-lab#4 0x00007f2432aa167a in boost::python::numpy::equivalent(boost::python::numpy::dtype const&, boost::python::numpy::dtype const&)
()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/scenegraph/../../../../../../libboost_numpy38.so.1.74.0
fredboudon/vmango-lab#5 0x00007f2432aa1e6a in boost::python::numpy::(anonymous namespace)::array_scalar_converter<unsigned long>::convertible(_object*) ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/scenegraph/../../../../../../libboost_numpy38.so.1.74.0
fredboudon/vmango-lab#6 0x00007f24308b5fae in boost::python::converter::rvalue_from_python_stage1(_object*, boost::python::converter::registration const&) ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/../../../../../../libboost_python38.so.1.74.0
fredboudon/vmango-lab#7 0x00007f242b131a6a in LPY::AxialTree::AxialTree(boost::python::list const&) ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.Lpy-3.8.0-py3.8.egg/openalea/lpy/../../../../../liblpy.so
fredboudon/vmango-lab#8 0x00007f242b5130c3 in LPY::nproduce(boost::python::list const&) ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.Lpy-3.8.0-py3.8.egg/openalea/lpy/__lpy_kernel__.so
fredboudon/vmango-lab#9 0x00007f242b50dd4e in boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void (*)(boost::python::list const&), boost::python::default_call_policies, boost::mpl::vector2<void, boost::python::list const&> > >::operator()(_object*, _object*) ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.Lpy-3.8.0-py3.8.egg/openalea/lpy/__lpy_kernel__.so
fredboudon/vmango-lab#10 0x00007f24308beeed in boost::python::objects::function::call(_object*, _object*) const ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/../../../../../../libboost_python38.so.1.74.0
fredboudon/vmango-lab#11 0x00007f24308bf0f9 in boost::detail::function::void_function_ref_invoker0<boost::python::objects::(anonymous namespace)::bind_return, void>::invoke(boost::detail::function::function_buffer&) ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/../../../../../../libboost_python38.so.1.74.0
fredboudon/vmango-lab#12 0x00007f24308c3ef3 in boost::python::detail::exception_handler::operator()(boost::function0<void> const&) const ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/../../../../../../libboost_python38.so.1.74.0
fredboudon/vmango-lab#13 0x00007f24309c19f9 in boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<PythonExc_StopIteration, void (*)(PythonExc_StopIteration const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void (*)(PythonExc_StopIteration const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0<void> const&>::invoke(boost::detail::function::function_buffer&, boost::python::detail::exception_handler const&, boost::function0--Type <RET> for more, q to quit, c to continue without paging--
<void> const&) ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/_pglmath.so
fredboudon/vmango-lab#14 0x00007f24308c3ec7 in boost::python::detail::exception_handler::operator()(boost::function0<void> const&) const ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/../../../../../../libboost_python38.so.1.74.0
fredboudon/vmango-lab#15 0x00007f24309c1999 in boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<PythonExc_KeyError, void (*)(PythonExc_KeyError const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void (*)(PythonExc_KeyError const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0<void> const&>::invoke(boost::detail::function::function_buffer&, boost::python::detail::exception_handler const&, boost::function0<void> const&)
()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/_pglmath.so
fredboudon/vmango-lab#16 0x00007f24308c3ec7 in boost::python::detail::exception_handler::operator()(boost::function0<void> const&) const ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/../../../../../../libboost_python38.so.1.74.0
fredboudon/vmango-lab#17 0x00007f24309c1939 in boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<PythonExc_TypeError, void (*)(PythonExc_TypeError const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void (*)(PythonExc_TypeError const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0<void> const&>::invoke(boost::detail::function::function_buffer&, boost::python::detail::exception_handler const&, boost::function0<void> const&) ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/_pglmath.so
fredboudon/vmango-lab#18 0x00007f24308c3ec7 in boost::python::detail::exception_handler::operator()(boost::function0<void> const&) const ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/../../../../../../libboost_python38.so.1.74.0
fredboudon/vmango-lab#19 0x00007f24309c18d9 in boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<PythonExc_ValueError, void (*)(PythonExc_ValueError const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void (*)(PythonExc_ValueError const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0<void> const&>::invoke(boost::detail::function::function_buffer&, boost::python::detail::exception_handler const&, boost::function0<void> const&) ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/_pglmath.so
fredboudon/vmango-lab#20 0x00007f24308c3ec7 in boost::python::detail::exception_handler::operator()(boost::function0<void> const&) const ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/../../../../../../libboost_python38.so.1.74.0
fredboudon/vmango-lab#21 0x00007f24309c1879 in boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<PythonExc_IndexError, void (*)(PythonExc_IndexError const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost::_bi::value<void (*)(PythonExc_IndexError const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0<void> const&>::invoke(boost::detail::function::function_buffer&, boost::python::detail::exception_handler const&, boost::function0<void> const&) ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/_pglmath.so
fredboudon/vmango-lab#22 0x00007f24308c3ec7 in boost::python::detail::exception_handler::operator()(boost::function0<void> const&) const ()
from /home/jvail/miniconda3/envs/vmango-numpy-py38/lib/python3.8/site-packages/OpenAlea.PlantGL-3.9.3-py3.8.egg/openalea/plantgl/math/../../../../../../libboost_python38.so.1.74.0
fredboudon/vmango-lab#23 0x00007f24309c19f9 in boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<PythonExc_StopIteration, void (*)(PythonExc_StopIteration const&)>, boost::_bi::list3<boost::arg<1>, boost::arg<2>, boost--Type <RET> for more, q to quit, c to continue without paging--
@fredboudon
Maybe a boost issue?
I keep getting a schema error if I try to load vmango (I think there are several issues):
lpy file. removed everything but initialiseContext
###### INITIALISATION ######
__lpy_code_version__ = 1.1
def __initialiseContext__(context):
import openalea.plantgl.all as pgl
Color_0 = pgl.Material("Color_0" , ambient = (30,60,10) , diffuse = 3 , )
Color_0.name = "Color_0"
context.turtle.setMaterial(0,Color_0)
Color_1 = pgl.Material("Color_1" , ambient = (60,0,0) , diffuse = 3 , )
Color_1.name = "Color_1"
context.turtle.setMaterial(1,Color_1)
Color_2 = pgl.Material("Color_2" , ambient = (60,60,15) , diffuse = 3 , )
Color_2.name = "Color_2"
context.turtle.setMaterial(2,Color_2)
Color_3 = pgl.Material("Color_3" , ambient = (0,0,60) , diffuse = 3 , )
Color_3.name = "Color_3"
context.turtle.setMaterial(3,Color_3)
Color_5 = pgl.Material("Color_5" , ambient = (51,50,16) , diffuse = 1.76471 , specular = (0,0,0) , )
Color_5.name = "Color_5"
context.turtle.setMaterial(5,Color_5)
Color_6 = pgl.Material("Color_6" , ambient = (71,91,46) , diffuse = 1.67033 , specular = (0,0,0) , )
Color_6.name = "Color_6"
context.turtle.setMaterial(6,Color_6)
PGL_140318980955920 = pgl.ImageTexture("PGL_140318980955920" , "/Users/fboudon/Develop/oagit/mangosim/share/textures/leaf.png" , )
PGL_140318980955920.name = "PGL_140318980955920"
Color_10 = pgl.Texture2D(image = PGL_140318980955920 , )
Color_10.name = "Color_10"
context.turtle.setMaterial(10,Color_10)
PGL_140675898004864 = pgl.ImageTexture("PGL_140675898004864" , "/Users/fboudon/Develop/oagit/mangosim/share/textures/leaf-bw.png" , )
PGL_140675898004864.name = "PGL_140675898004864"
Color_11 = pgl.Texture2D(image = PGL_140675898004864 , )
Color_11.name = "Color_11"
context.turtle.setMaterial(11,Color_11)
PGL_140608034579296 = pgl.ImageTexture("PGL_140608034579296" , "/Users/fboudon/Develop/oagit/mangosim/share/textures/bark2.png" , )
PGL_140608034579296.name = "PGL_140608034579296"
Color_12 = pgl.Texture2D(image = PGL_140608034579296 , )
Color_12.name = "Color_12"
context.turtle.setMaterial(12,Color_12)
Color_14 = pgl.Material("Color_14" , ambient = (62,125,20) , diffuse = 1.032 , specular = (0,0,0) , )
Color_14.name = "Color_14"
context.turtle.setMaterial(14,Color_14)
Color_15 = pgl.Material("Color_15" , ambient = (59,49,16) , diffuse = 1.76271 , specular = (0,0,0) , )
Color_15.name = "Color_15"
context.turtle.setMaterial(15,Color_15)
Color_16 = pgl.Material("Color_16" , ambient = (137,52,37) , diffuse = 1.64964 , specular = (0,0,0) , )
Color_16.name = "Color_16"
context.turtle.setMaterial(16,Color_16)
Color_17 = pgl.Material("Color_17" , ambient = (55,60,14) , diffuse = 3 , specular = (0,0,0) , )
Color_17.name = "Color_17"
context.turtle.setMaterial(17,Color_17)
Color_18 = pgl.Material("Color_18" , ambient = (30,60,10) , diffuse = 1.66667 , specular = (0,0,0) , )
Color_18.name = "Color_18"
context.turtle.setMaterial(18,Color_18)
Color_20 = pgl.Material("Color_20" , ambient = (30,60,10) , diffuse = 1.66667 , specular = (0,0,0) , )
Color_20.name = "Color_20"
context.turtle.setMaterial(20,Color_20)
Color_21 = pgl.Material("Color_21" , ambient = (162,52,68) , diffuse = 1.04321 , specular = (0,0,0) , )
Color_21.name = "Color_21"
context.turtle.setMaterial(21,Color_21)
Color_22 = pgl.Material("Color_22" , ambient = (101,94,11) , diffuse = 1.65347 , specular = (0,0,0) , )
Color_22.name = "Color_22"
context.turtle.setMaterial(22,Color_22)
Color_23 = pgl.Material("Color_23" , ambient = (2,2,2) , diffuse = 0 , specular = (0,0,0) , )
Color_23.name = "Color_23"
context.turtle.setMaterial(23,Color_23)
Color_25 = pgl.Material("Color_25" , ambient = (30,60,10) , diffuse = 1.66667 , specular = (0,0,0) , )
Color_25.name = "Color_25"
context.turtle.setMaterial(25,Color_25)
Color_26 = pgl.Material("Color_26" , ambient = (30,60,10) , diffuse = 1.96667 , specular = (0,0,0) , )
Color_26.name = "Color_26"
context.turtle.setMaterial(26,Color_26)
Color_27 = pgl.Material("Color_27" , ambient = (39,80,12) , diffuse = 1.2625 , specular = (0,0,0) , )
Color_27.name = "Color_27"
context.turtle.setMaterial(27,Color_27)
Color_28 = pgl.Material("Color_28" , ambient = (148,148,0) , diffuse = 0.810811 , specular = (0,0,0) , )
Color_28.name = "Color_28"
context.turtle.setMaterial(28,Color_28)
Color_29 = pgl.Material("Color_29" , ambient = (59,49,16) , diffuse = 1.74576 , specular = (0,0,0) , )
Color_29.name = "Color_29"
context.turtle.setMaterial(29,Color_29)
Color_30 = pgl.Material("Color_30" , ambient = (2,2,2) , diffuse = 0 , specular = (0,0,0) , )
Color_30.name = "Color_30"
context.turtle.setMaterial(30,Color_30)
Color_32 = pgl.Material("Color_32" , ambient = (41,82,13) , diffuse = 1.10976 , specular = (0,0,0) , )
Color_32.name = "Color_32"
context.turtle.setMaterial(32,Color_32)
Color_33 = pgl.Material("Color_33" , ambient = (107,0,107) , diffuse = 1.6729 , specular = (0,0,0) , )
Color_33.name = "Color_33"
context.turtle.setMaterial(33,Color_33)
context.animation_timestep = 0.1
context.options.setSelection('Module declaration',1)
context.options.setSelection('Warning with sharp module',0)
scalars = [('Geometry', 'Category'), ('RESOLUTION', 'Integer', 1, 0, 2), ('LEAFY', 'Bool', True), ('WITH_INFLO', 'Bool', True), ('GENERALIZEDCYLINDER', 'Bool', True), ('TEXTURE', 'Bool', True), ('DISTINCT_MI', 'Bool', False), ('ELASTICITY', 'Float', 0.02, 0.0, 1.0, 2), ('Data Export', 'Category'), ('EXPORT_TO_MTG', 'Bool', True), ('SAVE_MTG', 'Bool', False), ('FRUITMODEL_OUTPUT', 'Bool', False), ('Simulation', 'Category'), ('TREE', 'Integer', 0, 0, 2), ('SEED', 'Integer', 9, 0, 100), ('TIMESTEP', 'Integer', 90, 1, 180), ('REPEAT_LASTPROBAS', 'Bool', False), ('GLM', 'Category'), ('WITH_GLM', 'Bool', True), ('_GLM_TYPE', 'Integer', 3, 1, 3), ('_GLM_RESTRICTION', 'Integer', 0, 0, 6), ('Fruit Model', 'Category'), ('FRUIT_MODEL', 'Bool', True), ('FRUITBRANCHSIZE', 'Integer', 1, 1, 10), ('PARALLELFRUITMODEL', 'Bool', False), ('Visuals', 'Category'), ('TIMEBAR', 'Bool', False)]
context["__scalars__"] = scalars
for s in scalars:
if not s[1] == "Category" : context[s[0]] = s[2]
import openalea.plantgl.all as pgl
axis1 = pgl.BezierCurve2D(
pgl.Point3Array([(-0.5, 0, 1),(-0.166667, 0, 1),(0.214286, 0.00865801, 1),(0.45671, 0.138528, 1)]) ,
)
axis1.name = "axis1"
axis2 = pgl.BezierCurve2D(
pgl.Point3Array([(-0.5, 0, 1),(-0.166667, 0, 1),(0.209957, -0.017316, 1),(0.491342, -0.0952381, 1)]) ,
)
axis2.name = "axis2"
axis3 = pgl.BezierCurve2D(
pgl.Point3Array([(-0.5, 0, 1),(-0.166667, 0, 1),(0.166667, 0, 1),(0.5, 0, 1)]) ,
)
axis3.name = "axis3"
axis4 = pgl.BezierCurve2D(
pgl.Point3Array([(-0.5, 0, 1),(-0.158009, -0.047619, 1),(0.166667, 0.004329, 1),(0.443723, -0.393939, 1)]) ,
)
axis4.name = "axis4"
axis5 = pgl.BezierCurve2D(
pgl.Point3Array([(-0.416733, 0.0128104, 1),(0.2343, -0.076231, 1),(0.507411, -0.330906, 1),(0.662132, -0.814102, 1)]) ,
)
axis5.name = "axis5"
leafsection = pgl.NurbsCurve2D(
ctrlPointList = pgl.Point3Array([(-0.508209, 0.16873, 1),(-0.515031, 0.138195, 1),(-0.198373, -0.0924227, 1),(-0.00298323, 0.188761, 1),(0.0897461, -0.106293, 1),(0.555704, 0.0979703, 1),(0.545047, 0.12817, 1)]) ,
)
leafsection.name = "leafsection"
import openalea.plantgl.all as pgl
leafwidthgrowth = pgl.NurbsCurve2D(
ctrlPointList = pgl.Point3Array([(0, 0.0123039, 1),(0.289062, 0.0763736, 1),(0.289062, 0.454469, 1),(0.331839, 0.989763, 1),(1, 1, 1)]) ,
)
leafwidthgrowth.name = "leafwidthgrowth"
leafwidth = pgl.NurbsCurve2D(
ctrlPointList = pgl.Point3Array([(0, 0.0846264, 1),(0.239002, 1.00091, 1),(0.485529, 0.991241, 1),(0.718616, 1.00718, 1),(0.877539, 0.231273, 1),(1, 0.00332359, 1)]) ,
)
leafwidth.name = "leafwidth"
petioleCurve = pgl.BezierCurve2D(
pgl.Point3Array([(-0.543785, 0.192006, 1),(-0.178289, 0.176044, 1),(-0.0656355, 0.0728558, 1),(0.548469, 0.597983, 1),(0.397151, 0.581459, 1),(0.543571, 0.599108, 1)]) ,
)
petioleCurve.name = "petioleCurve"
panel_0 = ({'active': True, 'visible': True, 'name': 'Panel GU'},[('Curve2D',axis1),('Curve2D',axis2),('Curve2D',axis3),('Curve2D',axis4),('Curve2D',axis5),('Curve2D',leafsection),('Function',leafwidthgrowth),('Function',leafwidth),('Curve2D',petioleCurve)])
radius_base03 = pgl.NurbsCurve2D(
ctrlPointList = pgl.Point3Array([(0, 0.131507, 1),(0.00454138, 0.0251277, 1),(0.578848, 0.00694723, 1),(1, 0.00524218, 1)]) ,
)
radius_base03.name = "radius_base03"
inflo_radius = pgl.NurbsCurve2D(
ctrlPointList = pgl.Point3Array([(0, 0.160173, 1),(0.393939, 0.151515, 1),(0.735931, 0.0649351, 1),(1, 0.025974, 1)]) ,
)
inflo_radius.name = "inflo_radius"
radius = pgl.NurbsCurve2D(
ctrlPointList = pgl.Point3Array([(0, 0.107326, 1),(0.192635, 0.0975655, 1),(0.457142, 0.000244746, 1),(1, 0.026087, 1)]) ,
)
radius.name = "radius"
leafsize = pgl.NurbsCurve2D(
ctrlPointList = pgl.Point3Array([(0, 0.431282, 1),(0.324129, 0.436757, 1),(0.408886, 0.416427, 1),(0.412274, 0.708684, 1),(0.844357, 0.703533, 1),(1, 0.246499, 1)]) ,
)
leafsize.name = "leafsize"
leaflength = pgl.NurbsCurve2D(
ctrlPointList = pgl.Point3Array([(0, 1, 1),(0.00149779, 1.00072, 1),(1, 0.995671, 1),(1, 0.400121, 1)]) ,
)
leaflength.name = "leaflength"
leafpath = pgl.NurbsCurve2D(
ctrlPointList = pgl.Point3Array([(-0.5, 0, 1),(-0.145022, -0.0735931, 1),(0.0844156, -0.212121, 1),(0.123377, -0.497835, 1)]) ,
)
leafpath.name = "leafpath"
panel_1 = ({'active': False, 'visible': True, 'name': 'Panel Unused'},[('Function',radius_base03),('Function',inflo_radius),('Function',radius),('Function',leafsize),('Function',leaflength),('Curve2D',leafpath)])
fruitprofile = pgl.BezierCurve2D(
pgl.Point3Array([(0.00563514, 0.994106, 1),(0.223956, 0.97883, 1),(0.425561, 0.771672, 1),(0.680945, 0.239898, 1),(0.509633, 0.00914747, 1),(0.0130125, 0.0011832, 1)]) ,
)
fruitprofile.name = "fruitprofile"
bract_axis = pgl.NurbsCurve2D(
ctrlPointList = pgl.Point3Array([(-0.5, 0, 1),(-0.166667, -0.168182, 1),(0.143939, -0.140909, 1),(0.504545, -0.113636, 1)]) ,
)
bract_axis.name = "bract_axis"
bract_section = pgl.NurbsCurve2D(
ctrlPointList = pgl.Point3Array([(-0.5, 0, 1),(-0.189394, -0.159091, 1),(0.221212, -0.186364, 1),(0.5, 0, 1)]) ,
)
bract_section.name = "bract_section"
bract_width = pgl.NurbsCurve2D(
ctrlPointList = pgl.Point3Array([(0, 0.141879, 1),(0.0485817, 1.44717, 1),(1, 1.11933, 1),(1, 0.0236465, 1)]) ,
)
bract_width.name = "bract_width"
panel_2 = ({'active': True, 'visible': True, 'name': 'Panel Inflo'},[('Curve2D',fruitprofile),('Curve2D',bract_axis),('Curve2D',bract_section),('Function',bract_width)])
parameterset = [panel_0,panel_1,panel_2,]
context["__functions__"] = [('leafwidthgrowth',leafwidthgrowth),('leafwidth',leafwidth),('bract_width',bract_width),]
context["__curves__"] = [('axis1',axis1),('axis2',axis2),('axis3',axis3),('axis4',axis4),('axis5',axis5),('leafsection',leafsection),('petioleCurve',petioleCurve),('fruitprofile',fruitprofile),('bract_axis',bract_axis),('bract_section',bract_section),]
context["__parameterset__"] = parameterset
context["axis1"] = axis1
context["axis2"] = axis2
context["axis3"] = axis3
context["axis4"] = axis4
context["axis5"] = axis5
context["leafsection"] = leafsection
context["leafwidthgrowth"] = pgl.QuantisedFunction(leafwidthgrowth)
context["leafwidth"] = pgl.QuantisedFunction(leafwidth)
context["petioleCurve"] = petioleCurve
context["fruitprofile"] = fruitprofile
context["bract_axis"] = bract_axis
context["bract_section"] = bract_section
context["bract_width"] = pgl.QuantisedFunction(bract_width)
This gives a schema error. But lp.is_valid() is True ... !?
lsy = lpy.Lsystem('file.lpy')
lp = LsystemParameters()
lp.retrieve_from(lsy)
lp.dumps()
L-Py schema validation failed: 'Material' is not one of ['Texture2D']
This ..
lp = LsystemParameters()
with io.open('my.json') as file:
lp.load(file)
lp.set_defaut_category('my')
lp.generate_py_code()
fails with default_category
not being a property of self
.
https://github.com/fredboudon/lpy/blob/master/src/openalea/lpy/lsysparameters.py#L500-L508
I know I can add leaf with texture using plantgl, but I want to add texture to the generative cylinder trunk generated by the L-py. How can I do it?
Models with texture seems make a core dump of the application
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.