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

Method test_basic_ufuncs

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

Source from the content-addressed store, hash-verified

1268 assert_equal(xm.mask, [1, 1])
1269
1270 def test_basic_ufuncs(self):
1271 # Test various functions such as sin, cos.
1272 x, y, _, _, _, xm, ym, z, zm, _ = self._create_data()
1273 assert_equal(np.cos(x), cos(xm))
1274 assert_equal(np.cosh(x), cosh(xm))
1275 assert_equal(np.sin(x), sin(xm))
1276 assert_equal(np.sinh(x), sinh(xm))
1277 assert_equal(np.tan(x), tan(xm))
1278 assert_equal(np.tanh(x), tanh(xm))
1279 assert_equal(np.sqrt(abs(x)), sqrt(xm))
1280 assert_equal(np.log(abs(x)), log(xm))
1281 assert_equal(np.log10(abs(x)), log10(xm))
1282 assert_equal(np.exp(x), exp(xm))
1283 assert_equal(np.arcsin(z), arcsin(zm))
1284 assert_equal(np.arccos(z), arccos(zm))
1285 assert_equal(np.arctan(z), arctan(zm))
1286 assert_equal(np.arctan2(x, y), arctan2(xm, ym))
1287 assert_equal(np.absolute(x), absolute(xm))
1288 assert_equal(np.angle(x + 1j * y), angle(xm + 1j * ym))
1289 assert_equal(np.angle(x + 1j * y, deg=True), angle(xm + 1j * ym, deg=True))
1290 assert_equal(np.equal(x, y), equal(xm, ym))
1291 assert_equal(np.not_equal(x, y), not_equal(xm, ym))
1292 assert_equal(np.less(x, y), less(xm, ym))
1293 assert_equal(np.greater(x, y), greater(xm, ym))
1294 assert_equal(np.less_equal(x, y), less_equal(xm, ym))
1295 assert_equal(np.greater_equal(x, y), greater_equal(xm, ym))
1296 assert_equal(np.conjugate(x), conjugate(xm))
1297
1298 def test_basic_ufuncs_masked(self):
1299 # Mostly regression test for gh-25635

Callers

nothing calls this directly

Calls 15

_create_dataMethod · 0.95
assert_equalFunction · 0.90
equalFunction · 0.90
not_equalFunction · 0.90
lessFunction · 0.90
greaterFunction · 0.90
less_equalFunction · 0.90
greater_equalFunction · 0.90
sqrtFunction · 0.85
logFunction · 0.85
log10Function · 0.85
arcsinFunction · 0.85

Tested by

no test coverage detected