Coverage for sparkle/types/sparkle_callable.py: 85%

13 statements  

« prev     ^ index     » next       coverage.py v7.9.1, created at 2025-07-01 13:21 +0000

1"""Abstract class Sparkle Callable.""" 

2from __future__ import annotations 

3from pathlib import Path 

4 

5 

6class SparkleCallable: 

7 """Sparkle Callable class.""" 

8 

9 def __init__(self: SparkleCallable, 

10 directory: Path, 

11 runsolver_exec: Path = None) -> None: 

12 """Initialize callable. 

13 

14 Args: 

15 directory: Directory of the callable. 

16 runsolver_exec: Path to the runsolver executable. 

17 By default, runsolver in solver_directory. 

18 """ 

19 self.directory = directory 

20 self.name = directory.name 

21 self.runsolver_exec = runsolver_exec 

22 if self.runsolver_exec is None: 

23 self.runsolver_exec = self.directory / "runsolver" 

24 

25 def build_cmd(self: SparkleCallable) -> list[str | Path]: 

26 """A method that builds the commandline call string.""" 

27 return NotImplementedError 

28 

29 def run(self: SparkleCallable) -> None: 

30 """A method that runs the callable.""" 

31 return NotImplementedError