Skip to content

Commit 25cbc2f

Browse files
committed
add/improve documentation for PsijWorker
1 parent f0c62c1 commit 25cbc2f

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

pydra/engine/workers.py

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,14 @@ def close(self):
894894

895895
class PsijWorker(Worker):
896896
def __init__(self, subtype, **kwargs):
897-
"""Initialize worker."""
897+
"""
898+
Initialize PsijWorker.
899+
900+
Parameters
901+
----------
902+
subtype : str
903+
Scheduler for PSI/J.
904+
"""
898905
try:
899906
import psij
900907
except ImportError:
@@ -909,18 +916,60 @@ def run_el(self, interface, rerun=False, **kwargs):
909916
return self.exec_psij(interface, rerun=rerun)
910917

911918
def make_spec(self, cmd=None, arg=None):
919+
"""
920+
Create a PSI/J job specification.
921+
922+
Parameters
923+
----------
924+
cmd : str, optional
925+
Executable command. Defaults to None.
926+
arg : list, optional
927+
List of arguments. Defaults to None.
928+
929+
Returns
930+
-------
931+
psij.JobSpec
932+
PSI/J job specification.
933+
"""
912934
spec = self.psij.JobSpec()
913935
spec.executable = cmd
914936
spec.arguments = arg
915937

916938
return spec
917939

918940
def make_job(self, spec, attributes):
941+
"""
942+
Create a PSI/J job.
943+
944+
Parameters
945+
----------
946+
spec : psij.JobSpec
947+
PSI/J job specification.
948+
attributes : any
949+
Job attributes.
950+
951+
Returns
952+
-------
953+
psij.Job
954+
PSI/J job.
955+
"""
919956
job = self.psij.Job()
920957
job.spec = spec
921958
return job
922959

923960
async def exec_psij(self, runnable, rerun=False):
961+
"""
962+
Run a task (coroutine wrapper).
963+
964+
Raises
965+
------
966+
Exception
967+
If stderr is not empty.
968+
969+
Returns
970+
-------
971+
None
972+
"""
924973
import pickle
925974
import os
926975

0 commit comments

Comments
 (0)