MCPcopy Index your code
hub / github.com/numpy/numpy / test_testUfuncRegression

Method test_testUfuncRegression

numpy/ma/tests/test_core.py:2643–2671  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2641 array([1.0, 0, -1, pi / 2] * 2, mask=[1, 0] + [0] * 6),)
2642
2643 def test_testUfuncRegression(self):
2644 # Tests new ufuncs on MaskedArrays.
2645 for f in ['sqrt', 'log', 'log10', 'exp', 'conjugate',
2646 'sin', 'cos', 'tan',
2647 'arcsin', 'arccos', 'arctan',
2648 'sinh', 'cosh', 'tanh',
2649 'arcsinh',
2650 'arccosh',
2651 'arctanh',
2652 'absolute', 'fabs', 'negative',
2653 'floor', 'ceil',
2654 'logical_not',
2655 'add', 'subtract', 'multiply',
2656 'divide', 'true_divide', 'floor_divide',
2657 'remainder', 'fmod', 'hypot', 'arctan2',
2658 'equal', 'not_equal', 'less_equal', 'greater_equal',
2659 'less', 'greater',
2660 'logical_and', 'logical_or', 'logical_xor',
2661 ]:
2662 try:
2663 uf = getattr(umath, f)
2664 except AttributeError:
2665 uf = getattr(fromnumeric, f)
2666 mf = getattr(numpy.ma.core, f)
2667 args = self._create_data()[:uf.nin]
2668 ur = uf(*args)
2669 mr = mf(*args)
2670 assert_equal(ur.filled(0), mr.filled(0), f)
2671 assert_mask_equal(ur.mask, mr.mask, err_msg=f)
2672
2673 def test_reduce(self):
2674 # Tests reduce on MaskedArrays.

Callers

nothing calls this directly

Calls 4

_create_dataMethod · 0.95
assert_equalFunction · 0.90
assert_mask_equalFunction · 0.90
filledMethod · 0.45

Tested by

no test coverage detected