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

add report #109

Merged
merged 2 commits into from
Mar 10, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dependencies = [
[project.optional-dependencies]
# these are needed to run the data production
runprod = [
"pygments",
"snakemake>=8.16",
]
test = [
Expand Down
25 changes: 25 additions & 0 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,31 @@ onstart:


onsuccess:
from snakemake.report import auto_report
from snakemake_interface_report_plugins.settings import ReportSettingsBase
from snakemake_interface_report_plugins.registry import ReportPluginRegistry
import asyncio

rep_dir = Path(
f"{log_path(config)}/report-{datetime.strftime(datetime.utcnow(), '%Y%m%dT%H%M%SZ')}"
)
rep_dir.mkdir(parents=True, exist_ok=True)
# auto_report(workflow.persistence.dag, f"{rep_dir}/report.html")
for form in ["html"]: # , "pdf", "tex"
report_plugin = ReportPluginRegistry().get_plugin(form)
report_settings = report_plugin.settings_cls
report_settings.path = rep_dir / f"report.{form}"
asyncio.run(
auto_report(workflow.persistence.dag, report_plugin, report_settings)
)

with (rep_dir / "dag.txt").open("w") as f:
f.writelines(str(workflow.persistence.dag))

with (rep_dir / "rulegraph.txt").open("w") as f:
f.writelines(str(workflow.persistence.dag.rule_dot()))

# remove .gen files
files = glob.glob("*.gen")
for file in files:
if os.path.isfile(file):
Expand Down
Loading