probe_backend#

scikitplot.corpus.probe_backend(cls, *, load=True)[source]#

Classify one backend’s availability.

Parameters:
clstype

A backend class exposing is_available() and, optionally, is_installed() (no import) and load_error().

loadbool, optional

True (default) answers by asking is_available(), which may import the backend. False imports nothing: a backend declaring loads_on_probe that is installed but not yet loaded in this process is reported UNKNOWN with reason "not_loaded".

Returns:
tuple of (CapabilityStatus, str or None)

The status and a stable machine-readable reason code. The reason is None when the status is AVAILABLE.

Parameters:
Return type:

tuple[CapabilityStatus, str | None]

Notes

Developer. The distinction rests on how the probe answers: returning False means the backend knows it is not installed, whereas raising means it is installed enough to try and failed – which is BROKEN. Review disproof D-13 confirmed the probes themselves are correctly fail-safe; the defect was that both outcomes collapsed to one boolean. A backend whose is_available() swallows a load failure (Annoy) is told apart by is_installed() and load_error(): installed with a failed load is BROKEN with reason "load_failed: <type>" (F-50); without that evidence it stays ABSENT.