working test ... for real
This commit is contained in:
parent
9a296f59f6
commit
5a1e225a08
|
@ -138,7 +138,7 @@ class Task:
|
|||
return Validation(True, "Validation Not Implemented")
|
||||
|
||||
def run(self):
|
||||
print self.input
|
||||
pass
|
||||
|
||||
def show_options_gui(self, editable=False):
|
||||
pass
|
||||
|
@ -190,25 +190,23 @@ class WorkflowView (gtk.VBox):
|
|||
self.remove_workflow()
|
||||
self.setup_workflow(workflow)
|
||||
|
||||
def run_task(self, task):
|
||||
logger.log('debug', 'Creating task: %s' % task.name)
|
||||
def run_task(self, task_class):
|
||||
logger.log('debug', 'Creating task: %s' % task_class.name)
|
||||
parent_data = main.project.current_data
|
||||
task_instance = task(input=["hei"])
|
||||
print task_instance.input
|
||||
1/0
|
||||
#validation = task.validate_input()
|
||||
task = task_class(input=parent_data)
|
||||
validation = task.validate_input()
|
||||
|
||||
#if not validation.succeeded:
|
||||
# logger.log('warning','Invalid Inputdata: ' + str(reason))
|
||||
# return
|
||||
if not validation.succeeded:
|
||||
logger.log('warning','Invalid Inputdata: ' + str(reason))
|
||||
return
|
||||
|
||||
#task_result = task.run(*parent_data)
|
||||
task_result = task.run()
|
||||
|
||||
|
||||
#if new_data != None:
|
||||
# main.project.add_data(parent_data, task_result, task.name)
|
||||
#else:
|
||||
# logger.log('debug', 'Task gave no output: %s' % task.name)
|
||||
if task_result != None:
|
||||
main.project.add_data(parent_data, task_result, task.name)
|
||||
else:
|
||||
logger.log('debug', 'Task gave no output: %s' % task.name)
|
||||
|
||||
logger.log('debug', 'Task ended: %s' % task.name)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import gtk
|
|||
from fluents import dataset, logger, plots, workflow
|
||||
#import geneontology
|
||||
#import gostat
|
||||
from scipy import array, randn, log, ones
|
||||
from scipy import array, randn, log, ones, newaxis
|
||||
import cPickle
|
||||
import networkx
|
||||
|
||||
|
@ -31,8 +31,8 @@ class TestDataTask(workflow.Task):
|
|||
logger.log('notice', 'Injecting foo test data')
|
||||
x = randn(500,15)
|
||||
X = dataset.Dataset(x)
|
||||
p = plots.ScatterPlot(X, X, 'rows', 'rows', '0_1', '0_2',name='scatter')
|
||||
# p2 = plots.ScatterMarkerPlot(X, X, 'rows', 'rows', '0_1', '0_2',name='marker')
|
||||
dname = X.get_dim_name()[0]
|
||||
p = plots.ScatterPlot(X, X, dname, dname, '0_1', '0_2',name='scatter')
|
||||
graph = networkx.XGraph()
|
||||
for x in 'ABCDEF':
|
||||
for y in 'ADE':
|
||||
|
@ -41,13 +41,12 @@ class TestDataTask(workflow.Task):
|
|||
ds_plot = plots.NetworkPlot(ds)
|
||||
|
||||
cds = dataset.CategoryDataset(ones([3, 3]))
|
||||
ds_scatter = plots.ScatterMarkerPlot(ds, ds,
|
||||
'rows_0', 'rows_0',
|
||||
'0_1', '0_2')
|
||||
dname2 = cds.get_dim_name()[0]
|
||||
ds_scatter = plots.ScatterMarkerPlot(cds, cds, dname2, dname2, '0_1', '0_2')
|
||||
lp = plots.LineViewPlot(X ,major_axis=0)
|
||||
vp = plots.VennPlot()
|
||||
self.datasets = [p]
|
||||
return [X, ds, p, ds_plot, ds_scatter, p2, cds, lp, vp]
|
||||
return [X, ds, p, ds_plot, ds_scatter, cds, lp, vp]
|
||||
|
||||
|
||||
class TestPlot(workflow.Task):
|
||||
|
@ -60,6 +59,7 @@ class TestPlot(workflow.Task):
|
|||
logger.log('notice', 'Injecting foo test data')
|
||||
x = randn(500,15)
|
||||
X = dataset.Dataset(x)
|
||||
p = plots.ScatterPlot(X, X, 'rows', 'rows', '0_1', '0_2',name='scatter')
|
||||
ii = X.get_dim_name()
|
||||
p = plots.ScatterPlot(X, X, ii[0], ii[0], '0_1', '0_2',name='scatter')
|
||||
|
||||
return [p]
|
||||
|
|
Reference in New Issue