Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

* system/fluents.py: Fixed a bug where the the application tried to load

a toolbar from None

 * system/plots.py: Fixed MainView.insert_view that was a no-op when in large
   view.

 * system/dataset.py: Changed __str__ of dataset to also show names of dimensions.
This commit is contained in:
Einar Ryeng 2006-07-21 14:30:09 +00:00
parent aca9a47f56
commit 87f87e36c8
4 changed files with 21 additions and 13 deletions

View File

@ -1,4 +1,3 @@
from system import logger
from scipy import atleast_2d,asarray,ArrayType from scipy import atleast_2d,asarray,ArrayType
@ -55,7 +54,6 @@ class Dataset:
self.shape = array.shape self.shape = array.shape
if shape != None: if shape != None:
if self.shape!=shape: if self.shape!=shape:
#logger.log("debug","Dataset and input shape mismatch")
raise ValueError, "Differing in array and provided. %s != %s" % (self.shape, shape) raise ValueError, "Differing in array and provided. %s != %s" % (self.shape, shape)
if identifiers!=None: if identifiers!=None:
self._set_identifiers(identifiers,all_dims) self._set_identifiers(identifiers,all_dims)
@ -71,8 +69,8 @@ class Dataset:
self._all_dims = all_dims self._all_dims = all_dims
def __str__self(self): def __str__(self):
return self._name return self._name + ":" + self._dims.__str__()
def __iter__(self): def __iter__(self):
"""Returns an iterator over dimensions of dataset.""" """Returns an iterator over dimensions of dataset."""
@ -193,7 +191,6 @@ class Dataset:
reverse[value] = key reverse[value] = key
return [self._map[dim][key] for key in idents] return [self._map[dim][key] for key in idents]
class CategoryDataset(Dataset): class CategoryDataset(Dataset):
"""The category dataset class. """The category dataset class.
@ -247,3 +244,4 @@ class Selection:
"""Handles selected identifiers along each dimension of a dataset""" """Handles selected identifiers along each dimension of a dataset"""
def __init__(self): def __init__(self):
self.current_selection={} self.current_selection={}

View File

@ -98,7 +98,11 @@ class FluentApp:
if self._plot_toolbar: if self._plot_toolbar:
window.remove(self._plot_toolbar) window.remove(self._plot_toolbar)
if view:
self._plot_toolbar = view.get_toolbar() self._plot_toolbar = view.get_toolbar()
else:
self._plot_toolbar = None
if self._plot_toolbar: if self._plot_toolbar:
window.add(self._plot_toolbar) window.add(self._plot_toolbar)
@ -127,6 +131,8 @@ class FluentApp:
return self.navigator_view return self.navigator_view
# Event handlers. # Event handlers.
# These methods are called by the gtk framework in response to events and
# should not be called directly.
def on_single_view(self, *ignored): def on_single_view(self, *ignored):
self['main_view'].goto_large() self['main_view'].goto_large()

View File

@ -207,7 +207,10 @@ class MainView (gtk.Notebook):
self.set_current_page(0) self.set_current_page(0)
def insert_view(self, view): def insert_view(self, view):
if self.get_current_page() == 0:
vf = self.get_active_small_view() vf = self.get_active_small_view()
else:
vf = self._large_view
vf.set_view(view) vf.set_view(view)
def show(self): def show(self):

View File

@ -5,11 +5,11 @@ from system import dataset, logger, plots, workflow
from scipy import array,randn,log from scipy import array,randn,log
import cPickle import cPickle
class GOWorkflow (workflow.Workflow): class TestWorkflow (workflow.Workflow):
name = 'Gene Ontology Workflow' name = 'Test Workflow'
ident = 'go' ident = 'test'
description = 'Gene Ontology Workflow. This workflow currently serves as a general testing workflow.' description = 'Test Gene Ontology Workflow. This workflow currently serves as a general testing workflow.'
def __init__(self, app): def __init__(self, app):
workflow.Workflow.__init__(self, app) workflow.Workflow.__init__(self, app)
@ -102,7 +102,8 @@ class TestDataFunction(workflow.Function):
logger.log('notice', 'Injecting foo test data') logger.log('notice', 'Injecting foo test data')
x = randn(20,30) x = randn(20,30)
X = dataset.Dataset(x) X = dataset.Dataset(x)
return [X, plots.SinePlot()] p = plots.ScatterPlot(X, X, 'rows', 'rows', '0_1', '0_2')
return [X, plots.SinePlot(), p]
class DatasetLog(workflow.Function): class DatasetLog(workflow.Function):
def __init__(self): def __init__(self):