Skip to content

Fix vector test for NumPy 2.4 - #5161

Merged
peterjc merged 1 commit into
biopython:masterfrom
peterjc:numpy_2_4_vector_test
Mar 9, 2026
Merged

peterjc merged 1 commit into
biopython:masterfrom
peterjc:numpy_2_4_vector_test

Conversation

@peterjc

@peterjc peterjc commented Feb 12, 2026

Copy link
Copy Markdown
Member
  • 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 #5135 (and pull request #5138) using the minimal change on #5160.

(Happy to merge both with approval)

@codecov

codecov Bot commented Feb 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.39%. Comparing base (f4d8ae4) to head (bfd3be3).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5161      +/-   ##
==========================================
+ Coverage   85.51%   86.39%   +0.87%     
==========================================
  Files         282      282              
  Lines       59480    59480              
==========================================
+ Hits        50867    51385     +518     
+ Misses       8613     8095     -518     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@peterjc
peterjc requested a review from mdehoon February 12, 2026 20:41
@mdehoon

mdehoon commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

I am not familiar with this code. Just wanted to point out that np.array([[2.0], [0.0], [2.0], [1.0]]) and np.array([2.0, 0.0, 2.0, 1.0]) are not exactly the same. The first is a 4x1 two-dimensional array, the latter is a one-dimensional array with 4 elements.:

>>> np.array([[2.0], [0.0], [2.0], [1.0]])
array([[2.],
       [0.],
       [2.],
       [1.]])
>>> np.array([2.0, 0.0, 2.0, 1.0])
array([2., 0., 2., 1.])
>>> 

If that is intended, it is fine with me.

@peterjc

peterjc commented Feb 13, 2026

Copy link
Copy Markdown
Member Author

Exactly - but why would you want to do that here, and should it be supported?

i.e. Was the test doing something weird (in which case this fixes the test), or something reasonable that should still work with NumPy 2.4 (in which case we do need a code change, perhaps more like #5138).

@peterjc

peterjc commented Mar 9, 2026

Copy link
Copy Markdown
Member Author

Applying the change to the test now so that we can get the default branch building and passing cleanly, and do the release.

There may still be an underlyning issue that we will have to return too...

@peterjc
peterjc deleted the numpy_2_4_vector_test branch March 9, 2026 09:23
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.

Incompatible with NumPy 2.4

2 participants