bayesian-optimization 2.0.0__tar.gz → 2.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bayesian-optimization
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: Bayesian Optimization package
5
5
  License: MIT
6
6
  Author: Fernando Nogueira
@@ -102,6 +102,8 @@ class TargetSpace:
102
102
  else:
103
103
  self._constraint_values = np.empty(shape=(0, constraint.lb.size), dtype=float)
104
104
 
105
+ self._sorting_warning_already_shown = False # TODO: remove in future version
106
+
105
107
  def __contains__(self, x: NDArray[Float]) -> bool:
106
108
  """Check if this parameter has already been registered.
107
109
 
@@ -330,6 +332,17 @@ class TargetSpace:
330
332
  >>> len(space)
331
333
  1
332
334
  """
335
+ # TODO: remove in future version
336
+ if isinstance(params, np.ndarray) and not self._sorting_warning_already_shown:
337
+ msg = (
338
+ "You're attempting to register an np.ndarray. Currently, the optimizer internally sorts"
339
+ " parameters by key and expects any registered array to respect this order. In future"
340
+ " versions this behaviour will change and the order as given by the pbounds dictionary"
341
+ " will be used. If you wish to retain sorted parameters, please manually sort your pbounds"
342
+ " dictionary before constructing the optimizer."
343
+ )
344
+ warn(msg, stacklevel=1)
345
+ self._sorting_warning_already_shown = True
333
346
  x = self._as_array(params)
334
347
  if x in self:
335
348
  if self._allow_duplicate_points:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "bayesian-optimization"
3
- version = "2.0.0"
3
+ version = "2.0.1"
4
4
  description = "Bayesian Optimization package"
5
5
  authors = ["Fernando Nogueira"]
6
6
  license = "MIT"