Skip to content

Commit d2c6f5e

Browse files
Balandatfacebook-github-bot
authored andcommitted
Switch code formatter to ruff (#2582)
Summary: Pull Request resolved: #2582 Use the ruff code formatter. This diff - Changes the Meta-internal config to use ruff. - Updates `pyproject.toml` to use ruff as the code formatter. - Applies the new formatting across the codebase. This does NOT change the code sorting engine (that is still usort). We can update that in a next step. Reviewed By: saitcakmak Differential Revision: D64517061 fbshipit-source-id: bf9a4ed258b9489fc757c810fe8bbff0a5d018c4
1 parent b672626 commit d2c6f5e

File tree

67 files changed

+40
-119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+40
-119
lines changed

botorch/acquisition/cached_cholesky.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
Abstract class for acquisition functions leveraging a cached Cholesky
99
decomposition of the posterior covariance over f(X_baseline).
1010
"""
11+
1112
from __future__ import annotations
1213

1314
import warnings

botorch/acquisition/fixed_feature.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def __init__(
9393
if isinstance(values, Tensor):
9494
new_values = values.detach().clone()
9595
else:
96-
9796
dtype = get_dtype_of_sequence(values)
9897
device = get_device_of_sequence(values)
9998

botorch/acquisition/input_constructors.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,6 @@ def construct_inputs_qKG(
12581258
}
12591259

12601260
if with_current_value:
1261-
12621261
X = _get_dataset_field(training_data, "X", first_only=True)
12631262
_bounds = torch.as_tensor(bounds, dtype=X.dtype, device=X.device)
12641263

@@ -1868,7 +1867,6 @@ def _get_ref_point(
18681867
objective_thresholds: Tensor,
18691868
objective: MCMultiOutputObjective | None = None,
18701869
) -> Tensor:
1871-
18721870
if objective is None:
18731871
ref_point = objective_thresholds
18741872
elif isinstance(objective, RiskMeasureMCObjective):

botorch/acquisition/multi_objective/analytic.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
1717
"""
1818

19-
2019
from __future__ import annotations
2120

2221
from itertools import product

botorch/acquisition/multi_objective/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
Base classes for multi-objective acquisition functions.
99
"""
1010

11-
1211
from __future__ import annotations
1312

1413
from abc import ABC, abstractmethod

botorch/acquisition/multi_objective/joint_entropy_search.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
2022.
1616
1717
"""
18+
1819
from __future__ import annotations
1920

2021
from abc import abstractmethod

botorch/acquisition/multi_objective/logei.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
class qLogExpectedHypervolumeImprovement(
4949
MultiObjectiveMCAcquisitionFunction, SubsetIndexCachingMixin
5050
):
51-
5251
_log: bool = True
5352

5453
def __init__(
@@ -321,7 +320,6 @@ class qLogNoisyExpectedHypervolumeImprovement(
321320
NoisyExpectedHypervolumeMixin,
322321
qLogExpectedHypervolumeImprovement,
323322
):
324-
325323
_log: bool = True
326324

327325
def __init__(

botorch/acquisition/prior_guided.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
Augmenting Acquisition Functions with User Beliefs for Bayesian Optimization.
1616
ICLR 2022.
1717
"""
18+
1819
from __future__ import annotations
1920

2021
from botorch.acquisition.acquisition import AcquisitionFunction

botorch/exceptions/warnings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
r"""
88
Botorch Warnings.
99
"""
10+
1011
import warnings
1112

1213

botorch/generation/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
def _convert_nonlinear_inequality_constraints(
24-
nonlinear_inequality_constraints: list[Callable | tuple[Callable, bool]]
24+
nonlinear_inequality_constraints: list[Callable | tuple[Callable, bool]],
2525
) -> list[tuple[Callable, bool]]:
2626
"""Convert legacy defintions of nonlinear inequality constraints into the new
2727
format. Assumes intra-point constraints.

0 commit comments

Comments
 (0)