Repository navigation
Changed atom has valid element check from PDBIO - #3262
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3262 +/- ##
=======================================
Coverage 83.92% 83.92%
=======================================
Files 317 317
Lines 51529 51529
=======================================
Hits 43245 43245
Misses 8284 8284
Continue to review full report at Codecov.
|
|
Trying to find the exact change in the history, this added a sanity test similar to your proposal: Update: The issue referenced was http://bugzilla.open-bio.org/show_bug.cgi?id=2495 (on the defunct BugZilla instance; see comment below) |
|
Found it, 730a215 - from you @JoaoRodrigues |
|
Here's the text of the original BugZilla issue http://bugzilla.open-bio.org/show_bug.cgi?id=2495 (filed by Hongbo Zhu in April 2008) as recorded in my emails, with triple back-ticks added for legibility on GitHub:
|
|
Ah! I felt this was somewhat familiar but my git-fu is decidely worse than yours :) Thanks for checking! I think we can revert back to what we had before. 10 years and a PhD later, your initial proposal makes more sense! |
|
Checking for a known element seems reasonable to me, so I'd also be happy with allowing a known element or |
|
That was my first idea, but I thought it might look clunky. I'll go with that then, to keep the current behavior and just work around the 'X' elements. Don't want to leave the 'bug' open for much longer. |
|
Also added tests to cover this, as it wasn't covered before. |
peterjc
left a comment
There was a problem hiding this comment.
Looks good - I'd suggest a squash-and-merge to keep the history simple here.
|
Merged! Thanks for the patience :) |
Realized PR #3250 introduces a bug in PDBIO when writing structures with unknown elements because "X" is not a valid element (in Bio.Data.IUPACData.atom_weights).
I thought of simply checking if element is "X", but I'd argue that the writer module should enforce the format and not necessarily the content. If users want to overload that particular column with whatever value, they should be able to as long as they comply with the format (2 characters max length).
@peterjc, you introduced the element check back in 2009 (at least according to git log!). Do you remember if there was a particular reason in mind back then? I could find a request in the old mailing list/bug tracker to parse elements, but that's it.
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.rstfile, have runpre-commitlocally,and understand that AppVeyor and TravisCI 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.rstandCONTRIB.rstas part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)