Giter Club home page Giter Club logo

openalea'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

openalea's People

Contributors

akiss0 avatar cgodin avatar christian34 avatar cokelaer avatar dbarbeau avatar fredboudon avatar gbaty avatar gcerutti avatar jcsoulie avatar jlegrand62 avatar jpeyhardi avatar pfernique avatar pradal avatar revesansparole avatar ricomos avatar rocsg 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

Watchers

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

openalea's Issues

rename project

If the name of a project and the name of his repository are not the same (can occure if you rename the project by hand), the project begin but models are not loaded...

Defining Inputs and outputs of a model

Inputs and outputs can be specified by the user.
However there are different issues:

  • BUG : defining the type of one input raise an error : a : int = 3 do not specified the interface to IInt
  • BUG: comma are not allow in the default value: a= 1,2,3
  • ENH: Inputs are not specified as keywords args but as positional args. Both should be possible.
  • ENH For L-system models, inputs and outputs must be defined by defaults to the Lstring.
  • ENH Add a button to specify the inputs and outputs of a workflow model.
    Add

Automatic selection of the (tab) menu of the focused widget/applet

I think it would be very practical that the shown menu is changed automatically when the focused widget changes.

At worst, it might induce some refactoring of the buttons attribution: i.e. which action should appear in which menu. If necessary, some action could be duplicated in several menus.

Add action "duplicate model" in project context menu

It would be practical to have a "duplicate" in the context menu of models (in project manager widget).
Especially if issue #41 is not solved

The duplicate should:

  • [UI] open a text dialog asking for a new name, and
  • [code] project.copy_model( model_name, new_name) does the work

Code relative to project management

Currently (2014-08-08), project classes (ProjectManager, Project, associated widgets, ...) are quite hard to debug, maintain or improve. Amount of code can be greatly reduced and factorized: handle all categories (data, model, ...) in the same way, remove redundant methods, improve management of model file extensions, ...

This issue has been created as a communication space to improve project classes.
This issue is only for code improvement and cleaning, not for feature requests. Please open new issues in this case.

Stable specifications and documentations are/will be available in official website.

Useful links:

Website

Classes

Tests

⚠️ All these developments must be done in branch clean-project

@jucoste, @julien-diener

Add a directory of data in a project

Enhance the addition of data in a project:

  • add a directory
  • add hard and soft links
  • add data recursively based on patterns (*.mtg, *.csv, ...)

critical error (related to r i guess)

@pradal @jucoste
j'ai mis a jours oalab, et ça plante au démarrage. A réglé vite !!
Quoi que c'est déjà trop tard, j'en ai besoin demain matin... Ah la bonne blague >:-(

voila le stack:

name 'code' is not defined
name 'code' is not defined
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/oalab", line 9, in <module>
    load_entry_point('OpenAlea.OALab==0.0.2', 'gui_scripts', 'oalab')()
  File "/Users/diener/openalea/vplants/oalab/src/openalea/oalab/main.py", line 65, in main
    factory(win)
  File "/Users/diener/openalea/vplants/oalab/src/openalea/oalab/plugins/labs/plantlab.py", line 34, in __call__
    mainwin.add_plugin(plugins[name])
  File "/Users/diener/openalea/vplants/oalab/src/openalea/oalab/gui/mainwindow.py", line 144, in add_plugin
    plugin(self)
  File "/Users/diener/openalea/vplants/oalab/src/openalea/oalab/plugins/applets/editormanager.py", line 14, in __call__
    mainwindow.session, mainwindow)
  File "/Users/diener/openalea/vplants/oalab/src/openalea/oalab/plugins/applets/__init__.py", line 14, in new
    return new_applet(name, klass, *args, **kwargs)
  File "/Users/diener/openalea/vplants/oalab/src/openalea/oalab/service/applet.py", line 17, in new
    applet = klass(*args, **kwargs)
  File "/Users/diener/openalea/vplants/oalab/src/openalea/oalab/gui/container.py", line 106, in __init__
    self.paradigms[applet.name] = applet()()
  File "/Users/diener/openalea/vplants/oalab/src/openalea/oalab/plugins/models/rgui.py", line 7, in __call__
    from openalea.oalab.gui.paradigm.r import RModelController
  File "/Users/diener/openalea/vplants/oalab/src/openalea/oalab/gui/paradigm/r.py", line 24, in <module>
    from openalea.oalab.model.r import RModel
  File "/Users/diener/openalea/vplants/oalab/src/openalea/oalab/model/r.py", line 23, in <module>
    class RModel(Model):
  File "/Users/diener/openalea/vplants/oalab/src/openalea/oalab/model/r.py", line 178, in RModel
    @code.setter
NameError: name 'code' is not defined

Management of 2D plots

Add a panel near the viewer to store the plot produce by the execution of a project.
The idea is to create a matplotlib redirection to this panel and to store:

  1. the image of the produced plot
  2. the matplotlib widgets

With the second solution, it will be possible to interact with the other objects of the application.

Interaction and visualisation of the world object

The world is composed of a set of objects that are visualized in the viewer.
Enhancement:

  • Show / Hide objects from the world panel
  • Produce a thumbnail of a world object which can be set as the image of the project
  • Selection of a world objects and drag n' drop

Error installing python-alinea.leafoptical on Ubuntu 12.04

Hi, I'm trying to use the PPA's for openalea per the instructions on http://openalea.gforge.inria.fr/wiki/doku.php?id=download:linux and have run into some issues installing python-alinea. The error is:

$ sudo apt-get install python-alinea
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
python-alinea.adel python-alinea.caribu python-alinea.graphtal python-alinea.leafoptical python-alinea.nema python-alinea.pyratp python-alinea.topvine
The following NEW packages will be installed:
python-alinea python-alinea.adel python-alinea.caribu python-alinea.graphtal python-alinea.leafoptical python-alinea.nema python-alinea.pyratp python-alinea.topvine
0 upgraded, 8 newly installed, 0 to remove and 7 not upgraded.
Need to get 8,033 kB of archives.
After this operation, 48.6 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ppa.launchpad.net/christophe-pradal/alinea/ubuntu/ precise/main python-alinea.caribu amd64 6.0.3ppa1 [1,386 kB]
Get:2 http://ppa.launchpad.net/christophe-pradal/alinea/ubuntu/ precise/main python-alinea.graphtal amd64 1.0.1
ppa7 [137 kB]
Get:3 http://ppa.launchpad.net/christophe-pradal/alinea/ubuntu/ precise/main python-alinea.adel all 1.0.1ppa8 [3,122 kB]
Get:4 http://ppa.launchpad.net/christophe-pradal/alinea/ubuntu/ precise/main python-alinea.topvine all 1.0.1
ppa7 [673 kB]
Get:5 http://ppa.launchpad.net/christophe-pradal/alinea/ubuntu/ precise/main python-alinea.leafoptical all 1.0.1ppa8 [171 kB]
Get:6 http://ppa.launchpad.net/christophe-pradal/alinea/ubuntu/ precise/main python-alinea.pyratp amd64 1.0.1
ppa9 [2,275 kB]
Get:7 http://ppa.launchpad.net/christophe-pradal/alinea/ubuntu/ precise/main python-alinea.nema amd64 1.0.1ppa7 [266 kB]
Get:8 http://ppa.launchpad.net/christophe-pradal/alinea/ubuntu/ precise/main python-alinea all 1.0.1
ppa8 [4,082 B]
Fetched 8,033 kB in 10s (761 kB/s)
Selecting previously unselected package python-alinea.caribu.
(Reading database ... 466341 files and directories currently installed.)
Unpacking python-alinea.caribu (from .../python-alinea.caribu_6.0.3ppa1_amd64.deb) ...
Selecting previously unselected package python-alinea.graphtal.
Unpacking python-alinea.graphtal (from .../python-alinea.graphtal_1.0.1
ppa7_amd64.deb) ...
Selecting previously unselected package python-alinea.adel.
Unpacking python-alinea.adel (from .../python-alinea.adel_1.0.1ppa8_all.deb) ...
Selecting previously unselected package python-alinea.topvine.
Unpacking python-alinea.topvine (from .../python-alinea.topvine_1.0.1
ppa7_all.deb) ...
Selecting previously unselected package python-alinea.leafoptical.
Unpacking python-alinea.leafoptical (from .../python-alinea.leafoptical_1.0.1ppa8_all.deb) ...
Selecting previously unselected package python-alinea.pyratp.
Unpacking python-alinea.pyratp (from .../python-alinea.pyratp_1.0.1
ppa9_amd64.deb) ...
Selecting previously unselected package python-alinea.nema.
Unpacking python-alinea.nema (from .../python-alinea.nema_1.0.1ppa7_amd64.deb) ...
Selecting previously unselected package python-alinea.
Unpacking python-alinea (from .../python-alinea_1.0.1
ppa8_all.deb) ...
Setting up python-alinea.caribu (6.0.3ppa1) ...
Setting up python-alinea.graphtal (1.0.1
ppa7) ...
Setting up python-alinea.adel (1.0.1ppa8) ...
Setting up python-alinea.topvine (1.0.1
ppa7) ...
Setting up python-alinea.leafoptical (1.0.1~ppa8) ...
SyntaxError: ('invalid syntax', ('/usr/lib/python2.7/dist-packages/alinea/canopyspectrum/Old/main_process2_reflectance.py', 32, 27, 'comp = 1MeasurementCompaign(acq, refe)\n'))

dpkg: error processing python-alinea.leafoptical (--configure):
subprocess installed post-installation script returned error exit status 101
Setting up python-alinea.pyratp (1.0.1ppa9) ...
Setting up python-alinea.nema (1.0.1
ppa7) ...
dpkg: dependency problems prevent configuration of python-alinea:
python-alinea depends on python-alinea.leafoptical; however:
Package python-alinea.leafoptical is not configured yet.
dpkg: error processing python-alinea (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
python-alinea.leafoptical
python-alinea
E: Sub-process /usr/bin/dpkg returned an error code (1)

openalea refactoring

Several packages contain utilitary functions like path management (deploy, core), qt import (vpltk), data management (deploy), ...

Refactoring is needed.

The solution:

  • misc : contains utility functions shared between different packages
  • vpltk will be removed
  • oalab contains the gui and some usefull plugins (shell)
  • core define and implement the core concepts of oalab

First refactoring

  • qt compatibility layer (PyQt / PySide) stay in vpltk
  • all tools stay in misc
  • Move main conceptual objects in vpltk and oalab non GUI functionalities in core
    • model
    • project
    • control
    • manager
    • services

History have to be persistent between sessions

One cool thing in IPython is that the history is persitent between session.
In OpenAleaLab, the history is only persistent in a session. Make the history persistent between session or allow to navigate in older history session (sorted by date for instance) to be able to reproduce ancient code and reproduce results.

Project documentation using Sphinx

Add rst files to a project in the doc category.
The run will produce a compilation of a sphinx project and view in the help.
This will help people to write documentation interactively.

Error loading lab should print that, not that the lab does not exist

Currently when a lab is loaded (oalab -e mylab) if an error occurs, the printed message says that the lab does not exist.

More precisely, this happens to me when a plugin fails to be loaded by the lab. Because of the unrelated error message, I cannot know what error occurs. I think it happens in the plugin call function which failed an import.

Continuous integration with Travis

A first PR (#49) have been integrated using Travis.
We can now extend it by adding PyFlakes checking on code.
It will be also usefull to test python 3 compatibility.

List selector for the editor widget

Instead of tabs, all the editors should be in a list-selector.

Also, two improvements would be nice:

  1. The create-file should not be a tab, but the default widget when no editor is opened
  2. Suitable shortcut should be defined to switch between opened-editor, inspired from other text editor (but not from emacs, nor vim :-)

Test all controls in OpenAleaLab

Several controls do not work or are partially implemented in OpenAleaLab:

  • color
  • rgbcolor
  • dict
  • ...

Test and integrate correctly all the available controls

Access to the Internal state of a model after execution

When running a model, its internal state is copied in the shell, even if it is not the simulator.

Write test and check which variables are copied in the shell.
Theoretically, only the internal state of the main script is available in the IPython shell.

Plugin which can't be loaded must be ignored (without crashing app)

If a plugin can't be loaded because of a missing dependency, the application must not failed: it must explicit that the dependency is missing and continue to run.

So, we have to:

  • explicit dependencies inside plugin (before loading)
  • display an explicit warning to the user
  • make application run without a specific plugin if its dependencies are missing

I just opened the branch explicit-plugin-dependencies for that 924da9e

Express a model as a class rather than as a script

For fine tunning, a model of plant is better represented as a class rather than as a script.
There are less magics.
Document and test the defintion of a user model inherited from the Model class defined in oalab.

run-time load of plugin

Loading plugin when needed, instead of defining a lab with, possibly too many, plugin is a real improvement.

A related issue is the configuration of "loaded at startup" plugins:

  • lab + user-preference + project-preference

project.add data copy file but keep initial filename

When doing project.add("data", "some-name", filename) where filename is not in project.data folder then it copy the file to the data folder.
However, project.data["some-name"] value is still filename, and not the path to the copied file.

So, project.add should:

  • either copy the file, and store the new file path
  • or keep a pointer to given filename, but don't copy

Usability of the Editor

The code editor is a central element of OpenAleaLab.
Feature requests:

  • Replace tab by 4 spaces
  • Use only fixed fonts (e.g. Courrier)
  • Users need to configure the size and the type of the fonts
  • Add pep8 check to see interactively the Python errors

Code migration to github

Migration and refactoring of the OpenAlea and VPlants code to github.
This will enhance the collaborative development and allow to define clear line between private and public projects.

imports in oalab when in ipython shell fails due to Session instantiation

Some import in oalab trigger a oalab.session.session.Session(). This, when called in ipython shell (not python and not oalab) will block the ipython interpreter.

Obviously, calling those in ipython is not the intended use, but it is still useful when debugging &| developing plugins.

The reason of this bug is that:

  • it calls vpltk.shell.shell.get_interpreter_call() which returns openalea.vpltk.shell.ipythoninterpreter.Interpreter
  • then it instantiates this Interpreter which does not like for another ipython interpreter to be opened: MultipleInstanceError: Multiple incompatible subclass instances of InProcessInteractiveShell are being created.

So, the error is logical but I think it should not happen when importing oalab modules. I don't know how everything work, but I recommend:

  1. oalab Session should be instantiated only at oalab start
  2. it should be instantiated explicitely, and not implicitly when importing some module
  3. a generic accessor to the current session object should return it if it is instantiated, and None otherwise

Of course, you can also have a Session that doesn't failed when another ipython interpreter is already started (probably more difficult to achieve though).

Service names

Currently service name are not very well chosen.
For example, to get an interface, you need to do:

from openalea.oalab.service import interface
print interface.get('IInt')

or

from openalea.oalab.service import get as get_interface
print get_interface('IInt')

These two approaches work but are not usual.

We can imagine a better way to use services.

I suggest two approaches two solve this problem

Creating aliases directly in service module:

from openalea.service import get_interface
print get_interface('IInt')

Benefits: backward compatible, two approaches remain possible
Drawbacks: possible confusion due to 2 names for same service

Refactoring :

from openalea.service import get_interface
print get_interface('IInt')

Benefits/Drawbacks: Opposite of previous approach

Project load must be lazy

When we load a project, every models, data, ... are loaded.
We have to make a project lazy: a model/data/... is loaded only if it is called.

Model execution does not returns the outputs

When executing a model in another one, using the Python API, the result values are empty:

res = submodel(some-params)  => res=[]

The spec is :

def submodel(*inputs, dt):
    m = Model('submodel')
    m.set_inputs(inputs)
    m.step(dt)
    return m.get_outputs()

OpenAleaLab fails to open some models

For example, in mtg project, if we try to open "walnut_mtg.py" by double click, we get this error:

IOError: [Errno 2] Aucun fichier ou dossier de ce type: path(u'/home/gbaty/prog/openalea/vplants-trunk/oalab/share/data/mtg/model/walnut_load_mtg.py')

If we try to open project "how_to_contribute", false models called x, y, z, r, s, t ... appears in model list

@jucoste

Python model automatic code reload

Currently, when changing the code of python model, pointer to it are not reloaded: the old code is run when called from the shell. Eg:

  • let say we have a python model "py_model"
  • drag&drop in the shell: py_model = Model('py_model')
  • change the code in py_model
  • call it from the the shell: res = py_model(arguments)
  • => the old code is executed

I did not test reload from other model, but their could be the same problem.

Currently what I do is run (Ctrl+R) the model, to force its reload. But

  • maybe these additional user actions could be avoided, or not?
  • running, instead of just reloading, is not wanted

Proposition on online project and folder

I propose to enforce strong relationship between the "online" project (which appear in oalab) and its related folder.

Currently, the folder and the project are poorly related: we expect thing to be somewhere, but it not a structural constraint. This is unclear and prone to errors.

What I think should be much clearer and robust, would be:

  1. The folder content and structure is a direct mapping of the project content:
    a) by default, anything in the project folder is an element of the project (files in data are data, files in model are models, etc...).
    b) If useful, allow some specific exceptions such as hidden files, project-header files, ...
  2. specific files can be explicitly excluded from the project by the user: the project file (or some subproject file in the respective folder) could store a list of "excluded_files", instead of listing the project content.

Some benefits I can see:

  1. a more robust project (and project file)
  2. users will naturally understand how it works
  3. Hierarchy of model, data, etc... is implemented by the filesystem
  4. data (or others) stored outside of the project folder can be added through symlink
  5. mounting an external file system would directly add external content to the project
  6. if anything else is necessary, just create the suitable file (and ext) that the project recognize and process accordingly

Note: this is what is done in intelliJ (and I expect it is the same in eclipse).

Focus and update of the view during the simulation

The visualisation of the world need to be refreshed after each step and not after the animate.
By default, the focus need to be recalculate after each world update. But a button can freeze the refresh for making camera coordinates constant during an animation.

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.