mainly overhaul of observers, and removal of project singleton

This commit is contained in:
2006-04-20 10:27:58 +00:00
parent f45c9c6bf7
commit 6a4ae8ecf1
6 changed files with 61 additions and 56 deletions

View File

@@ -22,10 +22,11 @@ class Dataset:
raise ValueError,"array dims and identifyer mismatch"
for axis,(dim_name,ids) in enumerate(def_list):
enum_ids = {}
if dim_name not in project.c_p.dim_names:
dim_name = project.c_p.suggest_dim_name(dim_name)
if not ids:
ids = self._create_identifiers(axis)
#if dim_name not in project.c_p.dim_names:
# dim_name = project.c_p.suggest_dim_name(dim_name)
if not ids:
logger.log('debug','Creating identifiers along: '+dim_name)
ids = self._create_identifiers(axis)
for num,name in enumerate(ids):
enum_ids[name] = num
self.ids[dim_name] = enum_ids
@@ -70,6 +71,7 @@ class Dataset:
dim_ids = self.ids[dim_name]
if type(index)==int:
index = [index]
return set([id for id,ind in dim_ids.items() if ind in index])
def extract_index_from_id(self,dim_name,id):