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

Method test03_sss

tables/tests/test_expression.py:405–422  ·  view source on GitHub ↗

Checking start, stop, step as numpy.int64.

(self)

Source from the content-addressed store, hash-verified

403 )
404
405 def test03_sss(self):
406 """Checking start, stop, step as numpy.int64."""
407
408 start, stop, step = (
409 np.int64(i) for i in (self.start, self.stop, self.step)
410 )
411 expr = tb.Expr(self.expr, self.vars)
412 expr.set_inputs_range(start, stop, step)
413 r1 = expr.eval()
414 npvars = get_sliced_vars(self.npvars, start, stop, step)
415 r2 = eval(self.expr, npvars)
416 if common.verbose:
417 print("Computed expression:", repr(r1), r1.dtype)
418 print("Should look like:", repr(r2), r2.dtype)
419 self.assertTrue(
420 common.areArraysEqual(r1, r2),
421 "Evaluate is returning a wrong value.",
422 )
423
424
425class MixedContainers0(MixedContainersTestCase):

Callers

nothing calls this directly

Calls 3

set_inputs_rangeMethod · 0.95
evalMethod · 0.95
get_sliced_varsFunction · 0.85

Tested by

no test coverage detected