diff --git a/src/raspa_ase/calculator.py b/src/raspa_ase/calculator.py index f1ca04a..1cffc30 100644 --- a/src/raspa_ase/calculator.py +++ b/src/raspa_ase/calculator.py @@ -32,27 +32,26 @@ class RaspaProfile(BaseProfile): RASPA profile, which defines the command that will be executed and where. """ - def __init__(self, binary: Path | str | None = None, **kwargs) -> None: + def __init__(self, command: Path | str | None = None, **kwargs) -> None: """ Initialize the RASPA profile. $RASPA_DIR must be set in the environment. Parameters ---------- - binary - The binary to run RASPA. This defaults to doing `${RASPA_DIR}/bin/simulate` + command + The command to run RASPA. This defaults to doing `${RASPA_DIR}/bin/simulate` and typically does not need to be changed. Returns ------- None """ - super().__init__(**kwargs) - if not binary: + if not command: raspa_dir = os.environ.get("RASPA_DIR") if not raspa_dir: raise OSError("RASPA_DIR environment variable not set") - binary = f"{raspa_dir}/bin/simulate" - self.binary = binary + command = f"{raspa_dir}/bin/simulate" + super().__init__(command, **kwargs) def get_calculator_command(self, inputfile: str = SIMULATION_INPUT) -> list[str]: """ @@ -68,7 +67,7 @@ def get_calculator_command(self, inputfile: str = SIMULATION_INPUT) -> list[str] list[str] The command to run the calculator. """ - return [self.binary, f"{inputfile}"] + return [self.command, f"{inputfile}"] def version(self) -> str: """ diff --git a/tests/test_calculator.py b/tests/test_calculator.py index 6b2703b..17a5db5 100644 --- a/tests/test_calculator.py +++ b/tests/test_calculator.py @@ -19,7 +19,7 @@ def test_profile_bad(monkeypatch): def test_profile(): profile = RaspaProfile() - assert profile.binary == f"{os.getenv('RASPA_DIR')}/bin/simulate" + assert profile.command == f"{os.getenv('RASPA_DIR')}/bin/simulate" assert profile.get_calculator_command() == [ f"{os.getenv('RASPA_DIR')}/bin/simulate", @@ -31,8 +31,8 @@ def test_profile(): def test_profil2e(): - profile = RaspaProfile(binary="my/path") - assert profile.binary == "my/path" + profile = RaspaProfile(command="my/path") + assert profile.command == "my/path" assert profile.get_calculator_command() == [ "my/path",