Coverage for python/lsst/resources/mem.py: 100%
11 statements
« prev ^ index » next coverage.py v7.11.0, created at 2025-11-19 01:29 -0800
« prev ^ index » next coverage.py v7.11.0, created at 2025-11-19 01:29 -0800
1# This file is part of lsst-resources.
2#
3# Developed for the LSST Data Management System.
4# This product includes software developed by the LSST Project
5# (https://www.lsst.org).
6# See the COPYRIGHT file at the top-level directory of this distribution
7# for details of code ownership.
8#
9# Use of this source code is governed by a 3-clause BSD-style
10# license that can be found in the LICENSE file.
12from __future__ import annotations
14__all__ = ("InMemoryResourcePath",)
16import contextlib
17from collections.abc import Iterator
19from ._resourcePath import ResourcePath
22class InMemoryResourcePath(ResourcePath):
23 """Internal in-memory datastore URI (`mem://`).
25 Not used for any real purpose other than indicating that the dataset
26 is in memory.
27 """
29 def exists(self) -> bool:
30 """Test for existence and always return False."""
31 return True
33 @contextlib.contextmanager
34 def _as_local(
35 self, multithreaded: bool = True, tmpdir: ResourcePath | None = None
36 ) -> Iterator[ResourcePath]:
37 raise RuntimeError(f"Do not know how to retrieve data for URI '{self}'")