Repository navigation
Add constructor to QualityMetric ABC class - #258
Merged
roryclaydon1994 merged 4 commits intoSep 18, 2026
Merged
Conversation
- Add constructor to initialise the metric parameters attribute - Update QualityControlPipeline._initialise_metrics to pass metric configuration parameters to metric class constructors - Add type hints in QualityMetric and its concrete implementation
added 2 commits
September 18, 2026 14:00
- Replace dataset with QualityControlContext - Update doc string
- Replace dataset: Any with context: QualityControlContext - Update imports
roryclaydon1994
left a comment
There was a problem hiding this comment.
Review Feedback
PR adds to the API for the QualityMetric ABC to allow customisation of the metrics parameters and also collects resources and datasets into a context which helps keeps everything together. Only three small questions on this.
4 tasks
roryclaydon1994
deleted the
257-add-constructor-to-qualitymetric-abc-class
branch
September 18, 2026 16:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a missing step in the quality control pipeline: passing metric configuration parameters to quality metric implementations.
Closes #257
What’s changed
QualityMetricto initialise the metric parameters attributeQualityControlPipeline._initialise_metrics()to pass metric configuration parameters to metric class constructorsQualityMetricand its concrete implementationsQualityMetric.compute(dataset)withQualityMetric.compute(context)QualityMetric.compute()asdict[str, np.ndarray]to support multiple named diagnostic results from a metricHow to test / verify
Scope
Changelog
Reviewer Checklist
develop, ormainfor release PRs)ruff)Next Steps / Notes (if applicable)
The design of
PixelMaskMetrics(#254) calls for four diagnostic metrics to be returned as a dictionary byPixelMaskMetrics.compute(). This motivated the change to theQualityMetric.compute()return type to support multiple named diagnostic results. A rejection policy can then select which diagnostic(s) it uses in its filtering strategy.The next step is to proceed with the implementation of
PixelMaskMetrics.