Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 1, 2023
1 parent 6d80f02 commit 85a05f6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pydra/engine/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,7 @@ def close(self):
"""Finalize the internal pool of tasks."""
pass


class PsijWorker(Worker):
def __init__(self, **kwargs):
"""Initialize worker."""
Expand All @@ -909,8 +910,8 @@ def make_spec(self, cmd=None, arg=None, cache_dir=None):
spec = self.psij.JobSpec()
spec.executable = cmd
spec.arguments = arg
spec.stdout_path = 'demo.stdout'
spec.stderr_path = 'demo.stderr'
spec.stdout_path = "demo.stdout"
spec.stderr_path = "demo.stderr"

Check warning on line 914 in pydra/engine/workers.py

View check run for this annotation

Codecov / codecov/patch

pydra/engine/workers.py#L910-L914

Added lines #L910 - L914 were not covered by tests

return spec

Check warning on line 916 in pydra/engine/workers.py

View check run for this annotation

Codecov / codecov/patch

pydra/engine/workers.py#L916

Added line #L916 was not covered by tests

Expand All @@ -921,9 +922,12 @@ def make_job(self, spec, attributes):

async def exec_psij(self, runnable, rerun=False):
import psij

Check warning on line 924 in pydra/engine/workers.py

View check run for this annotation

Codecov / codecov/patch

pydra/engine/workers.py#L924

Added line #L924 was not covered by tests

self.psij = psij
jex = psij.JobExecutor.get_instance('local')
spec = self.make_spec(runnable.inputs.executable, runnable.inputs.args, runnable.cache_dir)
jex = psij.JobExecutor.get_instance("local")
spec = self.make_spec(

Check warning on line 928 in pydra/engine/workers.py

View check run for this annotation

Codecov / codecov/patch

pydra/engine/workers.py#L926-L928

Added lines #L926 - L928 were not covered by tests
runnable.inputs.executable, runnable.inputs.args, runnable.cache_dir
)
job = self.make_job(spec, None)
jex.submit(job)
return

Check warning on line 933 in pydra/engine/workers.py

View check run for this annotation

Codecov / codecov/patch

pydra/engine/workers.py#L931-L933

Added lines #L931 - L933 were not covered by tests
Expand All @@ -932,6 +936,7 @@ def close(self):
"""Finalize the internal pool of tasks."""
pass

Check warning on line 937 in pydra/engine/workers.py

View check run for this annotation

Codecov / codecov/patch

pydra/engine/workers.py#L937

Added line #L937 was not covered by tests


WORKERS = {
"serial": SerialWorker,
"cf": ConcurrentFuturesWorker,
Expand Down

0 comments on commit 85a05f6

Please sign in to comment.