Skip to content
Open
Changes from all commits
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
6 changes: 5 additions & 1 deletion snakemake_executor_plugin_slurm/partitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import yaml
from pathlib import Path
from math import inf, isinf
from snakemake.common import tbdstring
Comment thread
coderabbitai[bot] marked this conversation as resolved.
from snakemake_interface_common.exceptions import WorkflowError
from snakemake_interface_executor_plugins.jobs import (
JobExecutorInterface,
Expand Down Expand Up @@ -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):
Comment thread
cmeesters marked this conversation as resolved.
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:
Expand Down