PennLINC / xcp_d

Post-processing of fMRIPrep, NiBabies, and HCP outputs
https://xcp-d.readthedocs.io
BSD 3-Clause "New" or "Revised" License
76 stars 23 forks source link

Account for floating point issues in ALFF time array creation #1236

Closed tsalo closed 1 month ago

tsalo commented 1 month ago

Fixes a bug reported by @erikglee. Basically, time_arr = np.arange(0, n_volumes * TR, TR) and time_arr = np.arange(n_volumes) * TR should produce the same array, but in some cases n_volumes * TR evaluates to X.00000005 (or something similar), which trickes np.arange into putting another value in the array, making it longer than desired. I've switched to the latter approach, which shouldn't be susceptible to the same problem.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.15%. Comparing base (8ca5fbc) to head (233da6b). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1236 +/- ## ======================================= Coverage 84.15% 84.15% ======================================= Files 59 59 Lines 7133 7133 Branches 1031 1031 ======================================= Hits 6003 6003 Misses 869 869 Partials 261 261 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.