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
Checkwraps a singlectx -> list[ValidationIssue]function with a stable name and description;a
ValidationProfileis 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:
objectA single, named validation check.
- func#
A function
ctx -> list[ValidationIssue].- Type:
callable
- func: Callable[[ValidationContext], List[ValidationIssue]]#
- 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:
- 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:
objectAn ordered set of checks that applies to one category of module.
- proteobench.validation.profiles.available_profiles() List[str][source]#
List the names of all registered profiles.
- 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
Noneif no profile has that name (or ifnameis 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. SetTrueto replace an existing profile.
- Raises:
ValueError – If a profile with the same name is already registered and
overwriteisFalse.