Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 9, 2024
1 parent d9ee113 commit db90f3a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,9 @@ def get_aggregation_strategies(aggregation_strategies):
return bus_strategies, generator_strategies


def mock_snakemake(rulename, root_dir=None, submodule_dir=None, configfile=None, **wildcards):
def mock_snakemake(
rulename, root_dir=None, submodule_dir=None, configfile=None, **wildcards
):
"""
This function is expected to be executed from the "scripts"-directory of "
the snakemake project. It returns a snakemake.script.Snakemake object,
Expand Down Expand Up @@ -570,14 +572,16 @@ def mock_snakemake(rulename, root_dir=None, submodule_dir=None, configfile=None,
break

if isinstance(configfile, str):
with open(configfile, 'r') as file:
with open(configfile, "r") as file:
configfile = yaml.safe_load(file)
else:
configfile = None

workflow = sm.Workflow(
snakefile, overwrite_configfiles=[], rerun_triggers=[],
overwrite_config=configfile
snakefile,
overwrite_configfiles=[],
rerun_triggers=[],
overwrite_config=configfile,
)
workflow.include(snakefile)
workflow.global_resources = {}
Expand Down

0 comments on commit db90f3a

Please sign in to comment.