Skip to content

Commit d123760

Browse files
committed
TST: Check stanford_hardi folder to avoid CI data caching issues
Check the existence of the `stanford_hardi` folder to avoid CI data caching issues: do not fetch the data if the folder exists. Fixes: ``` ___________________ ERROR collecting test/test_motion_viz.py ___________________ test/test_motion_viz.py:40: in <module> fetch_stanford_hardi() (...) .tox/py311/lib/python3.11/site-packages/dipy/data/fetcher.py:219: in fetch_data os.makedirs(folder) <frozen os>:225: in makedirs ??? E FileExistsError: [Errno 17] File exists: '/home/runner/.dipy/stanford_hardi' ``` raised for example at: https://github.com/nipreps/nifreeze/actions/runs/14963222810/job/42103268830?pr=90#step:11:148
1 parent 2d95cbb commit d123760

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/test_motion_viz.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
# https://www.nipreps.org/community/licensing/
2222
#
2323

24+
from pathlib import Path
25+
2426
import numpy as np
2527
import pandas as pd
2628
import pytest
@@ -37,7 +39,9 @@
3739
plot_volumewise_motion,
3840
)
3941

40-
fetch_stanford_hardi()
42+
if not (Path.home() / ".dipy" / "stanfoed_hardi").exists():
43+
fetch_stanford_hardi()
44+
4145
img, _ = read_stanford_hardi()
4246
img_data = img.get_fdata()
4347

0 commit comments

Comments
 (0)