Neb_final.py not reading dump files

Hello! I am trying to use the neb_final.py script to analyze the dump files from a neb calculation. I installed the python tools on my local computer without the entire lammps build. I’ve followed the instructions for setup, however when I run the following command:

/Users/willdesnoo/lammps_py_tools/neb_final.py -o neb.final -r neb_dump.*

Where neb_dump.0, neb_dump.1 … neb_dump.7 are the dump files for each replica. I get the following output:

read 0 snapshots
0 snapshots selected out of 0
assigned columns: id type element x y z
Traceback (most recent call last):
File “/Users/willdesnoo/lammps_py_tools/neb_final.py”, line 67, in
neb.tselect.one(t[-1])
IndexError: list index out of range

I’ve made sure to export the LAMMPS_PYTHON_TOOLS as instructed. I’ve also added a print statement to neb_final.py that confirms it is reading the dump files as a list. I’m running this on python2.7 (I assume this is the version to use based on syntax, but I could be wrong). I’m running the version LAMMPS (3 Mar 2020).

Is there something wrong with how I installed the python tools? Any and all suggestions would be appreciated!

More likely is that your dump files do not conform to the format expected.

The python code in question has not been changed since a long time ago.
It works with the bundled NEB examples and Python 2.7.
Porting to Python 3.x is ongoing and almost complete.

I have a similar problem. I’ve made sure that the file format is the same as the example, but this error message appears:
Traceback (most recent call last):
File “/home/jsrecio/Programas/lammps-29Sep2021/tools/python/neb_final.py”, line 61, in
neb = dump(file)
File “/home/jsrecio/Programas/lammps-29Sep2021/tools/python/pizza/dump.py”, line 233, in init
self.read_all()
File “/home/jsrecio/Programas/lammps-29Sep2021/tools/python/pizza/dump.py”, line 263, in read_all
self.snaps.sort(self.compare_time)
TypeError: sort() takes no positional arguments

This is definitely a “lack of python 3 support” type of error.
Right now you either must use python 2.7 or wait until the python 3 porting of the pizza python files is complete and released.

2 Likes

The answer can be found here:

Thank you very much. Anyway, in case anyone is interested, using the write_dump command at the end of your code + run 0, you can dump only the last time step of each replica. Then, in Ovito, it’s possible to render all the images together and create a gif.

1 Like