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: Draft notebook filename with wildcards and params. #1352

Merged
merged 2 commits into from Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions snakemake/notebook.py
Expand Up @@ -13,6 +13,7 @@
from snakemake.common import is_local_file
from snakemake.common import ON_WINDOWS
from snakemake.sourcecache import SourceCache, infer_source_file
from snakemake.utils import format

KERNEL_STARTED_RE = re.compile(r"Kernel started: (?P<kernel_id>\S+)")
KERNEL_SHUTDOWN_RE = re.compile(r"Kernel shutdown: (?P<kernel_id>\S+)")
Expand Down Expand Up @@ -262,6 +263,7 @@ def notebook(
Load a script from the given basedir + path and execute it.
"""
draft = False
path = format(path, wildcards=wildcards, params=params)
if edit is not None:
if is_local_file(path):
if not os.path.isabs(path):
Expand Down
6 changes: 5 additions & 1 deletion snakemake/report/__init__.py
Expand Up @@ -281,7 +281,11 @@ def code(self):
self._rule.notebook
):
_, source, language, _ = script.get_source(
self._rule.notebook, self._rule.workflow.sourcecache, self._rule.basedir
self._rule.notebook,
self._rule.workflow.sourcecache,
self._rule.basedir,
wildcards=self.wildcards,
params=self.params,
)
language = language.split("_")[1]
sources = notebook.get_cell_sources(source)
Expand Down