In [2]:
from dispel4py.workflow_graph import WorkflowGraph

# Connect to a remote registry
#from dispel4py import registry
#reg = registry.initRegistry()

# Import existing processing elements from the registry
from dispel4py.test.RandomWordProducer import RandomWordProducer
from dispel4py.test.Filter import RandomFilter

# Create the components of the workflow graph
words = RandomWordProducer()
filter = RandomFilter()

# Connect PEs together to form a graph
graph = WorkflowGraph()
graph.connect(words, 'output', filter, 'input')


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-97de12ed9113> in <module>()
      6 
      7 # Import existing processing elements from the registry
----> 8 from dispel4py.test.RandomWordProducer import RandomWordProducer
      9 from dispel4py.test.Filter import RandomFilter
     10 

ImportError: No module named test.RandomWordProducer

In [1]:
from dispel4py.base import create_iterative_chain
from dispel4py.examples.graph_testing.testing_PEs import TestProducer
from dispel4py.workflow_graph import WorkflowGraph

def addTwo(data):
    return 2 + data

def multiplyByFour(data):
    return 4 * data

def divideByTwo(data):
    return data/2

def subtract(data, n):
    return data - n

functions = [ addTwo, multiplyByFour, divideByTwo, (subtract, { 'n' : 1 }) ]
composite = create_iterative_chain(functions)
producer = TestProducer()

graph = WorkflowGraph()
graph.connect(producer, 'output', composite, 'input')

In [4]:
%load_ext dispel4py_extension


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-4-b4275e074f2a> in <module>()
----> 1 get_ipython().magic(u'load_ext dispel4py_extension')

/home/stephan/anaconda/envs/scientific1/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
   2334         magic_name, _, magic_arg_s = arg_s.partition(' ')
   2335         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2336         return self.run_line_magic(magic_name, magic_arg_s)
   2337 
   2338     #-------------------------------------------------------------------------

/home/stephan/anaconda/envs/scientific1/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
   2255                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
   2256             with self.builtin_trap:
-> 2257                 result = fn(*args,**kwargs)
   2258             return result
   2259 

/home/stephan/anaconda/envs/scientific1/lib/python2.7/site-packages/IPython/core/magics/extension.pyc in load_ext(self, module_str)

/home/stephan/anaconda/envs/scientific1/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
    191     # but it's overkill for just that one bit of state.
    192     def magic_deco(arg):
--> 193         call = lambda f, *a, **k: f(*a, **k)
    194 
    195         if callable(arg):

/home/stephan/anaconda/envs/scientific1/lib/python2.7/site-packages/IPython/core/magics/extension.pyc in load_ext(self, module_str)
     64         if not module_str:
     65             raise UsageError('Missing module name.')
---> 66         res = self.shell.extension_manager.load_extension(module_str)
     67 
     68         if res == 'already loaded':

/home/stephan/anaconda/envs/scientific1/lib/python2.7/site-packages/IPython/core/extensions.pyc in load_extension(self, module_str)
     87             if module_str not in sys.modules:
     88                 with prepended_to_syspath(self.ipython_extension_dir):
---> 89                     __import__(module_str)
     90             mod = sys.modules[module_str]
     91             if self._call_load_ipython_extension(mod):

ImportError: No module named dispel4py_extension

In [5]:
dispel4py_extension.load_ipython_extension()


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-5-36f465d254e4> in <module>()
----> 1 dispel4py_extension.load_ipython_extension()

NameError: name 'dispel4py_extension' is not defined

In [ ]: