Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0
This commit is contained in:
Arnar Flatberg 2007-09-03 17:51:22 +00:00
parent 5a1e225a08
commit 7ef01d37f0
3 changed files with 15 additions and 20 deletions

View File

@ -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):

View File

@ -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
@ -202,7 +197,6 @@ class WorkflowView (gtk.VBox):
task_result = task.run()
if task_result != None:
main.project.add_data(parent_data, task_result, task.name)
else:

View File

@ -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]