Skip to content

Commit

Permalink
update template
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester committed Sep 5, 2023
1 parent 1ad8ce9 commit adfa081
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions poetry_snakemake_plugin/templates/init.py.j2
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@

from dataclasses import dataclass, field
from typing import List
from snakemake_interface_executor_plugins.executors.base import SubmittedJobInfo
from snakemake_interface_executor_plugins.executors.remote import RemoteExecutor
from snakemake_interface_executor_plugins import ExecutorSettingsBase, CommonSettings
from snakemake_interface_executor_plugins.workflow import WorkflowExecutorInterface
from snakemake_interface_executor_plugins.logging import LoggerExecutorInterface
from snakemake_interface_executor_plugins.jobs import (
ExecutorJobInterface,
)


# Optional:
Expand Down Expand Up @@ -57,6 +62,19 @@ class Executor(RemoteExecutor):
# >=a.b.c,<d with d=a+1 (i.e. pin the dependency on this package to be at least the version at time of development
# and less than the next major version which would introduce breaking changes).

async def _wait_for_jobs(self):
# implement here a loop that checks which jobs are already finished
def run_job(self, job: ExecutorJobInterface):
# Implement here how to run a job.
# You can access the job's resources, etc.
# via the job object.
# After submitting the job, you have to call self.report_job_submission(job_info).
# with job_info being of type snakemake_interface_executor_plugins.executors.base.SubmittedJobInfo.
...
def check_active_jobs(self, active_jobs: List[SubmittedJobInfo]):
# Check the status of active jobs.
# Jobs that are finished or error out have to be removed from the given list.
# For jobs that have finished successfully, you have to call self.report_job_success(job).
# For jobs that have errored, you have to call self.report_job_error(job).
...

0 comments on commit adfa081

Please sign in to comment.