Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Commit 03250cb

Browse files
Merge pull request #24 from Quantum-Accelerators/Andrew-S-Rosen-patch-2
Fix for ASE 3.23.0
2 parents 8960c3f + 145350d commit 03250cb

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/raspa_ase/calculator.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,26 @@ class RaspaProfile(BaseProfile):
3232
RASPA profile, which defines the command that will be executed and where.
3333
"""
3434

35-
def __init__(self, binary: Path | str | None = None, **kwargs) -> None:
35+
def __init__(self, command: Path | str | None = None, **kwargs) -> None:
3636
"""
3737
Initialize the RASPA profile. $RASPA_DIR must be set in the environment.
3838
3939
Parameters
4040
----------
41-
binary
42-
The binary to run RASPA. This defaults to doing `${RASPA_DIR}/bin/simulate`
41+
command
42+
The command to run RASPA. This defaults to doing `${RASPA_DIR}/bin/simulate`
4343
and typically does not need to be changed.
4444
4545
Returns
4646
-------
4747
None
4848
"""
49-
super().__init__(**kwargs)
50-
if not binary:
49+
if not command:
5150
raspa_dir = os.environ.get("RASPA_DIR")
5251
if not raspa_dir:
5352
raise OSError("RASPA_DIR environment variable not set")
54-
binary = f"{raspa_dir}/bin/simulate"
55-
self.binary = binary
53+
command = f"{raspa_dir}/bin/simulate"
54+
super().__init__(command, **kwargs)
5655

5756
def get_calculator_command(self, inputfile: str = SIMULATION_INPUT) -> list[str]:
5857
"""
@@ -68,7 +67,7 @@ def get_calculator_command(self, inputfile: str = SIMULATION_INPUT) -> list[str]
6867
list[str]
6968
The command to run the calculator.
7069
"""
71-
return [self.binary, f"{inputfile}"]
70+
return [self.command, f"{inputfile}"]
7271

7372
def version(self) -> str:
7473
"""

tests/test_calculator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_profile_bad(monkeypatch):
1919

2020
def test_profile():
2121
profile = RaspaProfile()
22-
assert profile.binary == f"{os.getenv('RASPA_DIR')}/bin/simulate"
22+
assert profile.command == f"{os.getenv('RASPA_DIR')}/bin/simulate"
2323

2424
assert profile.get_calculator_command() == [
2525
f"{os.getenv('RASPA_DIR')}/bin/simulate",
@@ -31,8 +31,8 @@ def test_profile():
3131

3232

3333
def test_profil2e():
34-
profile = RaspaProfile(binary="my/path")
35-
assert profile.binary == "my/path"
34+
profile = RaspaProfile(command="my/path")
35+
assert profile.command == "my/path"
3636

3737
assert profile.get_calculator_command() == [
3838
"my/path",

0 commit comments

Comments
 (0)