From b4e47b748a8a157bcb2620a2ed6c1ab842a804bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Tue, 13 May 2025 22:40:10 -0400 Subject: [PATCH] FIX: Provide FD arguments to combined plot function in BOLD notebook Provide FD arguments to combined plot function in BOLD notebook. Fixes: ``` File "/home/runner/work/nifreeze/nifreeze/docs/notebooks/bold_realignment.py", line 275, in main plot_combined_profile( TypeError: main..plot_combined_profile() missing 2 required positional arguments: 'afni_fd' and 'nifreeze_fd' ``` raised for example in: https://github.com/nipreps/nifreeze/actions/runs/15007162520/job/42168515561?pr=117#step:14:2223 Take advantage of the commit to rename the function definition variables so that they do not shadow the outer variables. --- docs/notebooks/bold_realignment.ipynb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/notebooks/bold_realignment.ipynb b/docs/notebooks/bold_realignment.ipynb index 888541f9..a780b757 100644 --- a/docs/notebooks/bold_realignment.ipynb +++ b/docs/notebooks/bold_realignment.ipynb @@ -245,7 +245,7 @@ "\n", "\n", "def plot_combined_profile(\n", - " images, afni_fd, nifreeze_fd, indexing=None, figsize=(15, 1.7), cmap=\"gray\", labels=None\n", + " images, _afni_fd, _nifreeze_fd, indexing=None, figsize=(15, 1.7), cmap=\"gray\", labels=None\n", "):\n", " # Calculate the number of profile plots\n", " n_images = len(images)\n", @@ -258,7 +258,7 @@ " )\n", "\n", " # Plot the framewise displacement on the first axis\n", - " fd = pd.DataFrame({\"afni\": afni_fd, \"nifreeze\": nifreeze_fd})\n", + " fd = pd.DataFrame({\"afni\": _afni_fd, \"nifreeze\": _nifreeze_fd})\n", " fd_axis = axes[0]\n", " _ = plot_framewise_displacement(fd, [\"AFNI 3dVolreg FD\", \"nifreeze FD\"], ax=fd_axis)\n", "\n", @@ -298,6 +298,8 @@ "source": [ "plot_combined_profile(\n", " (DATA_PATH / bold_runs[15], afni_realigned[15], afni_realigned[15]),\n", + " afni_fd,\n", + " nifreeze_fd,\n", " labels=(\"hmc1\", \"original\", \"hmc2\"),\n", ");" ]