From 7ef01d37f0c3a78f9fbbb49c5a1dc0a65617eb97 Mon Sep 17 00:00:00 2001 From: flatberg Date: Mon, 3 Sep 2007 17:51:22 +0000 Subject: [PATCH] --- fluents/fluents.py | 2 ++ fluents/workflow.py | 10 ++-------- workflows/test_workflow.py | 23 +++++++++++------------ 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/fluents/fluents.py b/fluents/fluents.py index a4b0a7e..f391364 100644 --- a/fluents/fluents.py +++ b/fluents/fluents.py @@ -22,6 +22,7 @@ DATADIR = os.path.dirname(sys.modules['fluents'].__file__) ICONDIR = os.path.join(DATADIR,"..","icons") GLADEFILENAME = os.path.join(DATADIR, 'fluents.glade') + class IconFactory: """Factory for icons that ensures that each icon is only loaded once.""" @@ -43,6 +44,7 @@ class IconFactory: icon_factory = IconFactory(ICONDIR) + class TableSizeSelection(gtk.Window): def __init__(self): diff --git a/fluents/workflow.py b/fluents/workflow.py index 70eabea..db2347e 100644 --- a/fluents/workflow.py +++ b/fluents/workflow.py @@ -60,9 +60,7 @@ class Workflow: description = "Workflow Description" def __init__(self): - print "Setting stages" self.stages = [] - self.stages_by_id = {} def get_data_file_name(self, filename): """Checks if a file with the given name exists in the data directory. @@ -79,7 +77,7 @@ class Workflow: def add_stage(self, stage): self.stages.append(stage) - self.stages_by_id[stage.id] = stage + #self.stages_by_id[stage.id] = stage def print_tree(self): print self.name @@ -109,11 +107,9 @@ class Stage: self.id = id self.name = name self.tasks = [] - self.tasks_by_id = {} def add_task(self, task): self.tasks.append(task) - #self.tasks_by_id[task.id] = task class Task: @@ -151,7 +147,6 @@ class Validation: class WorkflowView (gtk.VBox): - def __init__(self, wf): gtk.VBox.__init__(self) self.workflow = wf @@ -201,8 +196,7 @@ class WorkflowView (gtk.VBox): return task_result = task.run() - - + if task_result != None: main.project.add_data(parent_data, task_result, task.name) else: diff --git a/workflows/test_workflow.py b/workflows/test_workflow.py index 390419e..b1a3048 100644 --- a/workflows/test_workflow.py +++ b/workflows/test_workflow.py @@ -1,11 +1,11 @@ import gtk from fluents import dataset, logger, plots, workflow -#import geneontology -#import gostat + from scipy import array, randn, log, ones, newaxis import cPickle import networkx + class TestWorkflow (workflow.Workflow): name = 'Test Workflow' @@ -15,15 +15,14 @@ class TestWorkflow (workflow.Workflow): def __init__(self): workflow.Workflow.__init__(self) - load = workflow.Stage('load', 'Test Data') - load.add_task(TestDataTask) - load.add_task(TestPlot) - self.add_stage(load) + test_stage = workflow.Stage('test', 'Test Data') + test_stage.tasks.append(TestDataTask) + test_stage.tasks.append(TestPlot) + self.stages.append(test_stage) class TestDataTask(workflow.Task): name = "Test data" - def __init__(self, input): workflow.Task.__init__(self, input) @@ -56,10 +55,10 @@ class TestPlot(workflow.Task): workflow.Task.__init__(self, input) def run(self): - logger.log('notice', 'Injecting foo test data') - x = randn(500,15) - X = dataset.Dataset(x) - ii = X.get_dim_name() - p = plots.ScatterPlot(X, X, ii[0], ii[0], '0_1', '0_2',name='scatter') + #logger.log('notice', 'Injecting % dataset') %self.input[0].get_name() + X = self.input[0] + ii = X.get_dim_name()[0] + ids = X.get_identifiers(ii, indices=[0,1]) + p = plots.ScatterPlot(X, X, ii, ii, ids[0], ids[1],name='scatter') return [p]