Utils Helper

GitHub Link to Code.

Helper utilities for mdxplain utils.

Load And Save Helper

Helper class for saving and loading objects with memmap metadata.

class mdxplain.utils.helper.load_and_save_helper.LoadAndSaveHelper

Helper class for save/load operations with memmap support.

static save_object(obj: Any, save_path: str) None

Save an object while preserving memmap metadata.

Parameters

objAny

Object to save.

save_pathstr

Path to the output pickle file.

Returns

None

static load_object(obj: Any, load_path: str) None

Load data into an object while restoring memmaps.

Parameters

objAny

Target object to populate.

load_pathstr

Path to the input pickle file.

Returns

None

static peek_cache_dir(load_path: str) str | None

Read and return cache_dir from a saved payload when available.

Parameters

load_pathstr

Path to the saved pickle payload.

Returns

str or None

Saved cache_dir value if present and non-empty, otherwise None.