From 2168a3bef0f7ae5229bb9048f6973b2bfc321d75 Mon Sep 17 00:00:00 2001 From: LegrandNico Date: Fri, 24 May 2024 11:00:08 +0200 Subject: [PATCH] add participant_id in the report function --- cardioception/reports.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cardioception/reports.py b/cardioception/reports.py index 3d93e26..a55939e 100644 --- a/cardioception/reports.py +++ b/cardioception/reports.py @@ -304,20 +304,23 @@ def preprocessing(results: Union[PathLike, pd.DataFrame]) -> pd.DataFrame: def report( - result_path: PathLike, report_path: Optional[PathLike] = None, task: str = "HRD" + result_path: PathLike, report_path: Optional[PathLike] = None, task: str = "HRD", + participant_id: str = "sub-01" ): """From the results folders, create HTML reports of behavioural and physiological data. Parameters ---------- - resultPath : PathLike + resultPath : Path variable. Where the results are stored (one participant only). - reportPath : PathLike, optional + reportPath : Where the HTML report should be saved. If `None`, default will be in the provided `resultPath`. - task : str, optional + task : The task ("HRD" or "HBC"), by default "HRD". + participant_id : + The participant ID used in the filename. """ from papermill import execute_notebook @@ -325,7 +328,7 @@ def report( if report_path is None: report_path = result_path temp_notebook = Path(report_path, "temp.ipynb") - htmlreport = Path(report_path, f"{task}_report.html") + htmlreport = Path(report_path, f"{participant_id}-{task}_report.html") if task == "HRD": template = "HeartRateDiscrimination.ipynb"