pyfli.io.save_direction#
Turn a save_config dictionary into a ready DataSaver session.
This module belongs to pyfli.io and is part of PyFLI detector importers, file
readers, saving helpers, and processed-data loaders. Public API includes the class
SaveLoadDirector, which centralizes the branching that decides – from a
single config dict – whether a session is saved, loaded, or skipped, and where its
folder lives.
Classes
|
Resolve a |
- class SaveLoadDirector(config=None, **overrides)[source]#
Bases:
objectResolve a
save_configdictionary into aDataSaversession.Instead of scattering
if mode == .../if auto_path ...checks through a script, collect every save/load decision in one dict and hand it to this class.build()returns a writable session (mode='save'), reconnects to an existing one (mode='load'), or returnsNone(mode=None).- Parameters:
config (
dict | None) –User-supplied settings. Any key that is omitted falls back to
DEFAULTS. Recognized keys:mode{‘save’, ‘load’, None}'save'builds a writable session,'load'reconnects to an existing one,Nonedisables saving.auto_pathboolIf
True, the session folder is derived fromDATA_PATH. IfFalse, a manual path is required (see below).DATA_PATHstr | NoneSource data path; required when
auto_path=True(for both save and load).manual_load_pathstr | NoneExact existing session folder to load; used when
mode='load'andauto_path=False.manual_save_root_pathstr | NoneRoot under which the session folder is created; required when
mode='save'andauto_path=False(also accepted as a load root).bin_rintSpatial binning radius; part of the derived
save_suffix.versionintAnalysis version; part of the derived
save_suffix.new_sessionboolForwarded to
DataSaverwhenmode='save'.MODEL_TYPE,free_memorycarried through untouched fordownstream consumers.
**overrides (
Any) – Convenience keyword overrides merged on top ofconfig.
- DEFAULTS: ClassVar[dict[str, Any]] = {'DATA_PATH': None, 'MODEL_TYPE': 'bi-exponential', 'auto_path': True, 'bin_r': 0, 'free_memory': True, 'manual_load_path': None, 'manual_save_root_path': None, 'mode': 'save', 'new_session': True, 'version': 1}#