-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hi,
It seems like ase has updated their EspressoProfile. The current implementation in asimtools doesn't work anymore.
The current implementation:
def load_espresso_profile(calc_params):
"""Load Qunatum Espresso Calculator for ASE>3.22.1. If using older versions
such as the ones available on PyPI or conda-forge, just load it as an ASE
calculator. Until the new ASE version becomes an official release, we will
have to have both for compatibility. The interface however remains that of
ASE <=3.22.1 within ASIMTools for consistency using the `command` keyword
https://wiki.fysik.dtu.dk/ase/releasenotes.html
:param calc_params: args to pass to loader
:type calc_params: Dict
:return: Espresso calculator
:rtype: :class:`ase.calculators.espresso.Espresso`
"""
from ase.calculators.espresso import Espresso, EspressoProfile
if 'command' in calc_params['args']:
command = calc_params['args'].pop('command')
command = command.split()
progind = command.index('pw.x')
argv = command[:progind+1]
else:
argv = ['pw.x']
try:
calc = Espresso(
**calc_params['args'],
profile=EspressoProfile(argv=argv)
)
except Exception:
logging.error("Failed to load MACE-OFF with parameters:\n %s", calc_params)
raise
return calcThe source of the bug is here:
calc = Espresso(
**calc_params['args'],
profile=EspressoProfile(argv=argv)
)
My attempt of fixing it:
if 'command' in calc_params['args']:
command = calc_params['args'].pop('command')
command = command.split()
progind = command.index('pw.x')
argv = command[:progind]
it = iter(argv)
argv = dict(zip(it, it))
else:
argv = ['pw.x']
try:
binary = calc_params['args'].pop("binary")
pseudo_dir = calc_params['args'].pop("pseudo_dir")
calc = Espresso(
**calc_params['args'],
profile=EspressoProfile(parallel_info=argv,binary=binary, pseudo_dir=pseudo_dir)
)Summary:
parallel_infoneeds to be a dict type.argvis a dict now. (e.g. {'srun':'--mpi=pmix'}.binaryis 'pw.x'pseudo_diris a path
Metadata
Metadata
Assignees
Labels
No labels