tests package

Subpackages

Submodules

tests.gosac_benchmark module

class tests.gosac_benchmark.Problem(objf: Callable[[ndarray], ndarray], gfun: Callable[[ndarray], ndarray], iindex: tuple[int, ...], bounds: tuple[tuple[float, float], ...], xmin: tuple[float, ...] | None = None, fmin: float | None = None) None

Bases: object

A class to represent a problem for the GOSAC benchmark.

Attributes

objfCallable[[np.ndarray], np.ndarray]

The objective function. Receives a 2D array of shape (n, dim) and returns a 1D array of shape (n,).

gfunCallable[[np.ndarray], np.ndarray]

The constraint function. Receives a 2D array of shape (n, dim) and returns a 2D array of shape (n, gdim).

iindextuple[int, …]

The indices of the integer variables.

boundstuple[tuple[float, float], …]

The bounds of the variables.

xmintuple[float, …] | None

The known minimum of the objective function. If None, the minimum is unknown.

fminfloat | None

The value of the objective function at the known minimum. If None, the minimum is unknown.

bounds: tuple[tuple[float, float], ...]
fmin: Optional[float] = None
gfun: Callable[[ndarray], ndarray]
iindex: tuple[int, ...]
objf: Callable[[ndarray], ndarray]
xmin: Optional[tuple[float, ...]] = None
tests.gosac_benchmark.fRana(x: ndarray) ndarray
Return type:

ndarray

tests.gosac_benchmark.fWeierstrass(x: ndarray) ndarray
Return type:

ndarray

tests.test_acquisition module

Test the acquisition functions.

tests.test_acquisition.test_expected_improvement()

tests.test_gosac_bench module

tests.test_gosac_bench.test_benchmark(problem: Problem) None
Return type:

None

tests.test_gp module

Test the Gaussian Process model and helpers.

tests.test_gp.test_xtrain(n: int, copy_X_train: bool)

tests.test_optimize module

Test the optimization routines.

tests.test_optimize.test_batched_sampling()
tests.test_optimize.test_callback(minimize)
tests.test_optimize.test_multiple_calls(minimize)

tests.test_rbf module

Test the RBF model.

class tests.test_rbf.TestRbfModel

Bases: object

rbf_model = <blackboxopt.rbf.RbfModel object>
test_dim()
test_phi()
tests.test_rbf.test_median_lpf()

tests.test_sampling module

Test the sampling functions.

tests.test_sampling.test_iindex_mitchel91_sampler(boundx, n0: int)
tests.test_sampling.test_iindex_sampler(boundx, strategy: SamplingStrategy)
tests.test_sampling.test_mitchel91_sampler(dim: int, n0: int)
tests.test_sampling.test_normal_sampler(dim: int, strategy: SamplingStrategy)
tests.test_sampling.test_sampler(dim: int, strategy: SamplingStrategy)
tests.test_sampling.test_slhd(boundx)

tests.test_vlse_bench module

Test functions from the VLSE benchmark.

tests.test_vlse_bench.run_optimizer(func: str, nArgs: int, maxEval: int, algo, nRuns: int, *, bounds=None, disp: bool = False) list[OptimizeResult]
Return type:

list[OptimizeResult]

tests.test_vlse_bench.test_API(func: str)

Test function func can be called from the R API.

Parameters

funcstr

Name of the function to be tested.

tests.test_vlse_bench.test_bayesianopt(func: str) None
Return type:

None

tests.test_vlse_bench.test_cptv(func: str) None
Return type:

None

Module contents