feat: Support conda environment definitions to be passed as function pointers, similar to input, params, and resources#1300
Conversation
…se scoped variables)
|
Kudos, SonarCloud Quality Gate passed!
|
johanneskoester
left a comment
There was a problem hiding this comment.
Thanks, interesting idea! See below for a better place to handle this.
|
Kudos, SonarCloud Quality Gate passed!
|
johanneskoester
left a comment
There was a problem hiding this comment.
I must say now that I think about it I am a bit unsure about the approach here. It kind of breaks with the way files are formatted in Snakemake. So far, we just had path/to/{somename}.yaml where {somename} was a wildcard name. For stuff that is more complex we had functions. In case of e.g. resources definition these functions can already now take params as an additional argument. I think I would prefer to allow the same mechanism for conda envs instead of introducing something new that solely works like this for conda.
|
I think I don't completely understand what you mean exactly. Are you suggesting to allow functions for the conda directive? rule foo:
[..]
params:
env_path=lambda wildcards, input: "custom_logic"
conda:
"{params.env_path}"
[..]one could write rule foo:
[..]
conda:
lambda wildcards, input: "custom_logic"
[..] |
|
Yes, exactly. The upside is that the mechanism would be exactly the same as with input, params and resources. |
|
I agree, that would be a great solution! |
Co-authored-by: Johannes Köster <johannes.koester@uni-due.de>
|
Kudos, SonarCloud Quality Gate passed!
|
… (#3093) <!--Add a description of your PR here--> ### QC <!-- Make sure that you can tick the boxes below. --> * [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). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a caching mechanism for the conda environment expansion, improving performance by reducing redundant computations. - **Bug Fixes** - Enhanced logic for determining cacheability of the conda environment, ensuring accurate evaluations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
🤖 I have created a release *beep* *boop* --- ## [8.20.4](v8.20.3...v8.20.4) (2024-09-20) ### Bug Fixes * cache conda envs to fix performance regression introduced in #1300 ([#3093](#3093)) ([66600c4](66600c4)) * Flatten conda pip dependencies for report rule info ([#3085](#3085)) ([56a1f20](56a1f20)) * improve runtime complexity of post-job checkpoint handling ([#3096](#3096)) ([ba30781](ba30781)) ### Documentation * Clarify the lookup function docstring ([#3091](#3091)) ([94177d5](94177d5)) * Update lookup signature ([#3090](#3090)) ([655d6a1](655d6a1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>








Description
This PR allows to specify conda environments using job parameters.
QC
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).