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

Method test03b_readWhere

tables/tests/test_numpy.py:764–781  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

762 self.assertEqual(len(data), self.nrows)
763
764 def test03b_readWhere(self):
765 """Checking the return of NumPy in read_where method (numeric)."""
766
767 table = self.h5file.root.table
768 table.cols.z.create_index()
769 if self.close:
770 self._reopen(mode="a")
771 table = self.h5file.root.table
772 data = table.read_where("z == 0")
773 if common.verbose:
774 print("Type of read:", type(data))
775 print("Length of the data read:", len(data))
776
777 # Check that both NumPy objects are equal
778 self.assertIsInstance(data, np.ndarray)
779
780 # Check that all columns have been selected
781 self.assertEqual(len(data), 0)
782
783 def test04a_createTable(self):
784 """Checking the Table creation from a numpy recarray."""

Callers

nothing calls this directly

Calls 3

create_indexMethod · 0.80
read_whereMethod · 0.80
_reopenMethod · 0.45

Tested by

no test coverage detected