icamps / MoPy

Some script to work with MOPAC output files
GNU General Public License v3.0
0 stars 0 forks source link

ValueError: could not convert string to float: #1

Open miroi opened 7 months ago

miroi commented 7 months ago

Hello,

in https://github.com/miroi/open-collection/tree/master/theoretical_chemistry/software/mopac/runs/methylchloride I am getting error with your script"

milias@lxir127.gsi.de:/data.local1/milias/projects/open-collection/theoretical_chemistry/software/mopac/runs/methylchloride/.python3 -m log2xyz.py  ch3cl_opt
0.400161D+03

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/data.local1/milias/projects/open-collection/theoretical_chemistry/software/mopac/runs/methylchloride/log2xyz.py", line 55, in <module>
    energy_kcal_mol = float(energy_kcal_mol.replace("D", "E"))
ValueError: could not convert string to float:
icamps commented 7 months ago

Hi @miroi , the error here is about counting the atom number from the MOPAC input file (.mop). In your case, you need to remove all the extra lines in your MOP file. (I am working on to remove this lines automatically)

icamps commented 7 months ago

@miroi I already changed the script (log2xyz.py) in order to remove the trailing newlines at the end of the MOP file.