Skip to content

Commit

Permalink
Merge pull request #414 from sunbeam-labs/413-get-rid-of-warningerror…
Browse files Browse the repository at this point in the history
…-summary

Remove annoyances
  • Loading branch information
Ulthran authored Oct 11, 2023
2 parents f7ed98b + 4384a95 commit 02c21f6
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 40 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@

If this is for a release:
* [ ] I have updated documentation
* [ ] I have updated all conda pin files (`snakedeploy update-conda-envs workflow/envs/*.yml`)
* [ ] I have updated the hardcoded version at the top of `install.sh` to match what this release's version will be
* [ ] I have created a release archive that will be attached to this release
33 changes: 0 additions & 33 deletions sunbeamlib/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,6 @@
import os


WARN_STR = ["warn", "warning"]
ERR_STR = ["err", "error", "exception"]


def parse_err_and_warn(log_fp: str) -> tuple:
"""Go through output log and return a list of warnings and a list of errors"""
warns = list()
errs = list()

with open(log_fp) as f:
for n, l in enumerate(f, 1):
if [1 for w in WARN_STR if w in l.lower()]:
warns.append(n)
if [1 for e in ERR_STR if e in l.lower()]:
errs.append(n)

return warns, errs


def parse_rule_logs(log_fp: str) -> list:
"""Go through each per-rule log and report any warnings or errors"""
log_fps = os.listdir(log_fp)
alerts = []
for fp in log_fps:
warns, errs = parse_err_and_warn(os.path.join(log_fp, fp))
if warns or errs:
alerts.append(
f"{fp}:\nWarnings: ({len(warns)}) {warns}\nErrors: ({len(errs)}) {errs}"
)

return alerts


def compile_benchmarks(benchmark_fp: str, stats_fp: str):
"""Aggregate all the benchmark files into one and put it in stats_fp"""
benchmarks = []
Expand Down
6 changes: 0 additions & 6 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,4 @@ onsuccess:

onerror:
print("Sunbeam failed with error.")
warnings, errors = parse_err_and_warn(log)
print(f"Warnings: ({len(warnings)}) {warnings}")
print(f"Errors: ({len(errors)}) {errors}")
alerts = parse_rule_logs(LOG_FP)
for a in alerts:
print(a)
compile_benchmarks(BENCHMARK_FP, Cfg["all"]["root"] / "stats")
2 changes: 1 addition & 1 deletion workflow/scripts/remove_low_complexity.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
ids = []
with open(snakemake.input.ids) as f:
ids = [remove_pair_id(id, log) for id in f.readlines()]
log.write(f"Komplexity IDs to be filtered: {str(ids)}\n")
log.write(f"Num Komplexity IDs to be filtered: {len(ids)}\n")

filter_ids(snakemake.input.reads, snakemake.output[0], ids, log)

0 comments on commit 02c21f6

Please sign in to comment.