Skip to content

Commit

Permalink
fix linting (#454)
Browse files Browse the repository at this point in the history
* fix linting

* please pyright

* remove wrong optional
  • Loading branch information
jduerholt authored Nov 6, 2024
1 parent f94668c commit 1266d71
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bofire/data_models/dataframes/dataframes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 7 additions & 7 deletions bofire/data_models/surrogates/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@


class PiecewiseLinearGPSurrogateHyperconfig(Hyperconfig):
type: Literal[
type: Literal["PiecewiseLinearGPSurrogateHyperconfig"] = ( # type: ignore
"PiecewiseLinearGPSurrogateHyperconfig"
] = "PiecewiseLinearGPSurrogateHyperconfig"
)
inputs: Inputs = Inputs(
features=[
CategoricalInput(
Expand All @@ -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(
Expand Down Expand Up @@ -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]
Expand All @@ -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()
)

Expand Down
2 changes: 1 addition & 1 deletion bofire/utils/torch_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1266d71

Please sign in to comment.