Skip to content

Commit 9338558

Browse files
committed
Remove SingleTaskGP type hint
Due to serialization issues: python-attrs/cattrs#531
1 parent 0f3b1ef commit 9338558

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

baybe/surrogates/gaussian_process.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import TYPE_CHECKING, ClassVar, Optional
5+
from typing import TYPE_CHECKING, ClassVar
66

77
from attr import define, field
88

@@ -12,7 +12,6 @@
1212
from baybe.surrogates.base import Surrogate
1313

1414
if TYPE_CHECKING:
15-
from botorch.models import SingleTaskGP
1615
from torch import Tensor
1716

1817

@@ -31,7 +30,9 @@ class GaussianProcessSurrogate(Surrogate):
3130
kernel: Kernel = field(factory=MaternKernel)
3231
"""The kernel used by the Gaussian Process."""
3332

34-
_model: Optional[SingleTaskGP] = field(init=False, default=None)
33+
# TODO: type should be Optional[botorch.models.SingleTaskGP] but is currently
34+
# omitted due to: https://github.com/python-attrs/cattrs/issues/531
35+
_model = field(init=False, default=None)
3536
"""The actual model."""
3637

3738
def _posterior(self, candidates: Tensor) -> tuple[Tensor, Tensor]:

0 commit comments

Comments
 (0)