Skip to content

Commit 311ac85

Browse files
committed
Specifying path to data generator script.
1 parent c28e664 commit 311ac85

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

examples-proposed/024-aggregated-compute-ensemble/instance_component.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,21 @@
1313
from ipsframework import Component
1414

1515

16-
def create_cmd(instance: str, alpha: float, L:float, T_final:float,
16+
def create_cmd(instance: str, path: Path, alpha: float, L:float, T_final:float,
1717
Nx:int, Nt:int) -> list[Any]:
1818
""" create the command to run the external data generator
1919
20-
:parma instance: instance name
20+
:param instance: instance name
21+
:param path: path to data generator script directory
2122
:param alpha: thermal diffusivity
2223
:param L: domain length
2324
:param T_final: final time
2425
:param Nx: number of spatial grid points
2526
:param Nt: number of time steps
2627
:returns: list of command line arguments to be executed in step()
2728
"""
28-
cmd = ['python3', 'gen_data.py', '--instance', instance,
29+
executable = f'{path!s}/gen_data.py'
30+
cmd = ['python3', executable, '--instance', instance,
2931
'--alpha', alpha, '--L', L, '--T_final', T_final,
3032
'--Nx', Nx, '--Nt', Nt]
3133
return cmd
@@ -48,7 +50,7 @@ def step(self, timestamp: float = 0.0, **keywords):
4850
f'T_final={self.T_final}, Nx={self.Nx}, '
4951
f'Nt={self.Nt}')
5052

51-
cmd = create_cmd(instance_id,
53+
cmd = create_cmd(instance_id, Path(self.BIN_PATH),
5254
self.alpha, self.L, self.T_final, self.Nx, self.Nt)
5355

5456
working_dir = str(Path('.').absolute())

examples-proposed/024-aggregated-compute-ensemble/template.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ SIMULATION_MODE = NORMAL
2828
SUB_CLASS =
2929
NAME = InstanceComponent
3030
NPROC = 1
31-
BIN_PATH =
31+
BIN_PATH = $PWD
3232
INPUT_FILES =
3333
OUTPUT_FILES =
3434
SCRIPT = $PWD/instance_component.py

0 commit comments

Comments
 (0)