(self, x: Any)
| 410 | return mask |
| 411 | |
| 412 | def _as_array(self, x: Any) -> NDArray[Float]: |
| 413 | try: |
| 414 | x = np.asarray(x, dtype=float) |
| 415 | except TypeError: |
| 416 | x = self.params_to_array(x) |
| 417 | |
| 418 | x = x.ravel() |
| 419 | if x.size != self.dim: |
| 420 | msg = f"Size of array ({len(x)}) is different than the expected number of ({self.dim})." |
| 421 | raise ValueError(msg) |
| 422 | return x |
| 423 | |
| 424 | def register( |
| 425 | self, params: ParamsType, target: float, constraint_value: float | NDArray[Float] | None = None |
no test coverage detected