Coverage for python/lsst/daf/butler/registry/queries/_query_backend.py: 75%

16 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2022-09-30 02:18 -0700

1# This file is part of daf_butler. 

2# 

3# Developed for the LSST Data Management System. 

4# This product includes software developed by the LSST Project 

5# (http://www.lsst.org). 

6# See the COPYRIGHT file at the top-level directory of this distribution 

7# for details of code ownership. 

8# 

9# This program is free software: you can redistribute it and/or modify 

10# it under the terms of the GNU General Public License as published by 

11# the Free Software Foundation, either version 3 of the License, or 

12# (at your option) any later version. 

13# 

14# This program is distributed in the hope that it will be useful, 

15# but WITHOUT ANY WARRANTY; without even the implied warranty of 

16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

17# GNU General Public License for more details. 

18# 

19# You should have received a copy of the GNU General Public License 

20# along with this program. If not, see <http://www.gnu.org/licenses/>. 

21from __future__ import annotations 

22 

23__all__ = ("QueryBackend",) 

24 

25from abc import ABC, abstractmethod 

26from typing import TYPE_CHECKING 

27 

28if TYPE_CHECKING: 28 ↛ 29line 28 didn't jump to line 29, because the condition on line 28 was never true

29 from ...core import DimensionUniverse 

30 from ..managers import RegistryManagerInstances 

31 

32 

33class QueryBackend(ABC): 

34 """An interface for constructing and evaluating the 

35 `~lsst.daf.relation.Relation` objects that comprise registry queries. 

36 

37 This ABC is expected to have a concrete subclass for each concrete registry 

38 type. 

39 """ 

40 

41 @property 

42 @abstractmethod 

43 def managers(self) -> RegistryManagerInstances: 

44 """A struct containing the manager instances that back a SQL registry. 

45 

46 Notes 

47 ----- 

48 This property is a temporary interface that will be removed in favor of 

49 new methods once the manager and storage classes have been integrated 

50 with `~lsst.daf.relation.Relation`. 

51 """ 

52 raise NotImplementedError() 

53 

54 @property 

55 @abstractmethod 

56 def universe(self) -> DimensionUniverse: 

57 """Definition of all dimensions and dimension elements for this 

58 registry. 

59 """ 

60 raise NotImplementedError()