diff --git a/snakemake_executor_plugin_slurm/partitions.py b/snakemake_executor_plugin_slurm/partitions.py index f52cc4ed..89c025fc 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, @@ -289,8 +290,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) + # Skip TBD (not specified) resources entirely + if isinstance(job_requirement, tbdstring.TBDString): + 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: