Skip to content

Commit 81de47e

Browse files
authored
Merge pull request #386 from simvue-io/hotfix/allow-path-objects
Allow path objects when using `add_process`
2 parents 9706ec6 + 49fbcdd commit 81de47e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

simvue/executor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import multiprocessing
1717
import os
1818
import subprocess
19+
import pathlib
1920
import time
2021
import typing
2122

@@ -100,13 +101,13 @@ def add_process(
100101
identifier: str,
101102
*args,
102103
executable: typing.Optional[str] = None,
103-
script: typing.Optional[str] = None,
104-
input_file: typing.Optional[str] = None,
104+
script: typing.Optional[pathlib.Path] = None,
105+
input_file: typing.Optional[pathlib.Path] = None,
105106
env: typing.Optional[typing.Dict[str, str]] = None,
106107
completion_callback: typing.Optional[
107108
typing.Callable[[int, str, str], None]
108109
] = None,
109-
completion_trigger: multiprocessing.synchronize.Event,
110+
completion_trigger: typing.Optional[multiprocessing.synchronize.Event] = None,
110111
**kwargs,
111112
) -> None:
112113
"""Add a process to be executed to the executor.

simvue/run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,9 +618,9 @@ def add_process(
618618
self,
619619
identifier: str,
620620
*cmd_args,
621-
executable: typing.Optional[str] = None,
622-
script: typing.Optional[str] = None,
623-
input_file: typing.Optional[str] = None,
621+
executable: typing.Optional[typing.Union[str]] = None,
622+
script: typing.Optional[pydantic.FilePath] = None,
623+
input_file: typing.Optional[pydantic.FilePath] = None,
624624
completion_callback: typing.Optional[
625625
typing.Callable[[int, str, str], None]
626626
] = None,

0 commit comments

Comments
 (0)