openalea.core.algo package#

Submodules#

openalea.core.algo.dataflow_copy module#

This module provide an algorithm to create a factory from an instance of a dataflow

openalea.core.algo.dataflow_copy.structural_copy(dataflow_pattern, dataflow_copy)[source]#

make a copy of dataflow_pattern into dataflow_copy

copy only structural informations and not informations related to vertices like actors

Parameters:
  • dataflow_pattern – the pattern to copy

  • dataflow_copy – the destination

openalea.core.algo.dataflow_evaluation module#

This module provide an algorithm to evaluate a dataflow

class openalea.core.algo.dataflow_evaluation.AbstractEvaluation(dataflow)[source]#

Bases: object

eval(*args)[source]#

todo

eval_vertex_code(vid)[source]#

Evaluate the vertex vid. Can raise an exception if evaluation failed.

get_parent_nodes(pid)[source]#

Return the list of parent node connected to pid The list contains tuples (port_pid, node_pid, actor) This list is sorted by the x value of the node

is_stopped(vid, actor)[source]#

Return True if evaluation must be stop at this vertex.

set_provenance(provenance)[source]#
class openalea.core.algo.dataflow_evaluation.BrutEvaluation(dataflow)[source]#

Bases: AbstractEvaluation

Basic evaluation algorithm

eval(*args)[source]#

Evaluate the whole dataflow starting from leaves

eval_vertex(vid, *args)[source]#

Evaluate the vertex vid

is_stopped(vid, actor)[source]#

Return True if evaluation must be stop at this vertex

openalea.core.algo.dataflow_evaluation.DefaultEvaluation#

alias of LambdaEvaluation

class openalea.core.algo.dataflow_evaluation.DiscreteTimeEvaluation(dataflow)[source]#

Bases: AbstractEvaluation

Evaluation algorithm with generator / priority and selection

clear()[source]#

Clear evaluation variable

eval(vtx_id=None, step=False)[source]#

todo

eval_vertex(vid)[source]#

Evaluate the vertex vid

is_stopped(vid, actor)[source]#

Return True if evaluation must be stop at this vertex

next_step()[source]#

Update the scheduler of one step.

exception openalea.core.algo.dataflow_evaluation.EvaluationException(vid, node, exception, exc_info)[source]#

Bases: Exception

class openalea.core.algo.dataflow_evaluation.GeneratorEvaluation(dataflow)[source]#

Bases: AbstractEvaluation

Evaluation algorithm with generator / priority and selection

clear()[source]#

Clear evaluation variable

eval(vtx_id=None, step=False)[source]#

todo

eval_vertex(vid)[source]#

Evaluate the vertex vid

is_stopped(vid, actor)[source]#

Return True if evaluation must be stop at this vertex

class openalea.core.algo.dataflow_evaluation.LambdaEvaluation(dataflow)[source]#

Bases: PriorityEvaluation

Evaluation algorithm with support of lambda / priority and selection

eval(vtx_id=None, context=None, is_subdataflow=False, step=False)[source]#

Eval the dataflow from vtx_id with a particular context

Parameters:
  • vtx_id – vertex id to start the evaluation

  • context – list a value to assign to lambda variables

eval_vertex(vid, context, lambda_value, *args)[source]#

Evaluate the vertex vid

This function is called both by the user (eval a node and its parents) and by the SubDataFlow evaluation.

First the graph is traversed by the algorithm in a bottom-up way. The SubDataflow is stored in the inputs.

Parameters:

context – is a list a value to assign to lambdas

class openalea.core.algo.dataflow_evaluation.PrintProvenance(workflow)[source]#

Bases: Provenance

node_exec(vid, node, start_time, end_time, *args)[source]#
workflow_exec(*args)[source]#
class openalea.core.algo.dataflow_evaluation.PriorityEvaluation(dataflow)[source]#

Bases: BrutEvaluation

Support priority between nodes and selective

eval(vtx_id=None, *args, **kwds)[source]#

todo

class openalea.core.algo.dataflow_evaluation.Provenance(workflow)[source]#

Bases: object

clear()[source]#
edges()[source]#
end_time()[source]#
node_exec(vid, node, start_time, end_time, *args)[source]#
start_time()[source]#
workflow_exec(*args)[source]#
write()[source]#

Write the provenance in db

class openalea.core.algo.dataflow_evaluation.SciFlowareEvaluation(dataflow)[source]#

Bases: AbstractEvaluation

Distributed Evaluation algorithm with SciFloware backend

eval(vtx_id=None, **kwds)[source]#

todo

eval_vertex(vid)[source]#

Evaluate the vertex vid

This evaluation is both a kind of compilation and real evaluation. Algorithm ——— For each vertex which is a SciFloware operator (e.g. map, reduce, …),

  • select the vertices connected to each input port

  • if the name of the port is Dataflow:
    • get its name and send it as input to the operator

  • else
    • normal evaluation

static is_operator(actor)[source]#
scifloware_actors()[source]#

Compute the scifloware actors.

Only those actors will be evaluated.

class openalea.core.algo.dataflow_evaluation.ToScriptEvaluation(dataflow)[source]#

Bases: AbstractEvaluation

Basic transformation into script algorithm

eval(*args, **kwds)[source]#

Evaluate the whole dataflow starting from leaves

eval_vertex(vid, *args)[source]#

Evaluate the vertex vid

is_stopped(vid, actor)[source]#

Return True if evaluation must be stop at this vertex

openalea.core.algo.dataflow_evaluation.cmp(x, y)[source]#

Replacement for built-in function cmp that was removed in Python 3

Compare the two objects x and y and return an integer according to the outcome. The return value is negative if x < y, zero if x == y and strictly positive if x > y.

openalea.core.algo.dataflow_evaluation.cmp_posx(x, y)[source]#

todo

openalea.core.algo.dataflow_evaluation.cmp_priority(x, y)[source]#

todo

openalea.core.algo.dataflow_evaluation.db_connexion()[source]#

Return a curso on the database.

If the database does not exists, create it.

openalea.core.algo.dataflow_evaluation.db_create(cursor)[source]#
openalea.core.algo.dataflow_evaluation.get_database_name()[source]#
openalea.core.algo.dataflow_evaluation.provenance(vid, node, start_time, end_time)[source]#

Module contents#