Skip to content

Downgrade exception to warning in case of entity id duplication. - #4623

Merged
JoaoRodrigues merged 5 commits into
biopython:masterfrom
JoaoRodrigues:issue_1551
Feb 26, 2024
Merged

JoaoRodrigues merged 5 commits into
biopython:masterfrom
JoaoRodrigues:issue_1551

Conversation

@JoaoRodrigues

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

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 #...

Comment thread Bio/PDB/Entity.py Outdated
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."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use from Bio import BiopythonWarning to make it slightly easier for people to silence this if they really want to do this?

@JoaoRodrigues
JoaoRodrigues force-pushed the issue_1551 branch 2 times, most recently from cb3a062 to 35d7236 Compare February 24, 2024 15:43

@peterjc peterjc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squash-and-merge?

@mdehoon

mdehoon commented Feb 26, 2024 •

Copy link
Copy Markdown
Contributor

@JoaoRodrigues Are you aware that by default, warnings can get triggered only once in a Python session?

@JoaoRodrigues

JoaoRodrigues commented Feb 26, 2024 via email •

Copy link
Copy Markdown
Member Author

@JoaoRodrigues
JoaoRodrigues merged commit dd216dd into biopython:master Feb 26, 2024
@JoaoRodrigues
JoaoRodrigues deleted the issue_1551 branch February 26, 2024 16:31
@ALGW71

ALGW71 commented Apr 10, 2024 •

Copy link
Copy Markdown

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 (' ', 10, ' ') to (' ', 11, ' '). The id (' ', 11, ' ') is already used for a sibling of this entity.

I will try building the GitHub version 1.84 and see if this works.

Thanks,
Alex

@ALGW71

ALGW71 commented Apr 10, 2024

Copy link
Copy Markdown

Can confirm this works with the dev version of 1.84.

Thanks for solving this!

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.

Cannot change IDs for Residue

4 participants