diff --git a/bofire/data_models/dataframes/dataframes.py b/bofire/data_models/dataframes/dataframes.py index aefb0f4d..255402a2 100644 --- a/bofire/data_models/dataframes/dataframes.py +++ b/bofire/data_models/dataframes/dataframes.py @@ -36,7 +36,7 @@ class ExperimentOutputValue(OutputValue): class CandidateOutputValue(OutputValue): - value: Optional[Value] = Field(description="The predicted value.") + value: Value = Field(description="The predicted value.") standard_deviation: float objective_value: float diff --git a/bofire/data_models/surrogates/shape.py b/bofire/data_models/surrogates/shape.py index 5ce9d64f..b6cf27ac 100644 --- a/bofire/data_models/surrogates/shape.py +++ b/bofire/data_models/surrogates/shape.py @@ -31,9 +31,9 @@ class PiecewiseLinearGPSurrogateHyperconfig(Hyperconfig): - type: Literal[ + type: Literal["PiecewiseLinearGPSurrogateHyperconfig"] = ( # type: ignore "PiecewiseLinearGPSurrogateHyperconfig" - ] = "PiecewiseLinearGPSurrogateHyperconfig" + ) inputs: Inputs = Inputs( features=[ CategoricalInput( @@ -44,9 +44,9 @@ class PiecewiseLinearGPSurrogateHyperconfig(Hyperconfig): ] ) target_metric: RegressionMetricsEnum = RegressionMetricsEnum.MAE - hyperstrategy: Literal[ - "FactorialStrategy", "SoboStrategy", "RandomStrategy" - ] = "FactorialStrategy" + hyperstrategy: Literal["FactorialStrategy", "SoboStrategy", "RandomStrategy"] = ( + "FactorialStrategy" + ) @staticmethod def _update_hyperparameters( @@ -112,7 +112,7 @@ class PiecewiseLinearGPSurrogate(TrainableBotorchSurrogate): hyperconfig: The hyperconfig that is used for training the GP. """ - type: Literal["PiecewiseLinearGPSurrogate"] = "PiecewiseLinearGPSurrogate" + type: Literal["PiecewiseLinearGPSurrogate"] = "PiecewiseLinearGPSurrogate" # type: ignore interpolation_range: Bounds n_interpolation_points: PositiveInt = 1000 x_keys: list[str] @@ -122,7 +122,7 @@ class PiecewiseLinearGPSurrogate(TrainableBotorchSurrogate): append_x: Annotated[List[float], AfterValidator(validate_monotonically_increasing)] prepend_y: Annotated[List[float], AfterValidator(validate_monotonically_increasing)] append_y: Annotated[List[float], AfterValidator(validate_monotonically_increasing)] - hyperconfig: Optional[PiecewiseLinearGPSurrogateHyperconfig] = Field( + hyperconfig: Optional[PiecewiseLinearGPSurrogateHyperconfig] = Field( # type: ignore default_factory=lambda: PiecewiseLinearGPSurrogateHyperconfig() ) diff --git a/bofire/utils/torch_tools.py b/bofire/utils/torch_tools.py index d6a9269b..e87e19b4 100644 --- a/bofire/utils/torch_tools.py +++ b/bofire/utils/torch_tools.py @@ -638,7 +638,7 @@ def generator(n: int, q: int, seed: int) -> Tensor: return generator -@torch.jit.script +@torch.jit.script # type: ignore def interp1d( x: torch.Tensor, y: torch.Tensor,