Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Executor(RemoteExecutor):
# access workflow
self.workflow
# access executor specific settings
self.workflow.executor_settings
self.executor_settings

# IMPORTANT: in your plugin, only access methods and properties of
# Snakemake objects (like Workflow, Persistence, etc.) that are
Expand Down
3 changes: 3 additions & 0 deletions snakemake_interface_executor_plugins/executors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from snakemake_interface_executor_plugins.jobs import JobExecutorInterface
from snakemake_interface_executor_plugins.logging import LoggerExecutorInterface
from snakemake_interface_executor_plugins.settings import ExecutorSettingsBase
from snakemake_interface_executor_plugins.utils import format_cli_arg
from snakemake_interface_executor_plugins.workflow import WorkflowExecutorInterface

Expand All @@ -25,9 +26,11 @@ def __init__(
self,
workflow: WorkflowExecutorInterface,
logger: LoggerExecutorInterface,
executor_settings: Optional[ExecutorSettingsBase],
):
self.workflow = workflow
self.dag = workflow.dag
self.executor_settings = executor_settings
self.logger = logger

def get_resource_declarations_dict(self, job: JobExecutorInterface):
Expand Down
8 changes: 5 additions & 3 deletions snakemake_interface_executor_plugins/executors/real.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
__license__ = "MIT"

from abc import abstractmethod
from typing import Dict
from typing import Dict, Optional

from snakemake_interface_common import at_least_snakemake_version
from snakemake_interface_executor_plugins.executors.base import (
AbstractExecutor,
SubmittedJobInfo,
)
from snakemake_interface_executor_plugins.logging import LoggerExecutorInterface
from snakemake_interface_executor_plugins.settings import ExecMode
from snakemake_interface_executor_plugins.settings import ExecMode, ExecutorSettingsBase
from snakemake_interface_executor_plugins.utils import (
encode_target_jobs_cli_args,
format_cli_arg,
Expand All @@ -27,13 +27,15 @@ def __init__(
self,
workflow: WorkflowExecutorInterface,
logger: LoggerExecutorInterface,
executor_settings: Optional[ExecutorSettingsBase],
post_init: bool = True,
):
super().__init__(
workflow,
logger,
executor_settings,
)
self.executor_settings = self.workflow.executor_settings
self.executor_settings = executor_settings
self.snakefile = workflow.main_snakefile
if post_init:
self.__post_init__()
Expand Down
5 changes: 5 additions & 0 deletions snakemake_interface_executor_plugins/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from snakemake_interface_executor_plugins.cli import (
SpawnedJobArgsFactoryExecutorInterface,
)
from snakemake_interface_executor_plugins.dag import DAGExecutorInterface
from snakemake_interface_executor_plugins.persistence import (
PersistenceExecutorInterface,
)
Expand All @@ -25,6 +26,10 @@


class WorkflowExecutorInterface(ABC):
@property
@abstractmethod
def dag(self) -> DAGExecutorInterface: ...

@property
@abstractmethod
def spawned_job_args_factory(self) -> SpawnedJobArgsFactoryExecutorInterface: ...
Expand Down