From 24ba7f04a089f32f46162b15c13ecb2535c485c6 Mon Sep 17 00:00:00 2001 From: meesters Date: Mon, 26 Jan 2026 15:19:15 +0100 Subject: [PATCH 1/2] fix: tbdstring handling --- snakemake_executor_plugin_slurm/partitions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snakemake_executor_plugin_slurm/partitions.py b/snakemake_executor_plugin_slurm/partitions.py index 4be329bb..45ed6471 100644 --- a/snakemake_executor_plugin_slurm/partitions.py +++ b/snakemake_executor_plugin_slurm/partitions.py @@ -3,6 +3,7 @@ import yaml from pathlib import Path from math import inf, isinf +from snakemake.common import tbdstring from snakemake_interface_common.exceptions import WorkflowError from snakemake_interface_executor_plugins.jobs import ( JobExecutorInterface, @@ -291,6 +292,9 @@ def score_job_fit(self, job: JobExecutorInterface) -> Optional[float]: for resource_key, limit in numerical_resources.items(): job_requirement = job.resources.get(resource_key, 0) + # return 0 if dealing with a tbdstring (resource not specified) + if isinstance(job_requirement, tbdstring.TBDString): + return 0 # Convert to numeric value if it's a string if isinstance(job_requirement, str): try: From 36f041c93ed0064c6c68b3613cd2828d5aec4c10 Mon Sep 17 00:00:00 2001 From: Christian Meesters Date: Thu, 29 Jan 2026 10:47:16 +0100 Subject: [PATCH 2/2] fix: more stringent logic --- snakemake_executor_plugin_slurm/partitions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snakemake_executor_plugin_slurm/partitions.py b/snakemake_executor_plugin_slurm/partitions.py index 45ed6471..5a4e7043 100644 --- a/snakemake_executor_plugin_slurm/partitions.py +++ b/snakemake_executor_plugin_slurm/partitions.py @@ -292,11 +292,11 @@ def score_job_fit(self, job: JobExecutorInterface) -> Optional[float]: for resource_key, limit in numerical_resources.items(): job_requirement = job.resources.get(resource_key, 0) - # return 0 if dealing with a tbdstring (resource not specified) + # Skip TBD (not specified) resources entirely if isinstance(job_requirement, tbdstring.TBDString): - return 0 + job_requirement = 0 # Convert to numeric value if it's a string - if isinstance(job_requirement, str): + elif isinstance(job_requirement, str): try: job_requirement = float(job_requirement) except ValueError: