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

Method test_partition_empty_array

numpy/_core/tests/test_multiarray.py:3349–3357  ·  view source on GitHub ↗
(self, kth_dtype)

Source from the content-addressed store, hash-verified

3347
3348 @pytest.mark.parametrize("kth_dtype", np.typecodes["AllInteger"])
3349 def test_partition_empty_array(self, kth_dtype):
3350 # check axis handling for multidimensional empty arrays
3351 kth = np.array(0, dtype=kth_dtype)[()]
3352 a = np.array([]).reshape((3, 2, 1, 0))
3353 for axis in range(-a.ndim, a.ndim):
3354 msg = f'test empty array partition with axis={axis}'
3355 assert_equal(np.partition(a, kth, axis=axis), a, msg)
3356 msg = 'test empty array partition with axis=None'
3357 assert_equal(np.partition(a, kth, axis=None), a.ravel(), msg)
3358
3359 @pytest.mark.parametrize("kth_dtype", np.typecodes["AllInteger"])
3360 def test_argpartition_empty_array(self, kth_dtype):

Callers

nothing calls this directly

Calls 4

assert_equalFunction · 0.90
reshapeMethod · 0.80
partitionMethod · 0.45
ravelMethod · 0.45

Tested by

no test coverage detected