Skip to content

nabu.processing.diskcache

source module nabu.processing.diskcache

Classes

  • DiskLRUBuffer A disk-baked "cache". It was written for helical tomography reconstruction pipeline, but it can have other uses.

Functions

  • copy_array Utility function that works the same on numpy and cupy arrays. It's here because cupy arrays need something like cupy_array.set(numpy_array) while numpy arrays need something like numpy_array[:] = other_array[:]

source copy_array(dst, src)

Utility function that works the same on numpy and cupy arrays. It's here because cupy arrays need something like cupy_array.set(numpy_array) while numpy arrays need something like numpy_array[:] = other_array[:]

source class DiskLRUBuffer(buffer, eviction_dir, initial_keys, file_prefix=None, load_existing=True)

A disk-baked "cache". It was written for helical tomography reconstruction pipeline, but it can have other uses.

Example

We reconstruct images from z = z1 to z = z2. The range [z1, z2] is sometimes too big to have a big buffer hosting all the reconstructions. We use reconstructed_slices[z] which possibly fetch data to disk.

Methods

source method DiskLRUBuffer.keys()

source method DiskLRUBuffer.save()