BUG: The `get_calculator_command` method of `EspressoProfile` class in `ase.calculators.espresso.EspressoProfile` returns wrong list
Checklist
-
The issue remains in the development version of ASE. -
A minimal example is provided to reproduce the issue.
Summary
Dear developers,
Thanks a lot for your efforts in refactoring the Espresso
calculator.
I found a bug which breaks the calculation using the Espresso
calculator.
Here is my input file for QE,
espresso_profile = EspressoProfile(
binary=["mpirun", "-np", "16", "pw.x"],
pseudo_path=f"{os.environ["HOME"]}/",
)
The binary
is required to be a list of strings.
Currently, the get_calculator_command
method of EspressoProfile
class is
def get_calculator_command(self, inputfile):
return [self.binary, '-in', inputfile]
The returned list would be [['mpirun', '-np', '16', 'pw.x'], '-in', 'espresso.pwi']
which is not the correct form as an input for check_call()
function in BaseProfile
class.
This bug can be easily fixed as follows,
def get_calculator_command(self, inputfile):
return self.binary + ['-in', inputfile]
The returned list would be ['mpirun', '-np', '16', 'pw.x', '-in', 'espresso.pwi']
, and it works for the check_call()
function.
I will pull a request to fix this bug.