proteobench.validation.profiles module#

Validation checks, profiles, and the profile registry.

This module is the extensibility surface of the validation layer. It models validation as two composable pieces:

  • a Check wraps a single ctx -> list[ValidationIssue] function with a stable name and description;

  • a ValidationProfile is an ordered list of checks that applies to one category of module.

Profiles are looked up by name in a module-level registry. A module declares which profile it uses (via [validation].profile in module_settings.toml, or by inference from its parser class); the orchestrator then runs that profile’s checks. Adding a new module of an existing category requires no code. Adding a genuinely new category requires only registering a new profile here (or from third-party code via register_profile()), without touching the orchestrator.

Checks are reusable across profiles: for example run_consistency is shared by both the quant and de novo profiles.

class proteobench.validation.profiles.Check(name: str, func: Callable[[ValidationContext], List[ValidationIssue]], description: str = '')[source]#

Bases: object

A single, named validation check.

name#

Stable identifier used in fallback error messages and progress display.

Type:

str

func#

A function ctx -> list[ValidationIssue].

Type:

callable

description#

Human-readable description of what the check verifies.

Type:

str, optional

description: str = ''#
func: Callable[[ValidationContext], List[ValidationIssue]]#
name: str#
run(ctx: ValidationContext) List[ValidationIssue][source]#

Execute the check against a validation context.

Parameters:

ctx (ValidationContext) – The inputs available to the check.

Returns:

Issues produced by the check (possibly empty).

Return type:

list of ValidationIssue

proteobench.validation.profiles.CheckFunc#

takes a context, returns a list of issues.

Type:

Type alias for a check function

alias of Callable[[ValidationContext], List[ValidationIssue]]

class proteobench.validation.profiles.ValidationProfile(name: str, checks: List[Check] = <factory>, description: str = '')[source]#

Bases: object

An ordered set of checks that applies to one category of module.

name#

Unique profile name (the routing key declared by modules).

Type:

str

checks#

Checks to run, in order.

Type:

list of Check

description#

Human-readable description of the profile.

Type:

str, optional

property check_names: List[str]#

Return the names of the checks in this profile.

Returns:

The ordered check names.

Return type:

list of str

checks: List[Check]#
description: str = ''#
name: str#
proteobench.validation.profiles.available_profiles() List[str][source]#

List the names of all registered profiles.

Returns:

Sorted profile names.

Return type:

list of str

proteobench.validation.profiles.get_profile(name: str) ValidationProfile | None[source]#

Look up a registered profile by name.

Parameters:

name (str) – Profile name.

Returns:

The registered profile, or None if no profile has that name (or if name is not a string).

Return type:

ValidationProfile or None

proteobench.validation.profiles.register_profile(profile: ValidationProfile, overwrite: bool = False) None[source]#

Register a validation profile under its name.

Parameters:
  • profile (ValidationProfile) – The profile to register.

  • overwrite (bool, optional) – If False (default), registering a name that already exists raises. Set True to replace an existing profile.

Raises:

ValueError – If a profile with the same name is already registered and overwrite is False.

proteobench.validation.profiles.unregister_profile(name: str) None[source]#

Remove a profile from the registry if present.

Parameters:

name (str) – Name of the profile to remove.