gemseo / utils / testing

Show inherited members

opt_lib_test_base module

Common tools for testing opt libraries.

class gemseo.utils.testing.opt_lib_test_base.OptLibraryTestBase[source]

Bases: object

Main testing class.

create_test(problem, opt_library, algo_name, options)[source]
Parameters:
  • problem – param opt_library:

  • algo_name – param options:

  • opt_library

  • options

static generate_error_test(opt_lib_name, algo_name, **options)[source]
Parameters:
  • opt_lib_name – param algo_name:

  • algo_name

  • **options

static generate_one_test(opt_lib_name, algo_name, **options)[source]
Parameters:
  • opt_lib_name – param algo_name:

  • algo_name

  • **options

static generate_one_test_unconstrained(opt_lib_name, algo_name, **options)[source]
Parameters:
  • opt_lib_name – param algo_name:

  • algo_name

  • **options

generate_test(opt_lib_name, get_options=None, get_problem_options=None)[source]

Generates the tests for an opt library Filters algorithms adapted to the benchmark problems.

Parameters:
  • opt_lib_name – name of the library

  • get_options – Default value = None)

Returns:

list of test methods to be attached to a unitest class

get_pb_instance(pb_name, pb_options=None)[source]
Parameters:
  • pb_name – the name of the optimization problem

  • pb_options – the options to be passed to the optimization problem

static norm(x)[source]
Parameters:

x

static relative_norm(x, x_ref)[source]
Parameters:
  • x – param x_ref:

  • x_ref

static run_and_test_problem(problem, opt_library, algo_name, **options)[source]
Parameters:
  • problem – param opt_library:

  • algo_name – param **options:

  • opt_library

  • **options