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

Method test_clip_with_out_simple2

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

Source from the content-addressed store, hash-verified

2203 assert_array_strict_equal(ac, act)
2204
2205 def test_clip_with_out_simple2(self):
2206 # Test native int32 input with double min/max and int32 out
2207 a = self._generate_int32_data(self.nr, self.nc)
2208 m = np.float64(0)
2209 M = np.float64(2)
2210 ac = np.zeros(a.shape, dtype=np.int32)
2211 act = ac.copy()
2212 self.fastclip(a, m, M, out=ac, casting="unsafe")
2213 self.clip(a, m, M, act)
2214 assert_array_strict_equal(ac, act)
2215
2216 def test_clip_with_out_simple_int32(self):
2217 # Test native int32 input with int32 scalar min/max and int64 out

Callers

nothing calls this directly

Calls 5

_generate_int32_dataMethod · 0.95
fastclipMethod · 0.95
clipMethod · 0.95
copyMethod · 0.45

Tested by

no test coverage detected