Skip to content

Commit bc347ed

Browse files
committed
STYLE: Use keyword arguments when calling DIPY keyword arg functions
Pass parameters as keyword arguments when calling DIPY functions and methods that have keyword arguments: DIPY has transitioned to keyword-only arguments for these starting version 1.10.0 (released Dec 12, 2024): https://docs.dipy.org/1.10.0/api_changes.html#dipy-1-10-0-changes Fixes: ``` src/nifreeze/testing/simulations.py:181: UserWarning: Pass ['bvecs'] as keyword args. From version 2.0.0 passing these as positional arguments will result in an error. return gradient_table(bvals, bvecs) ``` raised for example in: https://github.com/nipreps/nifreeze/actions/runs/12457578962/job/34772277392?pr=35#step:12:1015
1 parent 6b6ba70 commit bc347ed

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

scripts/dwi_gp_estimation_signal_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def main() -> None:
114114
y_pred = nib.load(args.dwi_pred_data_fname).get_fdata()
115115

116116
bvals, bvecs = read_bvals_bvecs(str(args.bval_data_fname), str(args.bvec_data_fname))
117-
gtab = gradient_table(bvals, bvecs)
117+
gtab = gradient_table(bvals, bvecs=bvecs)
118118

119119
# Pick one voxel randomly
120120
rng = np.random.default_rng(1234)

src/nifreeze/model/_dipy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,5 +286,5 @@ def _rasb2dipy(gradient):
286286
from dipy.core.gradients import gradient_table
287287

288288
warnings.filterwarnings("ignore", category=UserWarning)
289-
retval = gradient_table(gradient[3, :], gradient[:3, :].T)
289+
retval = gradient_table(gradient[3, :], bvecs=gradient[:3, :].T)
290290
return retval

src/nifreeze/testing/simulations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def create_single_shell_gradient_table(
178178

179179
# Add a b0 value to the gradient table
180180
bvals, bvecs = add_b0(bvals, bvecs)
181-
return gradient_table(bvals, bvecs)
181+
return gradient_table(bvals, bvecs=bvecs)
182182

183183

184184
def get_query_vectors(

0 commit comments

Comments
 (0)