stairval package

Stairval is a framework for validating hierarchical data structures.

class stairval.Auditor[source]

Bases: Generic[ITEM]

Auditor checks the inputs for sanity issues and relates the issues with sanitized inputs as SanitationResults.

The auditor may sanitize the input as a matter of discretion and returns the input as OUT.

static prepare_notepad(label: str) Notepad[source]

Prepare a Notepad for recording issues and errors.

Parameters:

label – a str with the top-level section label.

Returns:

an instance of Notepad.

Return type:

Notepad

abstract audit(item: ITEM, notepad: Notepad)[source]

Audit the item and record any issues into the notepad.

class stairval.Issue(level: Level, message: str, solution: str | None = None)[source]

Bases: object

Issue summarizes an issue found in the input data.

The issue has a level, a message with human-friendly description, and an optional solution for addressing the issue.

property level: Level
property message: str
property solution: str | None
class stairval.Level(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

An enum to represent severity of the DataSanityIssue.

WARN = 1

Warning is an issue when something not entirely right. However, unlike Level.ERROR, the analysis should complete albeit with sub-optimal results 😧.

ERROR = 2

Error is a serious issue in the input data and the downstream analysis may not complete or the analysis results may be malarkey 😱.

Subpackages