From d739cd2ac540f9e29297395e9a1f51953cbcdf77 Mon Sep 17 00:00:00 2001 From: "Andrew S. Rosen" Date: Wed, 26 Jun 2024 15:00:34 -0700 Subject: [PATCH 1/3] Fix for ASE 3.23.0 --- src/raspa_ase/calculator.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/raspa_ase/calculator.py b/src/raspa_ase/calculator.py index f1ca04a..c3989d0 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]: """ From eedb74802b43b9632d17b0e7ca3f6e258e6fd240 Mon Sep 17 00:00:00 2001 From: "Andrew S. Rosen" Date: Wed, 26 Jun 2024 15:00:54 -0700 Subject: [PATCH 2/3] Update test_calculator.py --- tests/test_calculator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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", From 145350d5bf6f2b514e7b0abe5961b90a3d2d339e Mon Sep 17 00:00:00 2001 From: "Andrew S. Rosen" Date: Wed, 26 Jun 2024 15:04:02 -0700 Subject: [PATCH 3/3] Update calculator.py --- src/raspa_ase/calculator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raspa_ase/calculator.py b/src/raspa_ase/calculator.py index c3989d0..1cffc30 100644 --- a/src/raspa_ase/calculator.py +++ b/src/raspa_ase/calculator.py @@ -67,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: """