Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX deprecated func+unravelling bugs #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions benchmarks/other/sporco/admm/admm.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def __init__(self, Nx, yshape, ushape, dtype, opt=None):
self.Nx = Nx
# Working variable U has the same dimensionality as constant c
# in the constraint Ax + By = c
self.Nc = np.product(np.array(ushape))
self.Nc = np.prod(np.array(ushape))

# DataType option overrides data type inferred from __init__
# parameters of derived class
Expand Down Expand Up @@ -861,7 +861,7 @@ def __init__(self, xshape, dtype, opt=None):

if opt is None:
opt = ADMMEqual.Options()
Nx = np.product(np.array(xshape))
Nx = np.prod(np.array(xshape))
super(ADMMEqual, self).__init__(Nx, xshape, xshape, dtype, opt)


Expand Down
2 changes: 1 addition & 1 deletion benchmarks/other/sporco/admm/parcbpdn.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def mpraw_as_np(shape, dtype):
Numpy array
"""

sz = int(np.product(shape))
sz = int(np.prod(shape))
csz = sz * np.dtype(dtype).itemsize
raw = mp.RawArray('c', csz)
return np.frombuffer(raw, dtype=dtype, count=sz).reshape(shape)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/other/sporco/dictlrn/prlcnscdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def mpraw_as_np(shape, dtype):
Numpy array
"""

sz = int(np.product(shape))
sz = int(np.prod(shape))
csz = sz * np.dtype(dtype).itemsize
raw = mp.RawArray('c', csz)
return np.frombuffer(raw, dtype=dtype, count=sz).reshape(shape)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/other/sporco/prox.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def ndto2d(x, axis=-1):
# Reshape into a 2D array with the axes specified by the axis
# parameter flattened into an index along rows, and the remaining
# axes flattened into an index aalong the columns
xtr = xt.reshape((np.product(xts[0:len(caxis)]), -1))
xtr = xt.reshape((np.prod(xts[0:len(caxis)]), -1))
# Return reshaped array and a tuple containing the information
# necessary to undo the entire operation
return xtr, (xts, prm)
Expand Down
2 changes: 1 addition & 1 deletion dicodile/utils/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def init_dictionary(X, n_atoms, atom_support, random_state=None):
X_std = X.std()
n_channels, *sig_support = X.shape
valid_support = get_valid_support(sig_support, atom_support)
n_patches = np.product(valid_support)
n_patches = np.prod(valid_support)

indices = iter(rng.choice(n_patches, size=10 * n_atoms, replace=False))
D = np.empty(shape=(n_atoms, n_channels, *atom_support))
Expand Down
Loading