The selection view now works. Functions can return a dataset.Selection object which will be stored in the selection list.
This commit is contained in:
@@ -19,6 +19,7 @@ class TestWorkflow (workflow.Workflow):
|
||||
load.add_function(CelFileImportFunction())
|
||||
load.add_function(TestDataFunction())
|
||||
load.add_function(DatasetLoadFunction())
|
||||
load.add_function(SelectFunction())
|
||||
self.add_stage(load)
|
||||
|
||||
preproc = workflow.Stage('preprocess', 'Preprocessing')
|
||||
@@ -116,6 +117,17 @@ class TestDataFunction(workflow.Function):
|
||||
ds_scatter = plots.ScatterMarkerPlot(ds, ds, 'rows_0', 'rows_0', '0_1', '0_2')
|
||||
return [X, ds, plots.SinePlot(), p, ds_plot, ds_scatter,p2]
|
||||
|
||||
class SelectFunction(workflow.Function):
|
||||
def __init__(self):
|
||||
workflow.Function.__init__(self, 'select', 'Select')
|
||||
|
||||
def run(self, data):
|
||||
s = dataset.Selection('Arbitrary selection')
|
||||
s.select('rows', ['0_1', '0_2'])
|
||||
print s['rows']
|
||||
print s.dims()
|
||||
return [s]
|
||||
|
||||
class DatasetLog(workflow.Function):
|
||||
def __init__(self):
|
||||
workflow.Function.__init__(self, 'log', 'Log')
|
||||
|
Reference in New Issue
Block a user