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

Function test_complex_inf_nan

numpy/_core/tests/test_print.py:76–97  ·  view source on GitHub ↗

Check inf/nan formatting of complex types.

(dtype)

Source from the content-addressed store, hash-verified

74
75@pytest.mark.parametrize('dtype', [np.complex64, np.cdouble, np.clongdouble])
76def test_complex_inf_nan(dtype):
77 """Check inf/nan formatting of complex types."""
78 TESTS = {
79 complex(np.inf, 0): "(inf+0j)",
80 complex(0, np.inf): "infj",
81 complex(-np.inf, 0): "(-inf+0j)",
82 complex(0, -np.inf): "-infj",
83 complex(np.inf, 1): "(inf+1j)",
84 complex(1, np.inf): "(1+infj)",
85 complex(-np.inf, 1): "(-inf+1j)",
86 complex(1, -np.inf): "(1-infj)",
87 complex(np.nan, 0): "(nan+0j)",
88 complex(0, np.nan): "nanj",
89 complex(-np.nan, 0): "(nan+0j)",
90 complex(0, -np.nan): "nanj",
91 complex(np.nan, 1): "(nan+1j)",
92 complex(1, np.nan): "(1+nanj)",
93 complex(-np.nan, 1): "(nan+1j)",
94 complex(1, -np.nan): "(1+nanj)",
95 }
96 for c, s in TESTS.items():
97 assert_equal(str(dtype(c)), s)
98
99
100# print tests

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
dtypeFunction · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…