Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-friday committed Jul 25, 2024
1 parent 17e1cd8 commit 8b3e868
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions bayes_opt/bayesian_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ class Constraint(Protocol):
see more: scipy.optimize.NonlinearConstraint
"""

fun: Callable[..., Any]
lb: Any
ub: Any

def fun(self, x: Any) -> Any: # noqa: D102
...

Float = np.floating[Any]


Expand Down
4 changes: 2 additions & 2 deletions bayes_opt/target_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def mask(self) -> NDArray[np.bool_]:

return mask

def params_to_array(self, params: dict[str, NDArray[Float]]) -> NDArray[Float]:
def params_to_array(self, params: dict[str, float | NDArray[Float]]) -> NDArray[Float]:
"""Convert a dict representation of parameters into an array version.
Parameters
Expand All @@ -251,7 +251,7 @@ def params_to_array(self, params: dict[str, NDArray[Float]]) -> NDArray[Float]:
raise ValueError(error_msg)
return np.asarray([params[key] for key in self.keys])

def array_to_params(self, x: NDArray[Float]) -> dict[str, NDArray[Float]]:
def array_to_params(self, x: NDArray[Float]) -> dict[str, float | NDArray[Float]]:
"""Convert an array representation of parameters into a dict version.
Parameters
Expand Down

0 comments on commit 8b3e868

Please sign in to comment.