Repository navigation
Downgrade exception to warning in case of entity id duplication. - #4623
Conversation
| warnings.warn( | ||
| f"The id `{value}` is already used for a sibling of this entity. " | ||
| f"Changing id from `{self._id}` to `{value}` might create access " | ||
| "inconsistencies to children of the parent entity." |
There was a problem hiding this comment.
Use from Bio import BiopythonWarning to make it slightly easier for people to silence this if they really want to do this?
cb3a062 to
35d7236
Compare
361b07d to
35c28ad
Compare
|
@JoaoRodrigues Are you aware that by default, warnings can get triggered only once in a Python session? |
|
Hi Michiel,
Yes - I preferred using a warning vs a print statement for that reason,
otherwise e.g. you'd have the warning printed for every aminoacid in a
protein when you're renumbering them and that's annoying.
|
|
Hi Guys, Was this actually downgraded to a warning, but has not yet made the production versions? I see the merge above, but I am using version 1.83 and still get the following error: 1igt.pdb could not be parsed: Cannot change id from I will try building the GitHub version 1.84 and see if this works. Thanks, |
|
Can confirm this works with the dev version of 1.84. Thanks for solving this! |
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 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.rstandCONTRIB.rstas part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)
This potentially closes #1551. It might open a pandora box of errors if people abuse this or use this without knowing what's going on under the hood.
Closes #...