HierarchyReport#

class scikitplot.corpus.HierarchyReport(errors=<factory>, checked=0, max_depth_seen=0)[source]#

Outcome of validating a document hierarchy.

Parameters:
errorslist of ErrorRecord

One record per violation found.

checkedint

Number of documents examined.

max_depth_seenint

Deepest ancestor chain encountered.

Parameters:
checked: int = 0#
errors: list[ErrorRecord][source]#
max_depth_seen: int = 0#
property ok: bool#

Whether the hierarchy is free of violations.

raise_if_invalid()[source]#

Raise if any violation was found.

Raises:
ValueError

Naming every violation.

Return type:

None

to_dict()[source]#

Return a JSON-compatible mapping.

Return type:

dict[str, Any]