Rigorous.FunctionCodeUtils

Rigorous.FunctionCodeUtils#

Rigorous.FunctionCodeUtils

Shared helper for auto-detecting the legacy objective function code from a Decomposition’s model type and column parameters.

This avoids duplicating the detection logic in RigorousImplement.py (launch path) and CurrentStateUtils.py (load path). See: biosaxs-dev/molass-library#89

detect_function_code(decomposition)#

Auto-detect the legacy objective function code.

Uses the pore_dist and rt_dist attributes on the decomposition’s SdmColumn to look up the appropriate legacy objective function class.

Parameters:

decomposition (Decomposition) – A quick decomposition whose xr_ccurves[0] carries the model type and (for SDM) the column parameters.

Returns:

A function code string, or None to use the default for the model.

Supported models and their codes:

  • 'egh'None (EGH, default G1100 path)

  • 'sdm''G1100' / 'G1200' / 'G1300' (depends on pore_dist / rt_dist on the SdmColumn)

  • 'edm'None (EDM)

  • 'cedm''G2020' (CEDM — continuous EDM)

  • 'lkm''G1400' (LKM — Lumped Kinetic Model)

  • 'grm''G1500' (GRM — General Rate Model)

Return type:

str or None