@@ -190,7 +190,8 @@ def __init__(self,
190190 interface_type : str = None ,
191191 max_threads : int = 100 ,
192192 storage_options : dict = None ,
193- active_storage_url : str = None ) -> None :
193+ active_storage_url : str = None ,
194+ option_disable_chunk_cache : bool = False ) -> None :
194195 """
195196 Instantiate with a NetCDF4 dataset URI and the variable of interest within that file.
196197 (We need the variable, because we need variable specific metadata from within that
@@ -199,6 +200,7 @@ def __init__(self,
199200
200201 :param storage_options: s3fs.S3FileSystem options
201202 :param active_storage_url: Reductionist server URL
203+ :param option_disable_chunk_cache: flag to disable chunk caching
202204 """
203205 self .ds = None
204206 input_variable = False
@@ -256,6 +258,9 @@ def __init__(self,
256258 self .storage_options = storage_options
257259 self .active_storage_url = active_storage_url
258260
261+ # turn off chunk caching
262+ self .option_disable_chunk_cache = option_disable_chunk_cache
263+
259264 # basic check on file
260265 if not input_variable :
261266 if not os .path .isfile (self .uri ) and not self .interface_type :
@@ -661,6 +666,9 @@ def _process_chunk(self,
661666 # Axes over which to apply a reduction
662667 axis = self ._axis
663668
669+ # turn off chunk caching
670+ chunk_caching = self .option_disable_chunk_cache
671+
664672 if self .interface_type == 's3' and self ._version == 1 :
665673 tmp , count = reduce_opens3_chunk (ds ._fh ,
666674 offset ,
@@ -703,7 +711,8 @@ def _process_chunk(self,
703711 ds ._order ,
704712 chunk_selection ,
705713 axis ,
706- operation = self ._method )
714+ operation = self ._method ,
715+ option_disable_chunk_cache = chunk_caching ,)
707716 else :
708717 if self .storage_options .get ("anon" , None ) is True :
709718 bucket = os .path .dirname (parsed_url .path )
@@ -723,7 +732,8 @@ def _process_chunk(self,
723732 ds ._order ,
724733 chunk_selection ,
725734 axis ,
726- operation = self ._method )
735+ operation = self ._method ,
736+ option_disable_chunk_cache = chunk_caching ,)
727737 elif self .interface_type == "https" and self ._version == 2 :
728738 tmp , count = reductionist .reduce_chunk (session ,
729739 self .active_storage_url ,
@@ -739,7 +749,8 @@ def _process_chunk(self,
739749 chunk_selection ,
740750 axis ,
741751 operation = self ._method ,
742- interface_type = "https" )
752+ interface_type = "https" ,
753+ option_disable_chunk_cache = chunk_caching ,)
743754
744755 elif self .interface_type == 'ActivePosix' and self .version == 2 :
745756 # This is where the DDN Fuse and Infinia wrappers go
0 commit comments