Skip to content

Commit 6e8311f

Browse files
committed
ENH: Add type annotation for variable in GP estimation error analysis
Add type annotation for local variable `scores` in GP estimation error analysis script. Fixes: ``` scripts/dwi_gp_estimation_error_analysis.py:207: error: Need type annotation for "scores" [var-annotated] ``` raised for example in: https://github.com/nipreps/nifreeze/actions/runs/12437972140/job/34728973936#step:8:112
1 parent d9dafbe commit 6e8311f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/dwi_gp_estimation_error_analysis.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import argparse
3232
from collections import defaultdict
3333
from pathlib import Path
34+
from typing import DefaultDict, List
3435

3536
import numpy as np
3637
import pandas as pd
@@ -206,7 +207,7 @@ def main() -> None:
206207

207208
if args.kfold:
208209
# Use Scikit-learn cross validation
209-
scores = defaultdict(list, {})
210+
scores: DefaultDict[str, List[float | str]] = defaultdict(list)
210211
for n in args.kfold:
211212
for i in range(args.repeats):
212213
cv_scores = -1.0 * cross_validate(X, y.T, n, n_repeats, gpr)

0 commit comments

Comments
 (0)