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

Method test01c_sss

tables/tests/test_expression.py:1375–1393  ·  view source on GitHub ↗

Checking the __iter__ iterator (with ranges, III)

(self)

Source from the content-addressed store, hash-verified

1373 )
1374
1375 def test01c_sss(self):
1376 """Checking the __iter__ iterator (with ranges, III)"""
1377
1378 start, stop, step = self.range_
1379 expr = tb.Expr(self.sexpr, self.vars)
1380 expr.set_inputs_range(start, stop, step)
1381 r1 = np.array([row for row in expr])
1382 npvars = get_sliced_vars2(
1383 self.npvars, start, stop, step, self.shape, self.maindim
1384 )
1385 r2 = eval(self.sexpr, npvars)
1386 if common.verbose:
1387 print("Tested shape, maindim:", self.shape, self.maindim)
1388 print("Computed expression:", repr(r1[:]), r1.dtype)
1389 print("Should look like:", repr(r2), r2.dtype)
1390 self.assertTrue(
1391 common.areArraysEqual(r1[:], r2),
1392 "Evaluate is returning a wrong value.",
1393 )
1394
1395
1396class iter0(iterTestCase):

Callers

nothing calls this directly

Calls 2

set_inputs_rangeMethod · 0.95
get_sliced_vars2Function · 0.85

Tested by

no test coverage detected