Skip to content

make sure that polar_angle is initialized even if the radius is zero,…#5127

Open
mdehoon wants to merge 2 commits intobiopython:masterfrom
mdehoon:pdb_vector_undefined
Open

make sure that polar_angle is initialized even if the radius is zero,…#5127
mdehoon wants to merge 2 commits intobiopython:masterfrom
mdehoon:pdb_vector_undefined

Conversation

@mdehoon
Copy link
Contributor

@mdehoon mdehoon commented Dec 26, 2025

… otherwise we will get a random value in polar_angle.
This is flagged with a warning in recent versions of numpy

  • 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.)

… otherwise we will get a random value in polar_angle
@codecov
Copy link

codecov bot commented Dec 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.41%. Comparing base (22aa877) to head (3c442d2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5127      +/-   ##
==========================================
+ Coverage   85.51%   86.41%   +0.89%     
==========================================
  Files         282      282              
  Lines       59493    59493              
==========================================
+ Hits        50878    51412     +534     
+ Misses       8615     8081     -534     

☔ 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
Copy link
Member

peterjc commented Dec 27, 2025

The linter says:

Bio/PDB/vectors.py: note: In function "coord_space":
Bio/PDB/vectors.py:572:26: error: Value of type "float" is not indexable 
[index]
        set_Y_homog_rot_mtx(-sc[2][0], mry)
                             ^~~~~~~~
Bio/PDB/vectors.py:619:25: error: Value of type "float" is not indexable 
[index]
        set_Y_homog_rot_mtx(sc[2][0], mry)
                            ^~~~~~~~
Found 2 errors in 1 file (checked 298 source files)

This might be in error, but can you avoid double indexing these arrays with sc[2, 0] here?

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.

2 participants