示例#1
0
 def with_table_columns(self):
     cols = [TableColumn(**d) for d in self.spec]
     table = DynamicTable("with_table_columns",
                          'PyNWB unit test',
                          'a test table',
                          columns=cols)
     return table
示例#2
0
 def test_constructor_ids_default(self):
     columns = [
         TableColumn(name=s['name'], description=s['description'], data=d)
         for s, d in zip(self.spec, self.data)
     ]
     table = DynamicTable("with_spec", 'a test table', columns=columns)
     self.check_table(table)
示例#3
0
 def with_columns_and_data(self):
     columns = [
         TableColumn(name=s['name'], description=s['description'], data=d)
         for s, d in zip(self.spec, self.data)
     ]
     return DynamicTable("with_columns_and_data",
                         'a test table',
                         columns=columns)
示例#4
0
 def test_constructor_ids(self):
     columns = [
         TableColumn(name=s['name'], description=s['description'], data=d)
         for s, d in zip(self.spec, self.data)
     ]
     table = DynamicTable("with_columns",
                          'PyNWB unit test',
                          'a test table',
                          ids=[0, 1, 2, 3, 4],
                          columns=columns)
     self.check_table(table)
示例#5
0
 def test_constructor_ids_bad_ids(self):
     columns = [
         TableColumn(name=s['name'], description=s['description'], data=d)
         for s, d in zip(self.spec, self.data)
     ]
     msg = "must provide same number of ids as length of columns"
     with self.assertRaisesRegex(ValueError, msg):
         DynamicTable("with_columns",
                      'a test table',
                      id=[0, 1],
                      columns=columns)
示例#6
0
 def test_constructor_ElementIdentifier_ids(self):
     columns = [
         TableColumn(name=s['name'], description=s['description'], data=d)
         for s, d in zip(self.spec, self.data)
     ]
     ids = ElementIdentifiers('ids', [0, 1, 2, 3, 4])
     table = DynamicTable("with_columns",
                          'a test table',
                          id=ids,
                          columns=columns)
     self.check_table(table)