Testing#
Testing module for molass library.
- show_or_save(test_name=None, fig=None)#
Convenience function to show or save plot.
- is_interactive()#
Returns True if plots should be shown interactively.
- control_matplotlib_plot(test_func)#
Decorator for test functions with matplotlib plots.
- suppress_numerical_warnings(test_func)#
Decorator to suppress numerical computation warnings.
- configure_for_test(test_func)#
Deprecated: Use control_matplotlib_plot instead.
- draw_scores_headless(sample_folder, num_peaks=3, use_library_rg=True, poresize=76.0, poresize_bounds=(71.0, 81.0))#
Headless equivalent of PeakEditor.draw_scores().
- Replicates the optimizer setup in PeakEditor exactly:
load_data + prepare (get_lrf_source)
compute rg_curve (legacy or library path)
inject rg_curve into dsets
construct_optimizer + compute_init_params
prepare_for_optimization + objective_func(init_params)
- Parameters:
sample_folder (str) – Path to raw data folder (e.g. SAMPLE1).
num_peaks (int) – Number of protein components (matches PeakEditor “Number of Components” spinbox). Default: 3.
use_library_rg (bool) –
- True (default) → library ssd.get_rg_curve() with w(j)=q·Ĩ weighting
(current dev path, recommended).
- False → legacy RgCurve starting at first-peak frame
(matches installed 1.6.5 behavior).
poresize (float) – Column pore size in Å. Default: 76.0 (Superdex 75).
poresize_bounds (tuple) – (lower, upper) bounds for pore size. Default: (71.0, 81.0).
- Returns:
molass_legacy_path(str),n_params(int),init_params(np.ndarray),fv(float),sv(float),score_names(list[str]),scores(np.ndarray)- Return type:
dict with keys
Example
>>> from molass.Testing.HeadlessPeakEditor import draw_scores_headless >>> from molass_data import SAMPLE1 >>> result = draw_scores_headless(SAMPLE1) >>> print(f"PeakEditor SV = {result['sv']:.2f}")