Skip to content

Different number of atoms in different frames - better message #1998

@bieniekmateusz

Description

@bieniekmateusz

Expected behavior
A clear message that the .pdb universe cannot contain a different number of atoms from frame to frame.

Actual behavior

[superimposed_withH_C20sphere5.2_step10_sol_test.pdb.zip](https://github.com/MDAnalysis/mdanalysis/files/2213970/superimposed_withH_C20sphere5.2_step10_sol_test.pdb.zip)
ValueError: could not broadcast input array from shape (0) into shape (23,3)

Traceback (most recent call last):
are there frames?
  File "/home/dresio/mdscripts/messy/clustering_env/cluster_env.py", line 20, in <module>
    for ts in u.trajectory:
  File "/home/dresio/software/virtualenvs/charm-mda/lib/python2.7/site-packages/MDAnalysis/coordinates/base.py", line 1197, in next
    ts = self._read_next_timestep()
  File "/home/dresio/software/virtualenvs/charm-mda/lib/python2.7/site-packages/MDAnalysis/coordinates/PDB.py", line 351, in _read_next_timestep
    return self._read_frame(frame)
  File "/home/dresio/software/virtualenvs/charm-mda/lib/python2.7/site-packages/MDAnalysis/coordinates/PDB.py", line 387, in _read_frame
    self.ts.positions = tmp_buf
  File "/home/dresio/software/virtualenvs/charm-mda/lib/python2.7/site-packages/MDAnalysis/coordinates/base.py", line 601, in positions
    self._pos[:] = new
ValueError: could not broadcast input array from shape (0) into shape (23,3)
for ts in u.trajectory:
  print (ts.time)

superimposed_withH_C20sphere5.2_step10_sol_test.pdb.zip

MDAnalysis version: 0.18.0, Linux Arch, Python 2.7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions