This package provides a stable interface for interactions between Snakemake and its executor plugins.
Project description
Stable interfaces and functionality for Snakemake executor plugins
This package provides a stable interface for interactions between Snakemake and its executor plugins (WIP).
Plugins should implement the following skeleton to comply with this interface:
from snakemake_interface_executor_plugins.executors.remote import RemoteExecutor
from snakemake_interface_executor_plugins import ExecutorSettingsBase, CommonSettings
# Optional:
# define additional settings for your executor
# They will occur in the Snakemake CLI as --<executor-name>-<param-name>
# Omit this class if you don't need any.
@dataclass
class ExecutorSettings:
myparam: int=field(default=None, metadata={"help": "Some help text"})
# Specify common settings shared by various executors.
common_settings = CommonSettings(
# define whether your executor plugin executes locally
# or remotely. In virtually all cases, it will be remote execution
# (cluster, cloud, etc.). Only Snakemake's standard execution
# plugins (snakemake-executor-plugin-dryrun, snakemake-executor-plugin-local)
# are expected to specify False here.
non_local_exec=True
)
# Required:
# Implementation of your executor
class Executor(RemoteExecutor)
def __init__(
self,
workflow: WorkflowExecutorInterface,
dag: DAGExecutorInterface,
stats: StatsExecutorInterface,
logger: LoggerExecutorInterface,
executor_settings: Optional[ExecutorSettings], # if no ExecutorSettings are defined above, this will receive None
):
super().__init__(
workflow,
dag,
stats,
logger,
executor_settings,
# configure behavior of RemoteExecutor below
max_status_checks_per_second=1, # how many status checks should be performed per second
disable_default_remote_provider_args=False, # whether arguments for setting the remote provider shall not be passed to jobs
disable_default_resources_args=False, # whether arguments for setting default resources shall not be passed to jobs
disable_envvar_declarations=False, # whether environment variables shall not be passed to jobs
)
# access executor specific settings
self.executor_settings
# access workflow
self.workflow
# IMPORTANT: in your plugin, only access methods and properties of Snakemake objects (like Workflow, Persistence, etc.)
# that are defined in the interfaces found in THIS package. Other parts of those objects
# are NOT guaranteed to remain the same across new releases.
# To ensure that the used interfaces are not changing, you should depend on this package as
# >=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).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for snakemake_interface_executor_plugins-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76c998e90be46153338849d138d79ff23047995aeec5620a3bd46dca4e77e522 |
|
MD5 | 1a07a5882143304351b7b6fb14b21384 |
|
BLAKE2b-256 | fd5c4e10f6b38f54514f75de609e85af1210c862ba9c980a3a07f6aa3fd8fb1f |
Close
Hashes for snakemake_interface_executor_plugins-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0621516e9c9a3c6934b81a0bab360b8377d860c3caae59aceadc31190f353203 |
|
MD5 | 2d30275deebdfa99f8de0cc92b9b6255 |
|
BLAKE2b-256 | dd84a97ed140486d6c8a298a47048191590990256557613cd8e9ceeadfc0b5bf |