Skip to content

Commit b7ed4b2

Browse files
committed
style: Apply Black formatting to utils.py
- Ran full QA suite (Black, Isort, Flake8, Mypy). - Fixed formatting issues in utils.py introduced by type fixes. - Verified all quality checks pass.
1 parent 8408174 commit b7ed4b2

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

optimization_benchmarks/utils.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,7 @@ def get_bounds_center(bounds: List[Tuple[float, float]]) -> np.ndarray:
303303
return (bounds[:, 0] + bounds[:, 1]) / 2
304304

305305

306-
def generate_grid_points(
307-
bounds: List[Tuple[float, float]], points_per_dim: int = 10
308-
) -> np.ndarray:
306+
def generate_grid_points(bounds: List[Tuple[float, float]], points_per_dim: int = 10) -> np.ndarray:
309307
"""
310308
Generate a grid of points within bounds.
311309
@@ -331,9 +329,7 @@ def generate_grid_points(
331329
dim = len(bounds)
332330

333331
# Create 1D grids for each dimension
334-
grids_1d = [
335-
np.linspace(bounds[i, 0], bounds[i, 1], points_per_dim) for i in range(dim)
336-
]
332+
grids_1d = [np.linspace(bounds[i, 0], bounds[i, 1], points_per_dim) for i in range(dim)]
337333

338334
# Create meshgrid
339335
meshes = np.meshgrid(*grids_1d, indexing="ij")
@@ -371,9 +367,7 @@ def calculate_distance_to_optimum(
371367

372368
if isinstance(optimal_point, (list, tuple)):
373369
# Handle list of optima
374-
distances = [
375-
float(np.linalg.norm(point - np.asarray(opt))) for opt in optimal_point
376-
]
370+
distances = [float(np.linalg.norm(point - np.asarray(opt))) for opt in optimal_point]
377371
return min(distances)
378372
else:
379373
# Handle single optimum

0 commit comments

Comments
 (0)