Audit Specs

Serializable audit specifications.

class updatesupport.spec.QSpec(name, radius=None, backend=None, cost=None, solver=None, solver_options=None, settings=None)[source]

Bases: object

Serializable description of a built-in Q preset.

Parameters:
name: str
radius: float | None = None
backend: str | None = None
cost: Any | None = None
solver: str | None = None
solver_options: Mapping[str, Any] | None = None
settings: Mapping[str, Any] | None = None
classmethod from_value(value)[source]

Normalize a string, mapping, QPreset, or QSpec into a QSpec.

Parameters:

value (Any)

Return type:

QSpec

to_preset()[source]

Return the runtime QPreset represented by this spec.

Return type:

QPreset

as_dict()[source]
Return type:

dict[str, Any]

to_dict()[source]

Alias for as_dict(), matching AuditSpec.

Return type:

dict[str, Any]

class updatesupport.spec.AuditSpec(public, hidden, target, kind='public_descent', weight=None, candidate_refinements=(), q='saturated', q_presets=None, min_cell_weight=1.0, min_cell_weights=None, hidden_sets=None, top=10, title=None, target_description=None, observed_label=None, row_count_label='Rows', raise_errors=False, ambiguity_limit=None, bucket_budget=None, max_added_columns=None, search='exhaustive', beam_width=12, max_evaluations=None, must_include=(), must_exclude=(), enforce_bucket_budget=False, include_base=True, exact_required=True, screening_backend=None, screening_exact_fallback=True)[source]

Bases: object

Serializable configuration for a standard update-support audit.

Parameters:
public: Sequence[str]
hidden: Sequence[str]
target: str
kind: str = 'public_descent'
weight: str | None = None
candidate_refinements: Sequence[str] = ()
q: Any = 'saturated'
q_presets: Sequence[Any] | None = None
min_cell_weight: float = 1.0
min_cell_weights: Sequence[float] | None = None
hidden_sets: Sequence[Sequence[str]] | None = None
top: int = 10
title: str | None = None
target_description: str | None = None
observed_label: str | None = None
row_count_label: str = 'Rows'
raise_errors: bool = False
ambiguity_limit: float | None = None
bucket_budget: int | None = None
max_added_columns: int | None = None
search: str = 'exhaustive'
beam_width: int = 12
max_evaluations: int | None = None
must_include: Sequence[str] = ()
must_exclude: Sequence[str] = ()
enforce_bucket_budget: bool = False
include_base: bool = True
exact_required: bool = True
screening_backend: str | None = None
screening_exact_fallback: bool = True
classmethod from_dict(payload)[source]

Build an AuditSpec from a JSON-compatible mapping.

Parameters:

payload (Mapping[str, Any])

Return type:

AuditSpec

classmethod from_json(text)[source]

Build an AuditSpec from a JSON string.

Parameters:

text (str)

Return type:

AuditSpec

as_dict()[source]
Return type:

dict[str, Any]

to_dict()[source]

Alias for as_dict().

Return type:

dict[str, Any]

to_json(**kwargs)[source]

Serialize this spec to JSON.

Parameters:

kwargs (Any)

Return type:

str

run(data)[source]

Execute this spec against tabular data.

Parameters:

data (Any)

Return type:

AuditRun

class updatesupport.spec.AuditRun(spec, report)[source]

Bases: ReportArtifactMixin

Executed audit, preserving both the spec and generated report.

Parameters:
spec: AuditSpec
report: PublicDescentReport | SensitivityReport | PublicRepresentationFrontier | RepresentationStabilityCertificate
to_markdown()[source]
Return type:

str

as_dict()[source]
Return type:

dict[str, Any]

to_dict()[source]

Alias for as_dict().

Return type:

dict[str, Any]

updatesupport.spec.run_audit(spec, data)[source]

Execute a serializable AuditSpec against tabular data.

Parameters:
Return type:

AuditRun