3030import abc
3131import enum
3232import logging
33- from typing import ClassVar , Protocol
33+ from typing import TYPE_CHECKING , ClassVar , Protocol
3434
3535from lsst .utils import introspection
3636
3737from ._task_metadata import GetSetDictMetadata , NestedMetadataDict
3838
39+ if TYPE_CHECKING :
40+ from lsst .utils .logging import LsstLogAdapter
41+
3942__all__ = (
4043 "AlgorithmError" ,
4144 "AnnotatedPartialOutputsError" ,
@@ -66,7 +69,7 @@ class QuantumSuccessCaveats(enum.Flag):
6669 ALL_OUTPUTS_MISSING = enum .auto ()
6770 """No predicted outputs (except logs and metadata) were produced.
6871
69- `ANY_OUTPUTS_MISSING` is also set whenever this flag it set.
72+ `ANY_OUTPUTS_MISSING` is also set whenever this flag is set.
7073 """
7174
7275 NO_WORK = enum .auto ()
@@ -162,11 +165,11 @@ def legend() -> dict[str, str]:
162165 Mapping from character code to description.
163166 """
164167 return {
165- "+" : "at least one predicted output is missing, but not all" ,
168+ "+" : "at least one predicted output was missing, but not all were " ,
166169 "*" : "all predicated outputs were missing (besides logs and metadata)" ,
167- "A" : "adjustQuantum raised NoWorkFound; an updated QG would not include this quantum" ,
170+ "A" : "adjustQuantum raised NoWorkFound; a regenerated QG would not include this quantum" ,
168171 "D" : "algorithm considers data too bad to be processable" ,
169- "U" : "one or more input dataset as incomplete due to an upstream failure" ,
172+ "U" : "one or more input dataset was incomplete due to an upstream failure" ,
170173 "P" : "task failed but wrote partial outputs; considered a partial success" ,
171174 "N" : "runQuantum raised NoWorkFound" ,
172175 }
@@ -177,7 +180,9 @@ class GetSetDictMetadataHolder(Protocol):
177180 `GetSetDictMetadata`.
178181 """
179182
180- metadata : GetSetDictMetadata | None
183+ @property
184+ def metadata (self ) -> GetSetDictMetadata | None :
185+ pass
181186
182187
183188class NoWorkFound (BaseException ):
@@ -297,7 +302,7 @@ class AnnotatedPartialOutputsError(RepeatableQuantumError):
297302
298303 @classmethod
299304 def annotate (
300- cls , error : Exception , * args : GetSetDictMetadataHolder | None , log : logging .Logger
305+ cls , error : Exception , * args : GetSetDictMetadataHolder | None , log : logging .Logger | LsstLogAdapter
301306 ) -> AnnotatedPartialOutputsError :
302307 """Set metadata on outputs to explain the nature of the failure.
303308
0 commit comments