SCM-NV / PLAMS

Python Library for Automating Molecular Simulations
https://www.scm.com/doc/plams
Other
65 stars 24 forks source link

PLAMS unconditionally imports from `scm.utils` #118

Closed BvB93 closed 2 years ago

BvB93 commented 2 years ago

As of https://github.com/SCM-NV/PLAMS/commit/a3570c2bc7e3b103617fdde008e3e05812f9fe08 PLAMS uncondontially imports from the scm.utils module, which is neither part of PLAMS itself nor one of it's (properly specified) dependenies. The result is that direct PLAMS installations from the master branch are currently broken.

Examples

In [1]: from scm.plams import Molecule
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 from scm.plams import Molecule

File ~/opt/anaconda3/envs/test/lib/python3.10/site-packages/scm/plams/__init__.py:21, in <module>
     17                         globals()[name] = vars(tmp)[name]
     18     return ret
---> 21 __all__ = __autoimport(__path__[0], ['core', 'mol', 'interfaces', 'tools', 'recipes','trajectories'])
     23 __version__ = '1.5.1'

File ~/opt/anaconda3/envs/test/lib/python3.10/site-packages/scm/plams/__init__.py:13, in __autoimport(path, folders)
     11 for module in modules:
     12     imp = '.'.join(relpath + [module])
---> 13     tmp = __import__(imp, globals=globals(), fromlist=['*'], level=1)
     14     if hasattr(tmp, '__all__'):
     15         ret += tmp.__all__

File ~/opt/anaconda3/envs/test/lib/python3.10/site-packages/scm/plams/interfaces/adfsuite/propertyprediction.py:8, in <module>
      5 except ImportError:
      6     has_rdkit = False
----> 8 from scm.utils.runsubprocess import RunSubprocess
      9 from ...mol.molecule import Molecule
     10 from ...tools.kftools import KFFile

ModuleNotFoundError: No module named 'scm.utils'
BvB93 commented 2 years ago

Fixed as of https://github.com/SCM-NV/PLAMS/commit/d4ebb10e67b3d663e2fdb55fa3de2c5220a86dbf