Skip to content

fix: tbdstring handling#406

Open
cmeesters wants to merge 7 commits into
mainfrom
fix/tbd_stringhandling_for_partition_selection
Open

fix: tbdstring handling#406
cmeesters wants to merge 7 commits into
mainfrom
fix/tbd_stringhandling_for_partition_selection

Conversation

@cmeesters

@cmeesters cmeesters commented Jan 26, 2026

Copy link
Copy Markdown
Member

During testing, it occurred that unset resource values (which yield a tbd string) will cause a workflow to break, if used in conjunction with the storage-fs plugin.

This PR is

  1. a mitigation attempt
  2. should raise concern, that such an error has not been reported before (are people not using the different plugins in combination?)
  3. should cause implementation of tests together with the fs storage plugin (not part of this PR).

Summary by CodeRabbit

  • Bug Fixes
    • Unspecified or placeholder job resource values are now treated as zero, avoiding misestimation of resource needs.
    • Prevented duplicate interpretation of resource specifications, improving partition selection and scheduling reliability.
    • Non-numeric resource values now safely fall back to zero to avoid scheduling errors.

@coderabbitai

coderabbitai Bot commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Imported tbdstring and updated score_job_fit in snakemake_executor_plugin_slurm/partitions.py to treat TBDString numeric job resources as 0 and prevent double-processing by changing string handling to an elif branch.

Changes

Cohort / File(s) Summary
TBDString Handling in Partition Scoring
snakemake_executor_plugin_slurm/partitions.py
Added import of tbdstring; in score_job_fit, treat numeric job resources that are tbdstring as 0, coerce non-numeric values to 0, and change string handling to an elif to avoid double-processing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇 I hop through code with ears alert and bright,
When numbers are "tbd" I set them to light,
No double checks now, conditions in line,
Partitions count true — one carrot at a time 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: tbdstring handling' directly relates to the main change in the PR, which is fixing TBDString value handling in the score_job_fit function to prevent workflow breakage when unset resource values are encountered.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/tbd_stringhandling_for_partition_selection

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@snakemake_executor_plugin_slurm/partitions.py`:
- Line 6: Replace the early "return 0" when encountering an unresolved resource
using tbdstring with assigning job_requirement = 0 so the loop continues;
specifically, in the code that checks numerical resources (the branch where
tbdstring from snakemake.common is detected), set job_requirement = 0 and allow
execution to continue so subsequent constraint and qos checks still run rather
than exiting the function.

Comment thread snakemake_executor_plugin_slurm/partitions.py
Comment thread snakemake_executor_plugin_slurm/partitions.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants