nicetoolbox.evaluation.data.loaders.PredictionLoader

class nicetoolbox.evaluation.data.loaders.PredictionLoader[source]

Bases: object

Lazily loads a single prediction data slice from a large NPZ file. Caches open file handles for efficiency.

Methods

close_files

Clears the cache of loaded arrays.

load_full_array

Loads a full data array from an NPZ file using bounded cache.

close_files()[source]

Clears the cache of loaded arrays.

load_full_array(path: Path, data_key: str) ndarray[source]

Loads a full data array from an NPZ file using bounded cache. :param path: Path to the .npz file. :param data_key: The key for the data array within the npz file (e.g., ‘2d’, ‘3d’).

Returns:

The full numpy array.