LegOutcome#

class scikitplot.corpus.LegOutcome(leg, status, hit_count=0, generation=None, backend=None, error=None, filter_capability=None, requested_backend=None, fallback_reason=None)[source]#

How one evidence path fared.

Parameters:
legLegKind

Which evidence path this describes.

statusLegStatus

Outcome for this leg.

hit_countint, optional

Hits contributed before fusion.

generationIndexGeneration or None, optional

Index generation the leg ran against, for provenance; to_dict writes its own to_dict().

backendstr or None, optional

Backend that served the leg, when applicable.

errorErrorRecord or None, optional

Required when status is DEGRADED or FAILED.

filter_capabilityFilterCapability or None, optional

How the leg answered the query’s filter (R2-2): every operator SUPPORTED or EMULATED; None when no filter was applied or the leg did not run. A leg never runs with a filter it ignored.

requested_backendstr or None, optional

What the configuration asked to serve the leg ("auto", a backend name), when a backend served it (R2-5).

fallback_reasonstr or None, optional

Why backend is not what was requested, when it is not: a closed vocabulary of the backend ("annoy_broken", "option_unsupported", …); None otherwise.

Raises:
ValueError

If status is DEGRADED or FAILED and error is None.

Parameters:

Notes

Developer. The error-required invariant is enforced in __post_init__ rather than documented, because an unexplained degradation is exactly as unhelpful as no degradation signal at all.

backend: str | None = None#
error: ErrorRecord | None = None#
fallback_reason: str | None = None#
filter_capability: FilterCapability | None = None#
generation: Any = None#
hit_count: int = 0#
leg: LegKind[source]#
property ran: bool#

Whether the leg actually executed.

requested_backend: str | None = None#
status: LegStatus[source]#
to_dict()[source]#

Return a JSON-compatible mapping.

Return type:

dict[str, Any]