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

Method test01a_sss

tables/tests/test_expression.py:1335–1353  ·  view source on GitHub ↗

Checking the __iter__ iterator (with ranges, I)

(self)

Source from the content-addressed store, hash-verified

1333 )
1334
1335 def test01a_sss(self):
1336 """Checking the __iter__ iterator (with ranges, I)"""
1337
1338 start, stop, step = self.range_[0], None, None
1339 expr = tb.Expr(self.sexpr, self.vars)
1340 expr.set_inputs_range(start, stop, step)
1341 r1 = np.array([row for row in expr])
1342 npvars = get_sliced_vars2(
1343 self.npvars, start, stop, step, self.shape, self.maindim
1344 )
1345 r2 = eval(self.sexpr, npvars)
1346 if common.verbose:
1347 print("Tested shape, maindim:", self.shape, self.maindim)
1348 print("Computed expression:", repr(r1[:]), r1.dtype)
1349 print("Should look like:", repr(r2), r2.dtype)
1350 self.assertTrue(
1351 common.areArraysEqual(r1[:], r2),
1352 "Evaluate is returning a wrong value.",
1353 )
1354
1355 def test01b_sss(self):
1356 """Checking the __iter__ iterator (with ranges, II)"""

Callers

nothing calls this directly

Calls 2

set_inputs_rangeMethod · 0.95
get_sliced_vars2Function · 0.85

Tested by

no test coverage detected