Skip to content

Commit 3c25992

Browse files
committed
ENH: Ignore scikit-learn Interval and StrOptions type checking
Ignore `scikit-learn` `Interval` and `StrOptions` type checking errors to prevent `mypy` erroring with the argument that they are abstract classes with the `__str__` abstract attribute. Fixes: ``` src/nifreeze/model/gpr.py:161: error: Cannot instantiate abstract class "Interval" with abstract attribute "__str__" [abstract] src/nifreeze/model/gpr.py:162: error: Cannot instantiate abstract class "StrOptions" with abstract attribute "__str__" [abstract] src/nifreeze/model/gpr.py:163: error: Cannot instantiate abstract class "Interval" with abstract attribute "__str__" [abstract] src/nifreeze/model/gpr.py:166: error: Cannot instantiate abstract class "Interval" with abstract attribute "__str__" [abstract] ```
1 parent 5cb1da4 commit 3c25992

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/nifreeze/model/gpr.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ class DiffusionGPR(GaussianProcessRegressor):
158158

159159
_parameter_constraints = {
160160
"kernel": [None, Kernel],
161-
"alpha": [Interval(Real, 0, None, closed="left"), np.ndarray],
162-
"optimizer": [StrOptions(SUPPORTED_OPTIMIZERS), callable, None],
163-
"n_restarts_optimizer": [Interval(Integral, 0, None, closed="left")],
161+
"alpha": [Interval(Real, 0, None, closed="left"), np.ndarray], # type: ignore
162+
"optimizer": [StrOptions(SUPPORTED_OPTIMIZERS), callable, None], # type: ignore
163+
"n_restarts_optimizer": [Interval(Integral, 0, None, closed="left")], # type: ignore
164164
"copy_X_train": ["boolean"],
165165
"normalize_y": ["boolean"],
166-
"n_targets": [Interval(Integral, 1, None, closed="left"), None],
166+
"n_targets": [Interval(Integral, 1, None, closed="left"), None], # type: ignore
167167
"random_state": ["random_state"],
168168
}
169169

0 commit comments

Comments
 (0)