File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 11# SPDX-License-Identifier: BSD-3-Clause
22# Copyright (c) 2025 Scipp contributors (https://github.com/scipp)
33
4+ from functools import cache
45from pathlib import Path
56
67
@@ -31,9 +32,19 @@ def __contains__(self, key: str) -> bool:
3132 """Return True if the key is in the registry."""
3233 return key in self ._registry .registry
3334
35+ @cache # noqa: B019
3436 def get_path (self , name : str , unzip : bool = False ) -> Path :
35- """
36- Get the path to a file in the registry.
37+ """Get the path to a file in the registry.
38+
39+ Downloads the file if necessary.
40+
41+ Note that return values of this method are cached to avoid recomputing
42+ potentially expensive checksums.
43+ This usually means that the ``Registry`` object itself gets stored until the
44+ Python interpreter shuts down.
45+ However, registries are small and do not own resources.
46+ It is anyway expected that the registry objects are stored at
47+ module scope and live until program exit.
3748
3849 Parameters
3950 ----------
You can’t perform that action at this time.
0 commit comments