Skip to content

Draft: Update PixelMaskMetric with masked-pixel diagnostics - #259

Draft
jeipollack wants to merge 8 commits into
developfrom
254-pixel-mask-quality-metrics
Draft

jeipollack wants to merge 8 commits into
developfrom
254-pixel-mask-quality-metrics

Conversation

@jeipollack

@jeipollack jeipollack commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR extends the PixelMaskMetric class to compute four diagnostics describing pixel-mask coverage across the image and within a configurable aperture around the source:

  • Total masked pixels — number of masked pixels in the image.
  • Total masked fraction — fraction of image pixels that are masked.
  • Aperture masked pixels — number of masked pixels within the configurable aperture
  • Aperture masked fraction — fraction of aperture pixels that are masked.

Closes #254

What’s changed

  • Implements the four pixel-mask diagnostics described above.
  • Adds unit and integration tests in qc_metrics_pixel_masks_test.py.
  • Adds a pipeline integration test in pipeline_test.py that runs the pixel-mask metric.
  • Refactors the test module by migrating shared fixtures to conftest.py and moving the PSFDataset helper to a new test_utils.py module.

How to test / verify

  • Check CI passes.

  • Review the implementation and test coverage, with particular attention to:

    • the definition of the aperture and its centre conventions;
    • the distinction between total and aperture-restricted masked-pixel diagnostics;
    • the handling of invalid aperture configurations;
    • integration with the dictionary-based QualityMetric.compute() API and QualityControlResult.

Scope

Indicate the type of PR:

  • Feature
  • Bug fix
  • Hotfix
  • Documentation / process change
  • Internal / refactor
  • Release

Optionally, note if this PR is part of a larger milestone or set of related PRs.

Changelog

  • Changelog fragment added (if applicable)

Reviewer Checklist

Reviewers should confirm the following before approving and merging:

  • The PR targets the correct base branch (develop, or main for release PRs)
  • The PR is assigned to the developer
  • Appropriate labels are applied
  • The PR is included in relevant projects and/or milestones
  • Description clearly explains what has changed
  • Issue references included, if applicable
  • Code and documentation adhere to current standards (ruff)
  • Documentation updates included, if relevant
  • CI tests are passing
  • All reviewer comments have been addressed

Next Steps / Notes (if applicable)

Next, the rejection policy will be implemented and tested for this quality metric.

@jeipollack jeipollack changed the title Update PixelMaskMetric.compute type hints Update PixelMaskMetric with masked-pixel diagnostics Sep 24, 2026
Jennifer Pollack added 5 commits September 30, 2026 18:54
- Add diagnostic attribute to RejectionPolicyConfig
- Update rejection config section parser
- Remove validation methods added to pipeline.py
- Update config_test.py with new and improved test cases
- Update fixtures and remove deprecated YAML fixtures
- Add validation for metric resource requirements and rejection policy configuration
- Call configuration validation from the pipeline constructor
- Update pipeline execution to consume the `QualityMetric.compute` diagnostics API
- Apply rejection policies using their configured diagnostic
- Move cross-section validation tests from config_test.py to pipeline_test.py
- Update and extend pipeline test coverage for the revised validation and updated processing flow
@jeipollack
jeipollack force-pushed the 254-pixel-mask-quality-metrics branch from 10796cf to f4c89b1 Compare October 1, 2026 12:32
Jennifer Pollack added 3 commits October 2, 2026 10:02
- Move dataset factory and context fixtures to conftest.py
- Add test_utils module to store helpers for testing
- Add YAML fixture with pixel mask settings, without resources and rejection disabled
@jeipollack jeipollack self-assigned this Oct 2, 2026
@jeipollack jeipollack added the enhancement New feature or request label Oct 2, 2026
@jeipollack jeipollack added this to the Outlier Removal milestone Oct 2, 2026
@jeipollack jeipollack changed the title Update PixelMaskMetric with masked-pixel diagnostics Draft: Update PixelMaskMetric with masked-pixel diagnostics Oct 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

1 participant