@@ -192,11 +192,6 @@ class Proxy(blosc2.Operand):
192192
193193 This can be used to cache chunks of a regular data container which follows the
194194 :ref:`ProxySource` or :ref:`ProxyNDSource` interfaces.
195-
196- If a persisted proxy is reopened in read mode, lazy cache fills still need to
197- update the local cache. In that case the cache file is reopened internally
198- in append mode on demand when :meth:`fetch`, :meth:`afetch`, or
199- :meth:`__getitem__` needs to populate missing chunks.
200195 """
201196
202197 def __init__ (
@@ -214,9 +209,6 @@ def __init__(
214209 mode: str, optional
215210 "a" means read/write (create if it doesn't exist); "w" means create
216211 (overwrite if it exists). Default is "a".
217- When a persisted proxy is reopened through :func:`blosc2.open` with
218- ``mode="r"``, later lazy cache fills may reopen the cache file
219- internally in append mode so missing chunks can be written locally.
220212 kwargs: dict, optional
221213 Keyword arguments supported:
222214
@@ -274,14 +266,6 @@ def __init__(
274266 for key in vlmeta :
275267 self ._schunk_cache .vlmeta [key ] = vlmeta [key ]
276268
277- def _ensure_writable_cache (self ) -> None :
278- """Reopen a persisted cache writable when lazy fetch needs to fill chunks."""
279- cache_urlpath = getattr (self ._schunk_cache , "urlpath" , None )
280- if cache_urlpath is None or getattr (self ._schunk_cache , "mode" , None ) != "r" :
281- return
282- self ._cache = blosc2 .blosc2_ext .open (cache_urlpath , "a" , 0 )
283- self ._schunk_cache = getattr (self ._cache , "schunk" , self ._cache )
284-
285269 def fetch (self , item : slice | list [slice ] | None = ()) -> blosc2 .NDArray | blosc2 .schunk .SChunk :
286270 """
287271 Get the container used as cache with the requested data updated.
@@ -297,13 +281,6 @@ def fetch(self, item: slice | list[slice] | None = ()) -> blosc2.NDArray | blosc
297281 out: :ref:`NDArray` or :ref:`SChunk`
298282 The local container used to cache the already requested data.
299283
300- Notes
301- -----
302- If the proxy cache was reopened read-only from disk, this method may
303- reopen that cache internally in append mode before filling missing
304- chunks. This preserves the logical read-only open of the proxy source
305- while still allowing the local cache to be populated lazily.
306-
307284 Examples
308285 --------
309286 >>> import numpy as np
@@ -317,7 +294,6 @@ def fetch(self, item: slice | list[slice] | None = ()) -> blosc2.NDArray | blosc
317294 [2 3]
318295 [4 5]]
319296 """
320- self ._ensure_writable_cache ()
321297 if item == ():
322298 # Full realization
323299 for info in self ._schunk_cache .iterchunks_info ():
@@ -353,9 +329,6 @@ async def afetch(self, item: slice | list[slice] | None = ()) -> blosc2.NDArray
353329 -----
354330 This method is only available if the :ref:`ProxySource` or :ref:`ProxyNDSource`
355331 have an async `aget_chunk` method.
356- If the proxy cache was reopened read-only from disk, this method may
357- reopen that cache internally in append mode before filling missing
358- chunks.
359332
360333 Examples
361334 --------
@@ -413,7 +386,6 @@ async def afetch(self, item: slice | list[slice] | None = ()) -> blosc2.NDArray
413386 """
414387 if not callable (getattr (self .src , "aget_chunk" , None )):
415388 raise NotImplementedError ("afetch is only available if the source has an aget_chunk method" )
416- self ._ensure_writable_cache ()
417389 if item == ():
418390 # Full realization
419391 for info in self ._schunk_cache .iterchunks_info ():
0 commit comments