Skip to content

Commit

Permalink
* Cache result of FSStore._fsspec_installed
Browse files Browse the repository at this point in the history
Prevent runtime-overhead in doing this check multiple times
  • Loading branch information
ph03 committed Nov 28, 2023
1 parent 039d3ba commit e2cbc23
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions zarr/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import zipfile
from collections import OrderedDict
from collections.abc import MutableMapping
from functools import cache
from os import scandir
from pickle import PicklingError
from threading import Lock, RLock
Expand Down Expand Up @@ -1540,6 +1541,7 @@ def clear(self):
self.map.clear()

@classmethod
@cache
def _fsspec_installed(cls):
"""Returns true if fsspec is installed"""
import importlib.util
Expand Down

0 comments on commit e2cbc23

Please sign in to comment.