feat: Add data metrics for numeric columns#46
Open
Moritz Potthoff (MoritzPotthoffQC) wants to merge 27 commits into
Open
feat: Add data metrics for numeric columns#46Moritz Potthoff (MoritzPotthoffQC) wants to merge 27 commits into
Moritz Potthoff (MoritzPotthoffQC) wants to merge 27 commits into
Conversation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: EgeKaraismailogluQC <128645043+EgeKaraismailogluQC@users.noreply.github.com>
…_fraction.py Co-authored-by: EgeKaraismailogluQC <128645043+EgeKaraismailogluQC@users.noreply.github.com>
Co-authored-by: quant-ranger[bot] <132915763+quant-ranger[bot]@users.noreply.github.com> Co-authored-by: Marius Merkle <marius.merkle@quantco.com> Co-authored-by: Marius Merkle <122545105+MariusMerkleQC@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #46 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 14 14
Lines 1052 1070 +18
=========================================
+ Hits 1052 1070 +18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Copilot started reviewing on behalf of
Moritz Potthoff (MoritzPotthoffQC)
July 16, 2026 12:00
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds additional data metrics (computed per-side, then rendered as old -> new (delta)) for numeric columns, and updates summary rendering + golden fixtures to accommodate the expanded metric set.
Changes:
- Added new data-metric functions (
mean_data,median_data,min_data,max_data,std_data) and expandedDEFAULT_DATA_METRICS. - Updated summary table rendering to apply consistent overflow handling to metric columns.
- Updated tests, docs, and regenerated summary fixtures to reflect the new preset metrics/labels and the updated table layout.
Reviewed changes
Copilot reviewed 86 out of 86 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| diffly/metrics/data.py | Adds numeric “data” metrics and updates the data-metric presets/utilities. |
| diffly/summary.py | Applies consistent overflow behavior to metric columns in the Columns section. |
| docs/api/metrics.rst | Updates API docs to list the newly added data metrics and renamed null-fraction metric. |
| tests/test_metrics.py | Adds unit tests for new data metrics and renames null-fraction test targets. |
| tests/cli/test_cli.py | Updates CLI metric-selection test to use the new data-metric preset label. |
| tests/summary/fixtures/metrics_null_fraction/test_metrics_null_fraction.py | Updates fixture generator test to use the expanded data-metric preset set. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_True_top_True_slim_True_sample_rows_True_sample_pk_True.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_True_top_True_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_True_top_True_slim_False_sample_rows_True_sample_pk_True.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_True_top_True_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_False_top_True_slim_True_sample_rows_True_sample_pk_True.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_False_top_True_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_False_top_True_slim_False_sample_rows_True_sample_pk_True.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_True_perfect_False_top_True_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_True_top_True_slim_True_sample_rows_True_sample_pk_True.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_True_top_True_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_True_top_True_slim_False_sample_rows_True_sample_pk_True.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_True_top_True_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_False_top_True_slim_True_sample_rows_True_sample_pk_True.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_False_top_True_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_False_top_True_slim_False_sample_rows_True_sample_pk_True.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_presets_many/gen/pretty_False_perfect_False_top_True_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for new/wrapped metric headers. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_False_slim_True_sample_rows_True_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_False_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_False_slim_False_sample_rows_True_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_True_top_False_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_False_slim_True_sample_rows_True_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_False_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_False_slim_False_sample_rows_True_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_True_perfect_False_top_False_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_True_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_True_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_False_slim_True_sample_rows_True_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_False_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_False_slim_False_sample_rows_True_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_True_top_False_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_True_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_True_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_False_slim_True_sample_rows_True_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_False_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_False_slim_False_sample_rows_True_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_null_fraction/gen/pretty_False_perfect_False_top_False_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for expanded data metrics in the Columns table. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_True_slim_True_sample_rows_True_sample_pk_True.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_True_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_True_slim_False_sample_rows_True_sample_pk_True.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_True_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_False_slim_True_sample_rows_True_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_False_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_False_slim_False_sample_rows_True_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_True_top_False_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_False_top_True_slim_True_sample_rows_True_sample_pk_True.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_False_top_True_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_False_top_False_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_False_top_False_slim_False_sample_rows_True_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_True_perfect_False_top_False_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_True_slim_True_sample_rows_True_sample_pk_True.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_True_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_True_slim_False_sample_rows_True_sample_pk_True.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_True_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_False_slim_True_sample_rows_True_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_False_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_False_slim_False_sample_rows_True_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_True_top_False_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_True_slim_True_sample_rows_True_sample_pk_True.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_True_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_True_slim_False_sample_rows_True_sample_pk_True.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_True_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_False_slim_True_sample_rows_True_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_False_slim_True_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_False_slim_False_sample_rows_True_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
| tests/summary/fixtures/metrics_long_labels/gen/pretty_False_perfect_False_top_False_slim_False_sample_rows_False_sample_pk_False.txt | Golden fixture updated for wrapped headers with long metric labels. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Moritz Potthoff (MoritzPotthoffQC)
marked this pull request as ready for review
July 16, 2026 13:10
Moritz Potthoff (MoritzPotthoffQC)
requested review from
EgeKaraismailogluQC,
Marius Merkle (MariusMerkleQC) and
Oliver Borchert (borchero)
as code owners
July 16, 2026 13:10
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.
Motivation
Building on #43, we would like to provide a few more "data" metrics, this time for numeric columns only.
Changes