allensdk.core.pickle_utils module

allensdk.core.pickle_utils.load_and_sanitize_pickle(pickle_path: str | Path) Any[source]

Load the data from a pickle file and pass it through sanitize_pickle_data, so that all bytes in the data are cast to strings.

Parameters:
pickle_path: Union[str, pathlib.Path]

Path to the pickle file

Returns:
pickle_data: Any

The data that was in the pickle file

Notes

Because sanitize_pickle_data alters the data in-place, this method encapsulates loading and sanitizing so that users do not think they have a pre-sanitization copy of the data available.