From 7573b488942efc1c1fc33c00f67ffa1eb5cb22b7 Mon Sep 17 00:00:00 2001 From: Eric Giguere Date: Mon, 19 Aug 2024 11:20:45 -0400 Subject: [PATCH] Use positional only for changing parameter name --- qutip/tests/core/data/test_expect.py | 2 +- qutip/tests/core/data/test_reshape.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qutip/tests/core/data/test_expect.py b/qutip/tests/core/data/test_expect.py index 779d3ba13e..47b8c79ce0 100644 --- a/qutip/tests/core/data/test_expect.py +++ b/qutip/tests/core/data/test_expect.py @@ -49,7 +49,7 @@ class TestExpectSuper(BinaryOpMixin): def op_numpy(self, op, state): n = np.sqrt(state.shape[0]).astype(int) out_shape = (n, n) - return np.trace(np.reshape(op@state, shape=out_shape)) + return np.trace(np.reshape(op@state, out_shape)) _dim = 100 _super_ket = pytest.param((_dim, 1), id="super_ket") diff --git a/qutip/tests/core/data/test_reshape.py b/qutip/tests/core/data/test_reshape.py index bf864fee23..f9e2947baa 100644 --- a/qutip/tests/core/data/test_reshape.py +++ b/qutip/tests/core/data/test_reshape.py @@ -20,7 +20,7 @@ def op_numpy(self, matrix): class TestColumnStack(UnaryOpMixin): def op_numpy(self, matrix): out_shape = (matrix.shape[0]*matrix.shape[1], 1) - return np.reshape(matrix, shape=out_shape, order='F') + return np.reshape(matrix, out_shape, order='F') specialisations = [ pytest.param(data.column_stack_csr, CSR, CSR), @@ -32,7 +32,7 @@ def op_numpy(self, matrix): class TestColumnUnstack(UnaryOpMixin): def op_numpy(self, matrix, rows): out_shape = (rows, matrix.shape[0]*matrix.shape[1]//rows) - return np.reshape(matrix, shape=out_shape, order='F') + return np.reshape(matrix, out_shape, order='F') shapes = [ (pytest.param((10, 1), id="ket"), ), @@ -83,7 +83,7 @@ def generate_incorrect_rows_raises(self, metafunc): class TestReshape(UnaryOpMixin): def op_numpy(self, matrix, rows, columns): out_shape = (rows, columns) - return np.reshape(matrix, shape=out_shape, order='C') + return np.reshape(matrix, out_shape, order='C') # All matrices should have the same number of elements in total, so we can # use the same (rows, columns) parametrisation for each input.