You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
should produce a Universe with 2520 atoms. The cell parameters might differ between timeframes.
Actual behavior
Raises:
ValueError: invalid literal for int() with base 10: '0.0000000000'.
This behaviour happens because HistoryReader in coordinates/DLPoly.py skips the cell dimensions only if not imcom == 0. imcom is the second integer in the second line of the file, i.e. zero. Such incom value implies no periodic boundary conditions (see DLPOLY manual). For this reason, it is reasonable for the HistoryReader to assume there are no cell dimensions and that the next line under the timestep ... line already defines an atom. So it assumes that the 63.9987726600 0.0000000000 0.0000000000 line is atom definition and tries to read 0.0000000000 as atom index (integer).
Such assumption makes sense, as non-periodic simulations do not need a cell. However, if (for whatever reason) the simulation used an ensemble with constant volume or pressure, a cell is nonetheless generated and appended for each timestep. Instead of using imcom == 0 as a flag for cell parameters being printed, the parser should actively check whether cell parameters are present or not.
Expected behavior
If the DL_POLY HISTORY file starts like:
running:
u = mda.Universe('HISTORY', format='HISTORY')
should produce a Universe with 2520 atoms. The cell parameters might differ between timeframes.
Actual behavior
Raises:
ValueError: invalid literal for int() with base 10: '0.0000000000'
.This behaviour happens because
HistoryReader
incoordinates/DLPoly.py
skips the cell dimensions onlyif not imcom == 0
.imcom
is the second integer in the second line of the file, i.e. zero. Such incom value implies no periodic boundary conditions (see DLPOLY manual). For this reason, it is reasonable for the HistoryReader to assume there are no cell dimensions and that the next line under thetimestep ...
line already defines an atom. So it assumes that the63.9987726600 0.0000000000 0.0000000000
line is atom definition and tries to read0.0000000000
as atom index (integer).Such assumption makes sense, as non-periodic simulations do not need a cell. However, if (for whatever reason) the simulation used an ensemble with constant volume or pressure, a cell is nonetheless generated and appended for each timestep. Instead of using
imcom == 0
as a flag for cell parameters being printed, the parser should actively check whether cell parameters are present or not.Code to reproduce the behavior
Can be reproduced with a HISTORY file containing:
Current version of MDAnalysis
MDAnalysis 1.0.0, Python 3.7, Win 10 64-bit.
The text was updated successfully, but these errors were encountered: