Coverage for python/lsst/pipe/base/pipeline_graph/_exceptions.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.5.1, created at 2024-05-07 02:48 -0700

1# This file is part of pipe_base. 

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 software is dual licensed under the GNU General Public License and also 

10# under a 3-clause BSD license. Recipients may choose which of these licenses 

11# to use; please see the files gpl-3.0.txt and/or bsd_license.txt, 

12# respectively. If you choose the GPL option then the following text applies 

13# (but note that there is still no warranty even if you opt for BSD instead): 

14# 

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

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

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

18# (at your option) any later version. 

19# 

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

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

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

23# GNU General Public License for more details. 

24# 

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

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

27from __future__ import annotations 

28 

29__all__ = ( 

30 "ConnectionTypeConsistencyError", 

31 "DuplicateOutputError", 

32 "IncompatibleDatasetTypeError", 

33 "PipelineGraphExceptionSafetyError", 

34 "PipelineDataCycleError", 

35 "PipelineGraphError", 

36 "PipelineGraphReadError", 

37 "EdgesChangedError", 

38 "UnresolvedGraphError", 

39 "TaskNotImportedError", 

40) 

41 

42 

43class PipelineGraphError(RuntimeError): 

44 """Base exception raised when there is a problem constructing or resolving 

45 a pipeline graph. 

46 """ 

47 

48 

49class DuplicateOutputError(PipelineGraphError): 

50 """Exception raised when multiple tasks in one pipeline produce the same 

51 output dataset type. 

52 """ 

53 

54 

55class PipelineDataCycleError(PipelineGraphError): 

56 """Exception raised when a pipeline graph contains a cycle.""" 

57 

58 

59class ConnectionTypeConsistencyError(PipelineGraphError): 

60 """Exception raised when the tasks in a pipeline graph use different (and 

61 incompatible) connection types for the same dataset type. 

62 """ 

63 

64 

65class IncompatibleDatasetTypeError(PipelineGraphError): 

66 """Exception raised when the tasks in a pipeline graph define dataset types 

67 with the same name in incompatible ways, or when these are incompatible 

68 with the data repository definition. 

69 """ 

70 

71 

72class UnresolvedGraphError(PipelineGraphError): 

73 """Exception raised when an operation requires dimensions or dataset types 

74 to have been resolved, but they have not been. 

75 """ 

76 

77 

78class PipelineGraphReadError(PipelineGraphError, IOError): 

79 """Exception raised when a serialized PipelineGraph cannot be read.""" 

80 

81 

82class TaskNotImportedError(PipelineGraphError): 

83 """Exception raised when accessing an attribute of a graph or graph node 

84 that is not available unless the task class has been imported and 

85 configured. 

86 """ 

87 

88 

89class EdgesChangedError(PipelineGraphError): 

90 """Exception raised when the edges in one version of a pipeline graph 

91 are not consistent with those in another, but they were expected to be. 

92 """ 

93 

94 

95class PipelineGraphExceptionSafetyError(PipelineGraphError): 

96 """Exception raised when a PipelineGraph method could not provide strong 

97 exception safety, and the graph may have been left in an inconsistent 

98 state. 

99 

100 The originating exception is always chained when this exception is raised. 

101 """