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

Method test01a_out

tables/tests/test_expression.py:305–323  ·  view source on GitHub ↗

Checking expressions with mixed objects (`out` param)

(self)

Source from the content-addressed store, hash-verified

303 self.assertEqual(r1, r2, msg=msg)
304
305 def test01a_out(self):
306 """Checking expressions with mixed objects (`out` param)"""
307
308 expr = tb.Expr(self.expr, self.vars)
309 for r1 in self.rnda, self.rarr, self.rcarr, self.rearr, self.rcol:
310 if common.verbose:
311 print("Checking output container:", type(r1))
312 expr.set_output(r1)
313 r1 = expr.eval()
314 if not isinstance(r1, type(self.rnda)):
315 r1 = r1[:]
316 r2 = eval(self.expr, self.npvars)
317 if common.verbose:
318 print("Computed expression:", repr(r1), r1.dtype)
319 print("Should look like:", repr(r2), r2.dtype)
320 self.assertTrue(
321 common.areArraysEqual(r1, r2),
322 "Evaluate is returning a wrong value.",
323 )
324
325 def test01b_out_scalars(self):
326 """Checking expressions with mixed objects (`out` param, scalars)"""

Callers

nothing calls this directly

Calls 2

set_outputMethod · 0.95
evalMethod · 0.95

Tested by

no test coverage detected