Closed frasercl closed 10 months ago
I saw something in the cache code that gave me this idea: cache keys are strings of the form "volume_id/zarr/chunk/subpath" and you can still do things like removeAllWithPrefix by searching for all keys with a given prefix, in order to remove only chunks associated with a volume_id.
Use Case
VolumeCache
was originally written to store arrays representing arbitrary volume subsets, but is now used to represent a fixed set of zarr chunks. It no longer needs to know the dimensions of the volume it contains, or even that its entries represent volume subsets at all.Solution
Design some changes to make
VolumeCache
more generic, implement them, update relevant tests, and use the new API in loaders.There should be no noticeable difference in behavior after this change.