diff --git a/xbout/load.py b/xbout/load.py index 6a8effd2..82e0bcd6 100644 --- a/xbout/load.py +++ b/xbout/load.py @@ -738,15 +738,7 @@ def _expand_filepaths(datapath): if not filepaths: raise IOError("No datafiles found matching datapath={}".format(datapath)) - if len(filepaths) > 128: - warn( - "Trying to open a large number of files - setting xarray's" - " `file_cache_maxsize` global option to {} to accommodate this. " - "Recommend using `xr.set_options(file_cache_maxsize=NUM)`" - " to explicitly set this to a large enough value.".format( - str(len(filepaths)) - ) - ) + if len(filepaths) > xr.get_options().get("file_cache_maxsize", 128): xr.set_options(file_cache_maxsize=len(filepaths)) return filepaths, filetype