Skip to content
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

Empty u.atoms.bonds for PDB files without a CONECT record #2832

Closed
cbouy opened this issue Jul 9, 2020 · 0 comments · Fixed by #2855
Closed

Empty u.atoms.bonds for PDB files without a CONECT record #2832

cbouy opened this issue Jul 9, 2020 · 0 comments · Fixed by #2855

Comments

@cbouy
Copy link
Member

cbouy commented Jul 9, 2020

Expected behavior

For API consistency, when creating a Universe from a PDB file that doesn't have a CONECT record, accessing u.atoms.bonds should raise a NoDataError as it's the case for other file formats.

Actual behavior

u.atoms.bonds will return a TopologyGroup with 0 bonds.

Code to reproduce the behavior

>>> import MDAnalysis as mda
>>> from MDAnalysis.tests.datafiles import PDB_helix

>>> u = mda.Universe(PDB_helix)
>>> u.atoms.bonds
<TopologyGroup containing 0 bonds>

Current version of MDAnalysis

  • Which version are you using? (run python -c "import MDAnalysis as mda; print(mda.__version__)")
    2.0.0-dev0
  • Which version of Python (python -V)?
    Python 3.6.10
  • Which operating system?
    Ubuntu 18.04.4 LTS through a VM (WSL2)
@cbouy cbouy changed the title Empty u.atoms.bonds attribute for PDB files without a CONECT record Empty u.atoms.bonds for PDB files without a CONECT record Jul 9, 2020
@cbouy cbouy mentioned this issue Jul 9, 2020
7 tasks
@orbeckst orbeckst added this to the 2.0 milestone Jul 12, 2020
@orbeckst orbeckst mentioned this issue Jul 21, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants