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

Method test_rotation_axes

numpy/lib/tests/test_function_base.py:124–150  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

122 assert_equal(rot90(a, axes=(1, 2)), rot90(a, axes=(-2, -1)))
123
124 def test_rotation_axes(self):
125 a = np.arange(8).reshape((2, 2, 2))
126
127 a_rot90_01 = [[[2, 3],
128 [6, 7]],
129 [[0, 1],
130 [4, 5]]]
131 a_rot90_12 = [[[1, 3],
132 [0, 2]],
133 [[5, 7],
134 [4, 6]]]
135 a_rot90_20 = [[[4, 0],
136 [6, 2]],
137 [[5, 1],
138 [7, 3]]]
139 a_rot90_10 = [[[4, 5],
140 [0, 1]],
141 [[6, 7],
142 [2, 3]]]
143
144 assert_equal(rot90(a, axes=(0, 1)), a_rot90_01)
145 assert_equal(rot90(a, axes=(1, 0)), a_rot90_10)
146 assert_equal(rot90(a, axes=(1, 2)), a_rot90_12)
147
148 for k in range(1, 5):
149 assert_equal(rot90(a, k=k, axes=(2, 0)),
150 rot90(a_rot90_20, k=k - 1, axes=(2, 0)))
151
152 @pytest.mark.parametrize('k', [2.0, 2.25])
153 def test_noninteger_k_deprecation_warning(self, k):

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
rot90Function · 0.90
reshapeMethod · 0.80

Tested by

no test coverage detected