Skip to content

Commit

Permalink
touch up
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Feb 25, 2024
1 parent 19474d3 commit 24402f5
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions pydra/engine/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ def close(self):
class PsijWorker(Worker):
"""A worker to execute tasks using PSI/J."""

def __init__(self, subtype, **kwargs):
def __init__(self, **kwargs):
"""
Initialize PsijWorker.
Expand All @@ -924,15 +924,6 @@ def __init__(self, subtype, **kwargs):
logger.debug("Initialize PsijWorker")
self.psij = psij

# Check if the provided subtype is valid
valid_subtypes = ["local", "slurm"]
if subtype not in valid_subtypes:
raise ValueError(
f"Invalid 'subtype' provided. Available options: {', '.join(valid_subtypes)}"
)

self.subtype = subtype

def run_el(self, interface, rerun=False, **kwargs):
"""Run a task."""
return self.exec_psij(interface, rerun=rerun)
Expand Down Expand Up @@ -1051,21 +1042,15 @@ def close(self):
class PsijLocalWorker(PsijWorker):
"""A worker to execute tasks using PSI/J on the local machine."""

plugin_name = "psij-local"

def __init__(self, **kwargs):
"""Initialize PsijLocalWorker."""
super().__init__(subtype="local", **kwargs)
subtype = "local"
plugin_name = f"psij-{subtype}"


class PsijSlurmWorker(PsijWorker):
"""A worker to execute tasks using PSI/J using SLURM."""

plugin_name = "psij-slurm"

def __init__(self, **kwargs):
"""Initialize PsijSlurmWorker."""
super().__init__(subtype="local", **kwargs)
subtype = "slurm"
plugin_name = f"psij-{subtype}"


WORKERS = {
Expand Down

0 comments on commit 24402f5

Please sign in to comment.