Skip to content

4203 numpy types - #4204

Merged
peterjc merged 4 commits into
biopython:masterfrom
acvander:4203-numpy-types
Dec 22, 2022
Merged

peterjc merged 4 commits into
biopython:masterfrom
acvander:4203-numpy-types

Conversation

@acvander

Copy link
Copy Markdown
  • replaced np.int with np.int64
  • replaced np.bool with bool
  • I hereby agree to dual licence this and any previous contributions under both
    the Biopython License Agreement AND the BSD 3-Clause License.

  • I have read the CONTRIBUTING.rst file, have run pre-commit
    locally, and understand that continuous integration checks will be used to
    confirm the Biopython unit tests and style checks pass with these changes.

  • I have added my name to the alphabetical contributors listings in the files
    NEWS.rst and CONTRIB.rst as part of this pull request, am listed
    already, or do not wish to be listed. (This acknowledgement is optional.)

Closes #4203.

This PR fixes issues related to some NumPy type deprecations that affects platforms or users of NumPy v1.24

- replaced `np.int` with `np.int64`
- replaced `np.bool` with `bool`
@acvander
acvander marked this pull request as ready for review December 20, 2022 19:54
rob-miller added a commit to rob-miller/biopython that referenced this pull request Dec 20, 2022
@acvander
acvander requested a review from mdehoon as a code owner December 20, 2022 23:51
Comment thread Tests/test_Cluster.py Outdated
[2.7, 2.5, 0.4, 5.7, 0.2],
],
numpy.float,
numpy.float64,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As numpy.float was a synonym for float, I would prefer to replace it with just float here. Then effectively the test does not change. Also, it makes the test a bit more robust, as float can be different things on different platforms, but numpy.float64 is always the same.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this issue is blocking the CI pipeline, I have made your suggested change.

I think that having tests implicitly change based on platform architecture may cause issues in the long term. An alternative may be to utilize test parametrization to run the test for both np.float32 and np.float64.

@peterjc

peterjc commented Dec 22, 2022 •

Copy link
Copy Markdown
Member

Not sure what's happening with CirceCI, seems unrelated to this PR through.

@peterjc
peterjc merged commit 8d9d20d into biopython:master Dec 22, 2022
@peterjc

peterjc commented Dec 22, 2022

Copy link
Copy Markdown
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Numpy types deprecation causing CI runs to fail

3 participants