Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ repos:
- hooks:
- id: ruff
name: ruff-lint
repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.2

- hooks:
- id: ruff-format
name: ruff-format
args: [--check]
repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.2
rev: v0.6.6
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ optional = true
pytest = "^8.0.0"
pytest-cov = "^4.1.0"
coverage = "^7.4.1"
ruff = "0.5.2"
ruff = "0.6.6"
pre-commit = "^3.7.1"


Expand Down
10 changes: 5 additions & 5 deletions tests/test_acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@
from bayes_opt.target_space import TargetSpace


@pytest.fixture()
@pytest.fixture
def target_func():
return lambda x: sum(x)


@pytest.fixture()
@pytest.fixture
def random_state():
return np.random.RandomState()


@pytest.fixture()
@pytest.fixture
def gp(random_state):
return GaussianProcessRegressor(random_state=random_state)


@pytest.fixture()
@pytest.fixture
def target_space(target_func):
return TargetSpace(target_func=target_func, pbounds={"x": (1, 4), "y": (0, 3.0)})


@pytest.fixture()
@pytest.fixture
def constrained_target_space(target_func):
constraint_model = ConstraintModel(fun=lambda params: params["x"] + params["y"], lb=0.0, ub=1.0)
return TargetSpace(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from bayes_opt import BayesianOptimization, ConstraintModel


@pytest.fixture()
@pytest.fixture
def target_function():
return lambda x, y: np.cos(2 * x) * np.cos(y) + np.sin(x)


@pytest.fixture()
@pytest.fixture
def constraint_function():
return lambda x, y: np.cos(x) * np.cos(y) - np.sin(x) * np.sin(y)

Expand Down