MCPcopy Create free account
hub / github.com/PyTables/PyTables / test03a_readWhere

Method test03a_readWhere

tables/tests/test_numpy.py:745–762  ·  view source on GitHub ↗

Checking the return of NumPy in read_where method (strings).

(self)

Source from the content-addressed store, hash-verified

743 )
744
745 def test03a_readWhere(self):
746 """Checking the return of NumPy in read_where method (strings)."""
747
748 table = self.h5file.root.table
749 table.cols.color.create_index()
750 if self.close:
751 self._reopen(mode="a")
752 table = self.h5file.root.table
753 data = table.read_where('color == b"ab"')
754 if common.verbose:
755 print("Type of read:", type(data))
756 print("Length of the data read:", len(data))
757
758 # Check that both NumPy objects are equal
759 self.assertIsInstance(data, np.ndarray)
760
761 # Check that all columns have been selected
762 self.assertEqual(len(data), self.nrows)
763
764 def test03b_readWhere(self):
765 """Checking the return of NumPy in read_where method (numeric)."""

Callers

nothing calls this directly

Calls 3

create_indexMethod · 0.80
read_whereMethod · 0.80
_reopenMethod · 0.45

Tested by

no test coverage detected