Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dry run doesn't work with input-based resource allocation #2575

Closed
Ulthran opened this issue Jan 3, 2024 · 1 comment · Fixed by #2690
Closed

Dry run doesn't work with input-based resource allocation #2575

Ulthran opened this issue Jan 3, 2024 · 1 comment · Fixed by #2690
Labels
bug Something isn't working

Comments

@Ulthran
Copy link

Ulthran commented Jan 3, 2024

Snakemake version

8.0.1

Describe the bug

This is probably considered in the gray area between a bug and a feature but I have rules with resource specifications defined like this:

...
resources:
        runtime=lambda wc, input: max(MIN_RUNTIME, input.size_mb / 5),
...

and when I use the -n flag to do a dry run of the pipeline I get WorkflowError: Cannot parse runtime value into minutes for setting runtime resource: <TBD>. It makes sense that it wouldn't be able to calculate resource requirements without any inputs but it would be nice to be able to use -n in tandem with this way of defining resources.

Is this something you'd consider changing the behavior of (e.g. allow the resource spec to take a value like TBD for dryruns only) or is it something where I should just wrap the resource function with something to catch this and provide a default?

@Ulthran Ulthran added the bug Something isn't working label Jan 3, 2024
@tdayris
Copy link
Contributor

tdayris commented Jan 16, 2024

This seems to be the same as #2555

The error is still there with Snakemake version 8.1.3

I'm trying to catch this with something like isinstance(value, snakemake.common.tbdstring.TBDString)

johanneskoester added a commit that referenced this issue Feb 15, 2024
### Description

This fixes the `WorkflowError`s that occur when the resource parsing
code tries to parse `TBDString`s during a dry run.

This should fix #2575 and
fix #2555.

### QC

* [x] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).

Co-authored-by: Johannes Köster <johannes.koester@tu-dortmund.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants