mainly play in plots
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import dataset
|
||||
import scipy
|
||||
|
||||
class Project:
|
||||
def __init__(self,name="Testing"):
|
||||
@@ -27,9 +28,10 @@ class Project:
|
||||
if modifier != observer:
|
||||
observer.update(self)
|
||||
|
||||
def set_selection(self,dim_name,selection):
|
||||
def set_selection(self,sel_obj,dim_name,selection):
|
||||
"""Sets selection and notifies observers"""
|
||||
current_selection = set(selection)
|
||||
sel_obj.current_selection[dim_name] = current_selection
|
||||
self.current_selection[dim_name] = current_selection
|
||||
self.notify()
|
||||
|
||||
@@ -50,5 +52,20 @@ class Project:
|
||||
dim_name = dim_name + "_t"
|
||||
return dim_name
|
||||
|
||||
# FIXME: Singleton project should be removed.
|
||||
# FIXME: Singleton project should be removed.
|
||||
c_p = Project()
|
||||
|
||||
#add test data
|
||||
x = scipy.rand(2000,3)
|
||||
def_list = [ ['samples',[]], ['genes',['a','b','c']] ]
|
||||
test_data = dataset.Dataset(x,def_list)
|
||||
c_p.add_dataset(test_data)
|
||||
|
||||
y = scipy.rand(2,2)
|
||||
def_list = [ ['samples',['1','2']], ['yclasses',['C','N']] ]
|
||||
test_data = dataset.Dataset(y,def_list)
|
||||
c_p.add_dataset(test_data)
|
||||
|
||||
#add selection object
|
||||
c_p.sel_obj = dataset.Selection()
|
||||
|
||||
|
Reference in New Issue
Block a user