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

fix: allow to use {wildcards} for group jobs in cluster config #1555

Merged
merged 2 commits into from
Aug 25, 2022

Conversation

johanneskoester
Copy link
Contributor

Description

fixes #1406

QC

  • The PR contains a test case for the changes or the changes are already covered by an existing test case.
  • 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).

@sonarcloud
Copy link

sonarcloud bot commented Apr 1, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug E 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@twillis209
Copy link

twillis209 commented Apr 23, 2022

I stuck this fix in my conda install of snakemake to get the job grouping feature working ASAP and had to make a few small changes to the new function before it would work:

def merged_wildcards(self):
        merged_wildcards = Wildcards(toclone=list(self.jobs)[0].wildcards)
        for job in list(self.jobs)[1:]:
            for name, value in job.wildcards.items():
                if name not in merged_wildcards.keys():
                    merged_wildcards.append(value)
                    merged_wildcards._add_name(name)
        return merged_wildcards

I'm way out of my depth here in software development terms, but I wrapped references to the frozenset self.jobs in list so that I could subscript them and replaced _set_name with _add_name as the former was missing the required index argument. I hope this helps.

@johanneskoester
Copy link
Contributor Author

Sorry for the silence. Thanks for the suggestions! Will try to merge this ASAP.

@sonarcloud
Copy link

sonarcloud bot commented Aug 25, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@johanneskoester johanneskoester merged commit f0ec73d into main Aug 25, 2022
@johanneskoester johanneskoester deleted the fix/issue1406 branch August 25, 2022 09:00
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.

snakemake crashes with group directive in cluster mode due to {wildcards} reference in cluster config
2 participants