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

Method test_clip_complex

numpy/core/tests/test_numeric.py:1957–1967  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1955 assert_array_strict_equal(ac, act)
1956
1957 def test_clip_complex(self):
1958 # Address Issue gh-5354 for clipping complex arrays
1959 # Test native complex input without explicit min/max
1960 # ie, either min=None or max=None
1961 a = np.ones(10, dtype=complex)
1962 m = a.min()
1963 M = a.max()
1964 am = self.fastclip(a, m, None)
1965 aM = self.fastclip(a, None, M)
1966 assert_array_strict_equal(am, a)
1967 assert_array_strict_equal(aM, a)
1968
1969 def test_clip_non_contig(self):
1970 # Test clip for non contiguous native input and native scalar min/max.

Callers

nothing calls this directly

Calls 4

fastclipMethod · 0.95
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected