peteboyd / lammps_interface

automatic generation of LAMMPS input files for molecular dynamics simulations of MOFs
MIT License
125 stars 63 forks source link

Errors during execution of lammps-interface in windows version . #33

Closed zoolflix closed 4 years ago

zoolflix commented 4 years ago

After a normal installation and after the last fix of the windows version I get this error

C:\Users\kosta\AppData\Local\Programs\Python\Python37\Lib\site-packages\lammps_interface>lammps-interface Cu.cif fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git [...] -- [...]' Traceback (most recent call last): File "c:\users\kosta\appdata\local\programs\python\python37\lib\site-packages\lammps_interface\CIFIO.py", line 59, in read key, val = line.strip().split() ValueError: not enough values to unpack (expected 2, got 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\kosta\AppData\Local\Programs\Python\Python37\Scripts\lammps-interface-script.py", line 11, in load_entry_point('lammps-interface==0.1.2', 'console_scripts', 'lammps-interface')() File "c:\users\kosta\appdata\local\programs\python\python37\lib\site-packages\lammps_interface\cli.py", line 12, in main cell, graph = from_CIF(options.cif_file) File "c:\users\kosta\appdata\local\programs\python\python37\lib\site-packages\lammps_interface\structure_data.py", line 1544, in from_CIF cifobj.read(cifname) File "c:\users\kosta\appdata\local\programs\python\python37\lib\site-packages\lammps_interface\CIFIO.py", line 61, in read key, val = line.strip().split()[:2] ValueError: not enough values to unpack (expected 2, got 1)

ltalirz commented 4 years ago

fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.

This error seems related to the fact that you've installed the package via pip directly from the git repository. While I've not encountered it personally before, I assume this will go away once we've done a proper release.

I'm not quite sure whether the other issue

key, val = line.strip().split() ValueError: not enough values to unpack (expected 2, got 1)

exists independently - perhaps it does. It clearly seems to assume that a line in the CIF has two values separated by spaces, while the actual file has just one. In this case, this might be solved by moving to ASE for the CIF parser, see https://github.com/peteboyd/lammps_interface/issues/5 - pull requests welcome!

zoolflix commented 4 years ago

All of the above errors where fixed when ASE was used as a cif parser to convert the original cif file to a cif file with the proper form. Lammps-Interface managed to produce a functional input for LAMMPS and the calculations run smoothly for a new MOF I have synthesised. I am very grateful to you for that (and since it worked out you will be cited in our work when it will be published).

Even thought my MOF was a (porous) 2D layered one and not a 3D, Lammps-Interface produced the correct input file! Which is not always the case (!) since I try to do the same with other Layered 2D materials of our Research Group and it doesn't produce a functional input for LAMMPS (calculations don't run properly for most of my other 2D or 1D or molecular crystals).

In any case this specific issue #33 was solved and can be considered closed . ASE solved tha problems of the cif file and lammps-interface did it's job finely. Again thank you.

ltalirz commented 4 years ago

new release 0.1.3 is available on pypi