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

Function test_npymath_real

numpy/_core/tests/test_multiarray.py:10928–10952  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10926
10927
10928def test_npymath_real():
10929 # Smoketest npymath functions
10930 from numpy._core._multiarray_tests import (
10931 npy_cosh,
10932 npy_log10,
10933 npy_sinh,
10934 npy_tan,
10935 npy_tanh,
10936 )
10937
10938 funcs = {npy_log10: np.log10,
10939 npy_cosh: np.cosh,
10940 npy_sinh: np.sinh,
10941 npy_tan: np.tan,
10942 npy_tanh: np.tanh}
10943 vals = (1, np.inf, -np.inf, np.nan)
10944 types = (np.float32, np.float64, np.longdouble)
10945
10946 with np.errstate(all='ignore'):
10947 for fun, npfun in funcs.items():
10948 for x, t in itertools.product(vals, types):
10949 z = t(x)
10950 got = fun(z)
10951 expected = npfun(z)
10952 assert_allclose(got, expected)
10953
10954def test_uintalignment_and_alignment():
10955 # alignment code needs to satisfy these requirements:

Callers

nothing calls this directly

Calls 3

assert_allcloseFunction · 0.90
tFunction · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…