Skip to content

Commit 7ec3a50

Browse files
committed
Move get_command_path() to separate module
1 parent e6dcc89 commit 7ec3a50

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

executorlib/shared/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import cloudpickle
1212

13-
from executorlib.shared.executor import get_command_path
13+
from executorlib.shared.command import get_command_path
1414
from executorlib.shared.hdf import dump, get_output, load
1515

1616

executorlib/shared/command.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import os
2+
3+
4+
def get_command_path(executable: str) -> str:
5+
"""
6+
Get path of the backend executable script
7+
8+
Args:
9+
executable (str): Name of the backend executable script, either mpiexec.py or serial.py
10+
11+
Returns:
12+
str: absolute path to the executable script
13+
"""
14+
return os.path.abspath(os.path.join(__file__, "..", "..", "backend", executable))

executorlib/shared/executor.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import importlib.util
22
import inspect
3-
import os
43
import queue
54
import sys
65
from concurrent.futures import (
@@ -14,6 +13,7 @@
1413

1514
import cloudpickle
1615

16+
from executorlib.shared.command import get_command_path
1717
from executorlib.shared.communication import interface_bootup
1818
from executorlib.shared.inputcheck import (
1919
check_resource_dict,
@@ -465,19 +465,6 @@ def execute_tasks_with_dependencies(
465465
sleep(refresh_rate)
466466

467467

468-
def get_command_path(executable: str) -> str:
469-
"""
470-
Get path of the backend executable script
471-
472-
Args:
473-
executable (str): Name of the backend executable script, either mpiexec.py or serial.py
474-
475-
Returns:
476-
str: absolute path to the executable script
477-
"""
478-
return os.path.abspath(os.path.join(__file__, "..", "..", "backend", executable))
479-
480-
481468
def _get_backend_path(
482469
cores: int,
483470
) -> list:

0 commit comments

Comments
 (0)