Skip to content

Commit

Permalink
Fix output directory tree in report
Browse files Browse the repository at this point in the history
  • Loading branch information
me-pic committed Dec 2, 2024
1 parent 0cc1ae7 commit 54076ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions phys2bids/phys2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,7 @@ def phys2bids(

# Only generate report if specified by the user
if make_report:
generate_report(conversion_path, logname, phys_out[key])

generate_report(outdir, conversion_path, logname, phys_out[key])

def _main(argv=None):
options = _get_parser().parse_args(argv)
Expand Down
8 changes: 4 additions & 4 deletions phys2bids/reporting/html_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def _generate_bokeh_plots(phys_in, figsize=(250, 500)):
return script, div


def generate_report(out_dir, log_path, phys_in):
def generate_report(out_dir, conversion_path, log_path, phys_in):
"""
Plot all the channels for visualizations as linked line plots for dynamic report.
Expand All @@ -217,15 +217,15 @@ def generate_report(out_dir, log_path, phys_in):
# Copy assets into output folder
pkgdir = sys.modules["phys2bids"].__path__[0]
assets_path = join(pkgdir, "reporting", "assets")
copy_tree(assets_path, join(out_dir, "assets"))
copy_tree(assets_path, join(conversion_path, "assets"))

# Read log
with open(log_path, "r") as f:
log_content = f.read()

log_content = log_content.replace("\n", "<br>")
log_html_path = join(out_dir, "phys2bids_report_log.html")
qc_html_path = join(out_dir, "phys2bids_report.html")
log_html_path = join(conversion_path, "phys2bids_report_log.html")
qc_html_path = join(conversion_path, "phys2bids_report.html")

html = _save_as_html(log_html_path, log_content, qc_html_path)

Expand Down

0 comments on commit 54076ce

Please sign in to comment.