Fixed getting empty selections.

This commit is contained in:
2006-05-02 15:40:54 +00:00
parent 56c07c6392
commit 91c1d8ea8b
2 changed files with 7 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ import unittest
import sys
sys.path.append('../..')
from system.dataset import *
from scipy import rand,shape
from scipy import rand,shape, array
class DatasetTest(unittest.TestCase):
@@ -37,9 +37,12 @@ class DatasetTest(unittest.TestCase):
self.assertEquals(['gene_a', 'gene_b', 'gene_c'], data.get_identifiers('genes', [0, 1, 2]))
# "advanced" lookup
self.assertEquals(['gene_c', 'gene_a'], data.get_identifiers('genes', [2, 0]))
# handle empty matrix of indices
self.assertEquals([], data.get_identifiers('samples', array([])))
# other dimension
self.assertEquals(['sample_a', 'sample_b'], data.get_identifiers('samples', [0, 1]))
#def testExtraction(self):
# ids = ['gene_a','gene_b']
# dim_name = 'genes'