Skip to content

Commit 516d0d7

Browse files
committed
ENH: Annotate optimizer attribute type DiffusionGPR
Annotate the `optimizer` attribute type in the DiffusionGPR GPR child class. Fixes: ``` src/nifreeze/model/gpr.py:234: error: "DiffusionGPR" has no attribute "optimizer" [attr-defined] ``` raised for example in: https://github.com/nipreps/nifreeze/actions/runs/12437972140/job/34728973936#step:8:82
1 parent 906fa20 commit 516d0d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/nifreeze/model/gpr.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from __future__ import annotations
2626

2727
from numbers import Integral, Real
28-
from typing import Callable, ClassVar, Mapping, Sequence
28+
from typing import Callable, ClassVar, Mapping, Optional, Sequence, Union
2929

3030
import numpy as np
3131
from scipy import optimize
@@ -153,6 +153,8 @@ class DiffusionGPR(GaussianProcessRegressor):
153153
154154
"""
155155

156+
optimizer: Optional[Union[StrOptions, Callable, None]] = None
157+
156158
_parameter_constraints: ClassVar[dict] = {
157159
"kernel": [None, Kernel],
158160
"alpha": [Interval(Real, 0, None, closed="left"), np.ndarray],

0 commit comments

Comments
 (0)