autoemx.utils.legacy.legacy_backfill module
Legacy compatibility helpers for reconstructing spectra pointer files from Data.csv.
- autoemx.utils.legacy.legacy_backfill.backfill_spectra_from_data_csv(data_csv_path: str, resolve_or_create_pointer: Callable[[...], str], *, spectrum_key: str, spectrum_id_key: str, live_time_key: str, real_time_key: str, background_key: str | None = None, write_background_pointer: Callable[[...], str | None] | None = None) int[source]
Reconstruct spectra pointer files from legacy Data.csv content.
The callback must accept: spectrum_id, spectrum_vals, live_time, real_time. Optionally, background arrays can be persisted via write_background_pointer.
- autoemx.utils.legacy.legacy_backfill.load_ledger_configs_from_legacy_json(sample_result_dir: str) object | None[source]
Try to reconstruct a LedgerConfigs from a legacy config JSON in the sample directory.
Checks for
config.jsonfirst, thenComp_analysis_configs.json. Returns aLedgerConfigsinstance on success, orNoneif neither file is found / parseable.Imports are deferred to avoid circular dependencies.