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

Method test_testUfuncRegression

numpy/ma/tests/test_old_ma.py:722–757  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

720 array([1.0, 0, -1, pi / 2] * 2, mask=[1, 0] + [0] * 6),)
721
722 def test_testUfuncRegression(self):
723 f_invalid_ignore = [
724 'sqrt', 'arctanh', 'arcsin', 'arccos',
725 'arccosh', 'arctanh', 'log', 'log10', 'divide',
726 'true_divide', 'floor_divide', 'remainder', 'fmod']
727 for f in ['sqrt', 'log', 'log10', 'exp', 'conjugate',
728 'sin', 'cos', 'tan',
729 'arcsin', 'arccos', 'arctan',
730 'sinh', 'cosh', 'tanh',
731 'arcsinh',
732 'arccosh',
733 'arctanh',
734 'absolute', 'fabs', 'negative',
735 'floor', 'ceil',
736 'logical_not',
737 'add', 'subtract', 'multiply',
738 'divide', 'true_divide', 'floor_divide',
739 'remainder', 'fmod', 'hypot', 'arctan2',
740 'equal', 'not_equal', 'less_equal', 'greater_equal',
741 'less', 'greater',
742 'logical_and', 'logical_or', 'logical_xor']:
743 try:
744 uf = getattr(umath, f)
745 except AttributeError:
746 uf = getattr(fromnumeric, f)
747 mf = getattr(np.ma, f)
748 args = self.d[:uf.nin]
749 with np.errstate():
750 if f in f_invalid_ignore:
751 np.seterr(invalid='ignore')
752 if f in ['arctanh', 'log', 'log10']:
753 np.seterr(divide='ignore')
754 ur = uf(*args)
755 mr = mf(*args)
756 assert_(eq(ur.filled(0), mr.filled(0), f))
757 assert_(eqmask(ur.mask, mr.mask))
758
759 def test_reduce(self):
760 a = self.d[0]

Callers

nothing calls this directly

Calls 4

assert_Function · 0.90
eqFunction · 0.85
eqmaskFunction · 0.85
filledMethod · 0.45

Tested by

no test coverage detected