MCPcopy Create free account
hub / github.com/numpy/numpy / test_7

Method test_7

numpy/ma/timer_comparison.py:343–375  ·  view source on GitHub ↗

Tests ufunc

(self)

Source from the content-addressed store, hash-verified

341
342 @np.errstate(all='ignore')
343 def test_7(self):
344 "Tests ufunc"
345 d = (self.array([1.0, 0, -1, pi/2]*2, mask=[0, 1]+[0]*6),
346 self.array([1.0, 0, -1, pi/2]*2, mask=[1, 0]+[0]*6),)
347 for f in ['sqrt', 'log', 'log10', 'exp', 'conjugate',
348# 'sin', 'cos', 'tan',
349# 'arcsin', 'arccos', 'arctan',
350# 'sinh', 'cosh', 'tanh',
351# 'arcsinh',
352# 'arccosh',
353# 'arctanh',
354# 'absolute', 'fabs', 'negative',
355# # 'nonzero', 'around',
356# 'floor', 'ceil',
357# # 'sometrue', 'alltrue',
358# 'logical_not',
359# 'add', 'subtract', 'multiply',
360# 'divide', 'true_divide', 'floor_divide',
361# 'remainder', 'fmod', 'hypot', 'arctan2',
362# 'equal', 'not_equal', 'less_equal', 'greater_equal',
363# 'less', 'greater',
364# 'logical_and', 'logical_or', 'logical_xor',
365 ]:
366 try:
367 uf = getattr(self.umath, f)
368 except AttributeError:
369 uf = getattr(fromnumeric, f)
370 mf = getattr(self.module, f)
371 args = d[:uf.nin]
372 ur = uf(*args)
373 mr = mf(*args)
374 self.assert_array_equal(ur.filled(0), mr.filled(0), f)
375 self.assert_array_equal(ur._mask, mr._mask)
376
377 @np.errstate(all='ignore')
378 def test_99(self):

Callers

nothing calls this directly

Calls 2

assert_array_equalMethod · 0.95
filledMethod · 0.45

Tested by

no test coverage detected