Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev Pipeline.get_openalea_dataflow #4

Open
julien-diener opened this issue Mar 31, 2015 · 3 comments
Open

Dev Pipeline.get_openalea_dataflow #4

julien-diener opened this issue Mar 31, 2015 · 3 comments

Comments

@julien-diener
Copy link
Contributor

Implements a conversion of rhizoscan Pipeline to OpenAlea.core.dataflow.Dataflow

to start : need a coarse description of

  • rhizoscan pipeline internal representation
  • how to construct a OA Dataflow @pradal
@julien-diener
Copy link
Contributor Author

Rhizoscan pipeline:

Basically, a pipeline is a list of rhizoscan.workflow.node (or simply a lsit of python functions) which is stored in the __pipeline__ attribute
Each node/function, has inputs and outputs which can be obtained using node.get_inputs and node.get_outputs
Also, rhizoscan.workflow.openalea.node_attribute return a openalea valid descirptor dict

@pradal
Copy link
Contributor

pradal commented Mar 31, 2015

All the work is done.
Is your pipeline linear ? (ie is your pipeline really a pipeline?)
And how do you connect in/out ports? By name?

@julien-diener
Copy link
Contributor Author

It is a real pipeline (but the Pipeline class is not formal, one could probably cheat). Basically, a pipeline is a sequence of function, with named inputs and outputs, that is executed in a common namespace. The connection (i.e. dataflow edges) can thus be computed by finding the outputs that have the same name as some later function's inputs, or the opposite. Something like:

pl = my_pipeline.__pipeline__
for x,fct1 in enumerate(pl):
    for i,input in enumerate(node.get_inputs(fct1)):
        for y in range(i-1,0,-1):
            fct2 = pl[y]
            for j,output in enumerate(node.get_outputs(fct2)):
                if input{'name'}==output{'name'}
                    create_and_edge(fct2, fct1, k,i)  # todo
                    break

Well, we can dev a much better algorithm for this, but you see my point. So if you give me the Dataflow api to add fct and edges, I'll be able to code a conversion. We could also convert the other way around, knowing a dataflow partial order (but I don't see the use of it).

@julien-diener julien-diener changed the title Dev Pipeline.getOpenaleadataflow Dev Pipeline.get_openalea_dataflow Apr 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants