|
31 | 31 | import nibabel as nb |
32 | 32 | import pytest |
33 | 33 | from nipype.interfaces.base import Undefined |
| 34 | +from packaging.version import Version |
34 | 35 |
|
35 | 36 | from .. import bids as bintfs |
36 | 37 | from niworkflows.testing import needs_data_dir |
@@ -211,7 +212,7 @@ def connect_and_run_save(prep_result, save): |
211 | 212 | {"space": "fsLR", "density": "91k"}, |
212 | 213 | "sub-100185/func/sub-100185_task-machinegame_run-01_" |
213 | 214 | "space-fsLR_den-91k_bold.dtseries.nii", |
214 | | - "f7b8755c6ad0d8dcdb60676331b52a23ce288b61", |
| 215 | + "335f1394ce90b58bbf27026b6eeec4d2124c11da", |
215 | 216 | ), |
216 | 217 | ( |
217 | 218 | BOLD_PATH, |
@@ -374,10 +375,15 @@ def test_DerivativesDataSink_build_path( |
374 | 375 | assert not np.isnan(hdr["scl_slope"]) |
375 | 376 | assert not np.isnan(hdr["scl_inter"]) |
376 | 377 | for out, chksum in zip(output, checksum): |
377 | | - if chksum == "f7b8755c6ad0d8dcdb60676331b52a23ce288b61" and sys.version_info < (3, 8): |
378 | | - # Python 3.8 began preserving insertion order of attributes in XML |
379 | | - # Therefore we get a different checksum before/after |
380 | | - chksum = "a37ffb1188dd9a7b708de5b8daef46dac56ef8d4" |
| 378 | + if chksum == "335f1394ce90b58bbf27026b6eeec4d2124c11da": |
| 379 | + if sys.version_info < (3, 8): |
| 380 | + # Python 3.8 began preserving insertion order of attributes in XML |
| 381 | + # Therefore we get a different checksum before/after |
| 382 | + chksum = "a37ffb1188dd9a7b708de5b8daef46dac56ef8d4" |
| 383 | + elif Version(nb.__version__) < Version('5.3'): |
| 384 | + # Nibabel 5.3 avoids unnecessary roundtrips for Cifti2Headers |
| 385 | + # Older versions transformed a `SeriesStep="2"` into `SeriesStep="2.0"` |
| 386 | + chksum = "f7b8755c6ad0d8dcdb60676331b52a23ce288b61" |
381 | 387 | assert sha1(Path(out).read_bytes()).hexdigest() == chksum |
382 | 388 |
|
383 | 389 |
|
|
0 commit comments