config.wtf module

Test the wtf (what to fit) key of the config file.

Todo

Specific test for every optimisation method? For now, just trust the user.

IMPLEMENTED_OBJECTIVE_PRESETS = ('EnergyPhaseMismatch', 'simple_ADS', 'EnergyMismatch', 'rephased_ADS', 'EnergySyncPhaseMismatch', 'sync_phase_as_objective_ADS', 'experimental')
IMPLEMENTED_OPTIMISATION_ALGORITHMS = ('least_squares', 'least_squares_penalty', 'nsga', 'downhill_simplex', 'downhill_simplex_penalty', 'nelder_mead', 'differential_evolution', 'explorator', 'experimental')
IMPLEMENTED_STRATEGIES = ('k out of n', 'manual', 'l neighboring lattices', 'global', 'global downstream')
_test_cavity_selection(tie_politics: str, shift: int) None

Test the keywords that alter the selection of compensating cavities.

_test_global(**wtf_kw) None

Test if global compensation will work.

_test_global_downstream(**wtf_kw) None

Test if global compensation with only downstream cavities will work.

_test_k_out_of_n(k: int, **wtf_kw) None

Test that the k out of n method can work.

_test_l_neighboring_lattices(l: int, min_number_of_cavities_in_lattice: int = 1, **wtf_kw) None
_test_manual(failed: list[list[list[int]]], compensating_manual: list[list[list[int]]], **wtf_kw) None

Test that the manual method can work.

test(id_nature: str, strategy: str, objective_preset: str, optimisation_algorithm: str, tie_politics: str = 'upstream first', idx: str = '', shift: int = 0, **wtf_kw) None

Test the wtf .toml entries.