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

Method test01b_sss

tables/tests/test_expression.py:1355–1373  ·  view source on GitHub ↗

Checking the __iter__ iterator (with ranges, II)

(self)

Source from the content-addressed store, hash-verified

1353 )
1354
1355 def test01b_sss(self):
1356 """Checking the __iter__ iterator (with ranges, II)"""
1357
1358 start, stop, step = self.range_[0], self.range_[2], None
1359 expr = tb.Expr(self.sexpr, self.vars)
1360 expr.set_inputs_range(start, stop, step)
1361 r1 = np.array([row for row in expr])
1362 npvars = get_sliced_vars2(
1363 self.npvars, start, stop, step, self.shape, self.maindim
1364 )
1365 r2 = eval(self.sexpr, npvars)
1366 if common.verbose:
1367 print("Tested shape, maindim:", self.shape, self.maindim)
1368 print("Computed expression:", repr(r1[:]), r1.dtype)
1369 print("Should look like:", repr(r2), r2.dtype)
1370 self.assertTrue(
1371 common.areArraysEqual(r1[:], r2),
1372 "Evaluate is returning a wrong value.",
1373 )
1374
1375 def test01c_sss(self):
1376 """Checking the __iter__ iterator (with ranges, III)"""

Callers

nothing calls this directly

Calls 2

set_inputs_rangeMethod · 0.95
get_sliced_vars2Function · 0.85

Tested by

no test coverage detected