Skip to content

Commit

Permalink
switch from np.product() to np.prod() as the former is deprecated (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
eacharles authored May 28, 2024
1 parent f0bf3ce commit a4c4c71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/qp/pdf_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def __init__(self, dist, *args, **kwds):
self._shape = 1
else:
self._shape = ss[1:-1]
self._npdf = np.product(self._shape).astype(int)
self._npdf = np.prod(self._shape).astype(int)
self._ndim = np.size(self._shape)

@property
Expand Down Expand Up @@ -227,7 +227,7 @@ class rv_frozen_rows(rv_continuous_frozen):
def __init__(self, dist, shape, *args, **kwds):
"""C'tor"""
self._shape = shape
self._npdf = np.product(shape).astype(int)
self._npdf = np.prod(shape).astype(int)
self._ndim = np.size(shape)
if self._npdf is not None:
kwds.setdefault(
Expand Down Expand Up @@ -281,7 +281,7 @@ class Pdf_rows_gen(rv_continuous, Pdf_gen):
def __init__(self, *args, **kwargs):
"""C'tor"""
self._shape = kwargs.pop("shape", (1))
self._npdf = np.product(self._shape).astype(int)
self._npdf = np.prod(self._shape).astype(int)
super().__init__(*args, **kwargs)

@property
Expand Down
2 changes: 1 addition & 1 deletion src/qp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ def reshape_to_pdf_size(vals, split_dim):
The reshaped array
"""
in_shape = np.shape(vals)
npdf = np.product(in_shape[:split_dim]).astype(int)
npdf = np.prod(in_shape[:split_dim]).astype(int)
per_pdf = in_shape[split_dim:]
out_shape = np.hstack([npdf, per_pdf])
return vals.reshape(out_shape)
Expand Down

0 comments on commit a4c4c71

Please sign in to comment.