Skip to content

Commit

Permalink
ENH: Add type annotation for variable in GP estimation error analysis
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jhlegarreta committed Dec 22, 2024
1 parent d9dafbe commit 6e8311f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/dwi_gp_estimation_error_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import argparse
from collections import defaultdict
from pathlib import Path
from typing import DefaultDict, List

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -206,7 +207,7 @@ def main() -> None:

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

0 comments on commit 6e8311f

Please sign in to comment.