duartegroup / autodE

automated reaction profile generation
https://duartegroup.github.io/autodE/
MIT License
171 stars 52 forks source link

Exception in cleaning up after calculation with xTB #223

Closed shoubhikraj closed 1 year ago

shoubhikraj commented 1 year ago

Example:

import autode
from autode import Calculation
test_mol = autode.Molecule(smiles='CO')
hess_calc = Calculation(
    name=f"test_hess",
    molecule=test_mol,
    method=autode.methods.XTB(),
    keywords=autode.methods.XTB().keywords.hess,
    n_cores=4
)
hess_calc.run()
hess_calc.clean_up(force=True, everything=True)

produces this output -

TypeError                                 Traceback (most recent call last)
Cell In[30], line 11
      3 hess_calc = Calculation(
      4     name=f"test_hess",
      5     molecule=test_mol,
   (...)
      8     n_cores=4
      9 )
     10 hess_calc.run()
---> 11 hess_calc.clean_up(force=True, everything=True)

File E:\autodE\autode\calculations\calculation.py:134, in Calculation.clean_up(self, force, everything)
    122 def clean_up(self, force: bool = False, everything: bool = False) -> None:
    123     """
    124     Clean up input and output files, if Config.keep_input_files is False
    125     (and not force=True)
   (...)
    132         everything (bool): Remove both input and output files
    133     """
--> 134     return self._executor.clean_up(force, everything)

File E:\autodE\autode\calculations\executors.py:205, in CalculationExecutor.clean_up(self, force, everything)
    202 for filename in set(filenames):
    204     try:
--> 205         os.remove(filename)
    206     except FileNotFoundError:
    207         logger.warning(f"Could not delete {filename} it did not exist")

TypeError: remove: path should be string, bytes or os.PathLike, not NoneType

However, this error does not happen if I use autode.methods.ORCA(). I haven't checked other methods, but it seems with xTB at least, one filename is None.

OS: Windows 10