Skip to content

silence warnings PDBConstructionWarning in test_PDB_StructureAlignment.py #1877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
peterjc opened this issue Dec 18, 2018 · 4 comments
Open
Labels
good first issue This should be an easy fix, suitable for beginners Testing

Comments

@peterjc
Copy link
Member

peterjc commented Dec 18, 2018

Setup

Seen with latest code from git while preparing the 1.73 release on Linux, but applies to all platforms.

Expected behaviour

$ python run_tests.py test_PDB_StructureAlignment.py
Python version: 2.7.15 | packaged by conda-forge | (default, Jul 27 2018, 10:26:36) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)]
Operating system: posix linux2
test_PDB_StructureAlignment ... ok
----------------------------------------------------------------------
Ran 1 test in 0.958 seconds

Actual behaviour

$ python run_tests.py test_PDB_StructureAlignment.py
Python version: 2.7.15 | packaged by conda-forge | (default, Jul 27 2018, 10:26:36) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)]
Operating system: posix linux2
test_PDB_StructureAlignment ... /tmp/biopython-1.73/build/lib.linux-x86_64-2.7/Bio/PDB/StructureBuilder.py:91: PDBConstructionWarning: WARNING: Chain A is discontinuous at line 13298.
  PDBConstructionWarning)
/tmp/biopython-1.73/build/lib.linux-x86_64-2.7/Bio/PDB/StructureBuilder.py:91: PDBConstructionWarning: WARNING: Chain B is discontinuous at line 13344.
  PDBConstructionWarning)
ok
----------------------------------------------------------------------
Ran 1 test in 0.958 seconds

Steps to reproduce

Use python run_tests.py --offline test_PDB_StructureAlignment.py or similar.

We need to catch and ignore the PDBConstructionWarning here, see for example:

https://github.com/biopython/biopython/blob/biopython-172/Tests/test_PDB.py#L107

i.e. Wrap as few lines as possible in the context manager

@peterjc peterjc added Testing good first issue This should be an easy fix, suitable for beginners labels Dec 18, 2018
@konqr
Copy link

konqr commented Dec 20, 2018

Hey. Beginner here. I am on it. :)

@konqr
Copy link

konqr commented Dec 20, 2018

@peterjc Done. PR added.

@konqr
Copy link

konqr commented Dec 21, 2018

Hey Peter. Thanks for the email. Sorry for the wrong PR. I understood what you want to be done. I'm on it, thanks.

@konqr
Copy link

konqr commented Dec 21, 2018

Please check #1881 for PR. Hope this runs well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue This should be an easy fix, suitable for beginners Testing
Projects
None yet
Development

No branches or pull requests

2 participants