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)

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: float | None = None
gfun: Callable[[ndarray], ndarray]
iindex: tuple[int, ...]
objf: Callable[[ndarray], ndarray]
xmin: tuple[float, ...] | None = None
tests.gosac_benchmark.fRana(x: ndarray) ndarray
tests.gosac_benchmark.fWeierstrass(x: ndarray) ndarray

tests.test_gosac_bench module

tests.test_gosac_bench.test_benchmark(problem: Problem) None

tests.test_optimize module

Test the optimization routines.

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_sampler(boundx, strategy: SamplingStrategy)
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]
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_cptv(func: str) None

Module contents