Inherits from
- HasTraits: enthought.traits.has_traits.HasTraits
Attributes
- block
The block corresponding to the source code:
block = Property(depends_on = [ 'statements' ])
- body
The body of the code corresponding to the statements
body = Property(depends_on = [ 'statements', 'statements_items' ])
- code
All the code put together = imports + local_defs + body
code = Property(depends_on = [ 'statements', 'statements_items', 'statements.call_signature', 'statements.inputs.binding', 'statements.outputs.binding' ])
- dep_graph
Dependency Graph of all the statements in the body
dep_graph = Property(depends_on = [ 'statements', 'statements_items' ])
- imports_and_locals
The imports and local definitions
imports_and_locals = Property(depends_on = [ 'statements', 'statements_items' ])
- sorted_statements
Topologically sorted list of function calls in statements
sorted_statements = Property(depends_on = [ 'statements', 'statements_items' ])
- statements
List of function calls, groups, and expressions These must all have inputs, outputs, uuid
statements = List(Any)
Inherited from base classes
Method summary
- add_function(self, func_call)
- execute(self, context, globals = None, inputs = None, outputs = None)
- from_ast(cls, ast)
- from_code(cls, code)
- from_file(cls, filename)
- mark_unsatisfied_inputs(self, available_names)
- merge_statements(self, ids)
- remove_all_function(self, func_call)
- remove_function(self, func_call)
- restricted(self, inputs = None, outputs = None)
- unmerge_statements(self, id)
Inherited from base classes
- __deepcopy__(self, memo)
- __getstate__(self)
- __prefix_trait__(self, name, is_set)
- __reduce_ex__(self, protocol)
- __setstate__(self, state, trait_change_notify = True)
- add_class_trait(cls, name, *trait)
- add_trait(self, name, *trait)
- add_trait_category(cls, category)
- add_trait_listener(self, object, prefix = '')
- all_trait_names(self)
- base_trait(self, name)
- class_default_traits_view(cls)
- class_editable_traits(cls)
- class_trait_names(cls, **metadata)
- class_trait_view(cls, name = None, view_element = None)
- class_trait_view_elements(cls)
- class_traits(cls, **metadata)
- clone_traits(self, traits = None, memo = None, copy = None, **metadata)
- configure_traits(self, filename = None, view = None, kind = None, edit = True, context = None, handler = None, id = '', scrollable = None, **args)
- copy_traits(self, other, traits = None, memo = None, copy = None, **metadata)
- copyable_trait_names(self, **metadata)
- default_traits_view(self)
- edit_traits(self, view = None, parent = None, kind = None, context = None, handler = None, id = '', scrollable = None, **args)
- editable_traits(self)
- has_traits_interface(self, *interfaces)
- on_trait_change(self, handler, name = None, remove = False, dispatch = 'same', priority = False, deferred = False)
- print_traits(self, show_help = False, **metadata)
- remove_trait(self, name)
- remove_trait_listener(self, object, prefix = '')
- reset_traits(self, traits = None, **metadata)
- set_trait_dispatch_handler(cls, name, klass, override = False)
- sync_trait(self, trait_name, object, alias = None, mutual = True, remove = False)
- trait(self, name, force = False, copy = False)
- trait_context(self)
- trait_get(self, *names, **metadata)
- trait_monitor(cls, handler, remove = False)
- trait_names(self, **metadata)
- trait_set(self, trait_change_notify = True, **traits)
- trait_setq(self, **traits)
- trait_subclasses(cls, all = False)
- trait_view(self, name = None, view_element = None)
- trait_view_elements(self)
- trait_views(self, klass = None)
- traits(self, **metadata)
- validate_trait(self, name, value)
Methods
- add_function(self, func_call)
Add a function call to the block. Append to the list of statements. The code will be generated from the sorted_statements.
FIXME: Add imports from func_call being added.
- execute(self, context, globals = None, inputs = None, outputs = None)
Execute the code in the given context.
Parameters
- context : sufficiently dict-like object
- The namespace to execute the code in.
- globals : dict, optional
- The global namespace for the code.
- inputs : list of str, optional
- Names that can be used to restrict the execution to portions of the code. Ideally, only code that is affected by these inputs variables is executed.
- outputs : list of str, optional
- Names that can be used to restrict the execution to portions of the code. Ideally, only code that affects these outputs variables is executed.
- from_ast(cls, ast)
Create an ExecutionModel object from the ast.
- from_code(cls, code)
Create an ExecutionModel object from the code. Get the ast for the code and pass to from_ast() class method.
- from_file(cls, filename)
- mark_unsatisfied_inputs(self, available_names)
Return a list of names of variables which are required to run the entire execution.
Each unsatisfied InputVariable will be marked as unsatisfied.
Parameters
- available_names : sequence/set of str
- The names which are available for execution.
Returns
required_names : set of str satisfied_names : set of str
- merge_statements(self, ids)
Merge statements specified by ids into a Group
- remove_all_function(self, func_call)
Given a function, remove all occurrences of this function from the list of statements.
- remove_function(self, func_call)
Given a function, remove it from the list of statements.
- restricted(self, inputs = None, outputs = None)
Return an ExecutionModel which has been restricted to the given inputs and outputs.
Parameters
- inputs : sequence of str, optional
- The names of the input variables which have changed. If not provided, then every possible input will be considered to have changed.
- outputs : sequence of str, optional
- The names of the output variables which are desired to recompute.
Returns
model : ExecutionModel
- unmerge_statements(self, id)
Seperate Group specified by id into statements.