Repository navigation
Python 3 compatible sorting of atoms in PDB Residues - #1291
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1291 +/- ##
==========================================
+ Coverage 84.41% 84.47% +0.06%
==========================================
Files 319 319
Lines 48850 48820 -30
==========================================
+ Hits 41238 41242 +4
+ Misses 7612 7578 -34
Continue to review full report at Codecov.
|
|
@etal @JoaoRodrigues what do you think about this PDB sort change? |
|
These changes all look good and safe to me. It would be reasonable for Chain, Model, and Structure be able to sort their child entities by ID. I don't recall needed to do that back when I was working with protein structures, though, since the files from PDB normally have that done already. |
|
I agree - but the PDB model details are not fresh enough in my mind to quickly implement sorting at the other levels. |
|
I've rebased this to deal with the merge conflict... waiting for tests... |
The Residue object has a public sort method which has been updated to use Python 3 compatible sorting by key. The other objects never exposed sorting as a public method.
This is useful as flake8 etc will take into account differences in the language itself and report a slightly different set of issues on Python 2 vs 3.
|
Rebased again, with the missing colon in the TravisCI file fixed. |
This should close #1189, Bio.PDB sorting not tested and Python 2 only.
Note this removes the (apparently unused) private
._sort()methods of all the objects, and updates the only public.sort()method which is on theResidueobject - for which I have added a test.We could define (Python 3 compatible) public
.sort()methods for theChain,ModelandStructurebased on the existing Python 2 only private sort methods - but are they useful?