Skip to content

[ARCHITECTURE] Extend Quality Control Configuration for Resource Dependencies #241

Description

@jeipollack

Summary

Extend the Quality Control configuration framework to support declaring resources available to the QC pipeline and specifying the resources required by individual quality metrics.

The configuration should provide a generic mechanism for describing resources without coupling the configuration layer to specific resource types such as PSF models.

This configuration will provide the basis for the QualityControlPipeline resource-resolution and execution-context architecture defined in #240.

Proposed configuration

resources:

  psf_models:
    standard:
      inference_config: inference_standard.yaml

metrics:

  mask_obscuration:
    enabled: true
    params:
      aperture: gaussian
      sigma: 2.5

  goodness_of_fit:
    enabled: true
    required_resources:
      - psf_models.standard
    params:
      statistic: reduced_chi_square
      normalize_residuals: true

rejection:

  mask_obscuration:
    enabled: true
    threshold: 0.25

  goodness_of_fit:
    enabled: false
    threshold: 3.0

reporting:

  save_metrics: true
  log_statistics: true

The resources section is intentionally generic so that future resource types can be introduced without modifying the configuration framework.

What’s changed

  • Add a ResourcesConfig configuration object for resources available to the QC pipeline.
  • Add required_resources to QualityMetricConfig.
  • Preserve params for metric-specific configuration.
  • Parse the new resources section.
  • Parse metric required_resources declarations.
  • Validate that required resource identifiers follow the expected <resource_type>.<resource_name> form.
  • Validate that required resources are available in the configuration.
  • Validate that enabled rejection policies reference configured and enabled quality metrics.
  • Run cross-section configuration validation when loading the QC configuration.
  • Update configuration examples and unit tests accordingly.
  • Add a changelog fragment under Internal changes.

Validation

The configuration layer should reject, with clear errors:

  • malformed resource identifiers;
  • unknown resource types;
  • unknown resource names;
  • enabled rejection policies referring to unknown metrics;
  • enabled rejection policies referring to disabled metrics.

Validation should occur during QualityControlConfigHandler.load(), so callers receive either a valid QualityControlConfig or an exception.

Relationship to #240

This issue provides the configuration plumbing required by the QC pipeline orchestration implemented in #240.

The pipeline will use required_resources to determine which execution resources need to be prepared before metric evaluation and will subsequently make those resources available through the QC execution context.

Resource generation and metric execution are not part of this issue.

Scope / Non-goals

This issue does not implement:

  • PSF inference or other resource generation;
  • QualityControlContext;
  • resource deduplication or caching;
  • quality metric computation;
  • rejection policy execution;
  • shape metrics;
  • pipeline execution orchestration.

Those responsibilities remain part of the QC pipeline implementation and subsequent metric-specific work.

Acceptance criteria

  • ResourcesConfig represents configured resources.
  • QualityMetricConfig supports required_resources.
  • Resource and metric configuration are parsed correctly.
  • Cross-section configuration validation is performed during configuration loading.
  • Invalid resource references produce clear ValueErrors.
  • Invalid rejection-policy/metric references produce clear ValueErrors.
  • Existing configuration tests continue to pass.
  • New unit and integration tests cover the validation behavior.
  • Working QC configuration example is updated to contain only currently supported functionality.
  • Changelog fragment is added under Internal changes.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

Status
No status

Relationships

None yet

Development

No branches or pull requests

Issue actions