Skip to content

Commit

Permalink
Replace np.product with np.prod due to deprecation (#385)
Browse files Browse the repository at this point in the history
## Description

<!-- Provide a brief description of the PR's purpose here. -->

`np.product` is deprecated in numpy 1.25.0 -- see
numpy/numpy#23314

This PR replaces our calls to `np.product` with `np.prod`.

## TODO

<!-- Notable points that this PR has either accomplished or will
accomplish. -->

## Questions

<!-- Any concerns or points of confusion? -->

## Status

- [x] I have read the guidelines in

[CONTRIBUTING.md](https://github.com/icaros-usc/pyribs/blob/master/CONTRIBUTING.md)
- [x] I have formatted my code using `yapf`
- [x] I have tested my code by running `pytest`
- [x] I have linted my code with `pylint`
- [x] I have added a one-line description of my change to the changelog
in
      `HISTORY.md`
- [x] This PR is ready to go
  • Loading branch information
btjanaka committed Sep 22, 2023
1 parent a84bd92 commit 473f24b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@

- Test pyribs installation in tutorials ({pr}`384`)

## 0.6.3

### Changelog

#### Improvements

- Replace np.product with np.prod due to deprecation ({pr}`385`)

## 0.6.2

Small patch release due to installation issues in our tutorials.
Expand Down
2 changes: 1 addition & 1 deletion ribs/archives/_grid_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self,
ArchiveBase.__init__(
self,
solution_dim=solution_dim,
cells=np.product(self._dims),
cells=np.prod(self._dims),
measure_dim=len(self._dims),
learning_rate=learning_rate,
threshold_min=threshold_min,
Expand Down
2 changes: 1 addition & 1 deletion ribs/archives/_sliding_boundaries_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def __init__(self,
ArchiveBase.__init__(
self,
solution_dim=solution_dim,
cells=np.product(self._dims),
cells=np.prod(self._dims),
measure_dim=len(self._dims),
qd_score_offset=qd_score_offset,
seed=seed,
Expand Down

0 comments on commit 473f24b

Please sign in to comment.