Skip to content

Commit 0b5130b

Browse files
committed
STYLE: Remove ClassVar[dict] type hinting from GPR param constraints
Remove `ClassVar[dict]` type hinting from GPR parameter constraints variable and define it as a normal dictionary. Fixes: ``` Cannot override instance variable '_parameter_constraints' (previously declared on base class 'GaussianProcessRegressor') with class variable ``` As `_param_constraints` is an instance variable in `scikit-learn`: https://github.com/scikit-learn/scikit-learn/blob/1.6.X/sklearn/gaussian_process/_gpr.py#L189
1 parent bd7ffd7 commit 0b5130b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/nifreeze/model/gpr.py

Lines changed: 2 additions & 2 deletions
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, Literal, Mapping, Optional, Sequence, Union
28+
from typing import Callable, Literal, Mapping, Optional, Sequence, Union
2929

3030
import numpy as np
3131
import numpy.typing as npt
@@ -156,7 +156,7 @@ class DiffusionGPR(GaussianProcessRegressor):
156156

157157
optimizer: Optional[Union[StrOptions, Callable, None]] = None
158158

159-
_parameter_constraints: ClassVar[dict] = {
159+
_parameter_constraints = {
160160
"kernel": [None, Kernel],
161161
"alpha": [Interval(Real, 0, None, closed="left"), np.ndarray],
162162
"optimizer": [StrOptions(SUPPORTED_OPTIMIZERS), callable, None],

0 commit comments

Comments
 (0)