Skip to content

Commit

Permalink
Use positional only for changing parameter name
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericgig committed Aug 19, 2024
1 parent 4c63baa commit 7573b48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion qutip/tests/core/data/test_expect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions qutip/tests/core/data/test_reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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"), ),
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 7573b48

Please sign in to comment.