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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ result = optimizer.optimize()
- `tolerance_x` (float, optional): Minimum distance between points
- `seed` (int, optional): Random seed for reproducibility
- `verbose` (bool, default=False): Print progress information
- `max_surrogate_points` (int, optional): Maximum number of points for surrogate fitting (default: None, use all points)
- `max_surrogate_points` (int, optional): Maximum number of points for surrogate fitting (default: 30; set to None to use all points)
- `selection_method` (str, default='distant'): Point selection method ('distant' or 'best')

**Methods:**
Expand Down

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/spotoptim/SpotOptim.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class SpotOptimConfig:
verbose (bool): Whether to print verbose output.
warnings_filter (Literal["default", "error", "ignore"]): Filter for warnings.
n_infill_points (int): Number of infill points.
max_surrogate_points (Optional[Union[int, List[int]]]): Maximum number of surrogate points.
max_surrogate_points (Optional[Union[int, List[int]]]): Maximum number of surrogate points. Defaults to 30.
selection_method (str): Method for selecting infill points.
acquisition_failure_strategy (str): Strategy for handling acquisition function failures.
penalty (bool): Whether to use penalty.
Expand Down Expand Up @@ -116,7 +116,7 @@ class SpotOptimConfig:
verbose=False,
warnings_filter="ignore",
n_infill_points=1,
max_surrogate_points=None,
max_surrogate_points=30,
selection_method="distant",
acquisition_failure_strategy="random",
penalty=False,
Expand Down Expand Up @@ -161,7 +161,7 @@ class SpotOptimConfig:
verbose: bool = False
warnings_filter: Literal["default", "error", "ignore"] = "ignore"
n_infill_points: int = 1
max_surrogate_points: Optional[Union[int, List[int]]] = None
max_surrogate_points: Optional[Union[int, List[int]]] = 30
selection_method: str = "distant"
acquisition_failure_strategy: str = "random"
penalty: bool = False
Expand Down Expand Up @@ -351,7 +351,7 @@ class SpotOptim(BaseEstimator):
max_surrogate_points (int, optional):
Maximum number of points to use for surrogate model fitting.
If None, all points are used. If the number of evaluated points exceeds this limit,
a subset is selected using the selection method. Defaults to None.
a subset is selected using the selection method. Defaults to 30.
selection_method (str, optional):
Method for selecting points when max_surrogate_points is exceeded.
Options: 'distant' (Select points that are distant from each other via K-means clustering) or
Expand Down Expand Up @@ -733,7 +733,7 @@ def __init__(
verbose: bool = False,
warnings_filter: Literal["default", "error", "ignore"] = "ignore",
n_infill_points: int = 1,
max_surrogate_points: Optional[Union[int, List[int]]] = None,
max_surrogate_points: Optional[Union[int, List[int]]] = 30,
selection_method: str = "distant",
acquisition_failure_strategy: str = "random",
penalty: bool = False,
Expand Down
7 changes: 7 additions & 0 deletions tests/test_tricands.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class TestTricands:
"""Test suite for tricands module."""

def setup_method(self):
# Close figures leaked by earlier tests on the same xdist worker:
# test_visualization_2d mocks plt.figure, so tricands draws into
# whatever Axes gca() finds — a leaked 3D Axes makes scatter fail
# with "s must be a scalar, or float array-like ...".
import matplotlib.pyplot as plt

plt.close("all")
# Create invalid (too few points) X
self.X_small = np.array([[0.1, 0.1]])
# Create valid 2D X
Expand Down
Loading