diff --git a/tiled/adapters/hdf5.py b/tiled/adapters/hdf5.py index 544edc765..cd5489594 100644 --- a/tiled/adapters/hdf5.py +++ b/tiled/adapters/hdf5.py @@ -115,7 +115,7 @@ def from_uri( access_policy=None, ): filepath = path_from_uri(data_uri) - cache_key = (cls.__module__, cls.__name__, filepath) + cache_key = (h5py.File, filepath, "r", swmr, libver) file = with_resource_cache( cache_key, h5py.File, filepath, "r", swmr=swmr, libver=libver ) diff --git a/tiled/adapters/tiff.py b/tiled/adapters/tiff.py index 75364e4cf..338548c5b 100644 --- a/tiled/adapters/tiff.py +++ b/tiled/adapters/tiff.py @@ -32,7 +32,7 @@ def __init__( if not isinstance(data_uri, str): raise Exception filepath = path_from_uri(data_uri) - cache_key = (type(self).__module__, type(self).__qualname__, filepath) + cache_key = (tifffile.TiffFile, filepath) self._file = with_resource_cache(cache_key, tifffile.TiffFile, filepath) self.specs = specs or [] self._provided_metadata = metadata or {}