Repository navigation
fix(aggregate_csv): latent 3-sigma bounds, max_lh seed, warn on unresolvable argument - #1598
Merged
Merged
Conversation
…olvable argument - Row.values_at_sigma_3_kwargs read latent_summary.values_at_sigma_1, so every latent *_lower_3_sigma / *_upper_3_sigma column carried the 1-sigma values. - Row.max_likelihood_kwargs seeded from median_pdf_sample.kwargs, so a MaxLogLikelihood model-parameter column was the median. - Column.value swallowed every KeyError into None. An argument matching neither the samples-summary nor the latent-summary keyspace now logs one warning per column, and AggregateCSV(strict=True) raises instead. - Row kwargs tolerate a summary with no median sample or sigma bounds (a search without a PDF) instead of raising on None. - Replace the eight tautological `x == "a" or "b"` assertions in test_aggregate_csv.py with exact values; add regression tests for the three defects and the no-PDF case; give the fixture a max-likelihood centre_0 that differs from the median so the max_lh test is meaningful. Closes #1597 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BWFb5cFmjTN6YP8t9AURev
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
Closes #1597.
AggregateCSVwrote wrong numbers for two column kinds and hid a third failure:Row.values_at_sigma_3_kwargsreadlatent_summary.values_at_sigma_1, so every latent*_lower_3_sigma/*_upper_3_sigmacolumn carried the 1-sigma values (shipped into the June 2026 Euclid DR1 prelim catalogue).Row.max_likelihood_kwargsseeded frommedian_pdf_sample.kwargs, so aMaxLogLikelihoodmodel-parameter column was the median.Column.valueswallowed everyKeyErrorintoNone, so a renamed latent or a typo looked like a missing value (this hid the euclid pipeline's stalelatent.prefix from June to September).Now an argument matching neither the samples-summary nor the latent-summary keyspace logs one warning per column (naming the argument and the first ten available ones), and
AggregateCSV(aggregator, strict=True)raises aKeyErrorinstead. The row kwargs also tolerate a summary without a median sample or sigma bounds (a search with no PDF), which the new keyspace check would otherwise have tripped over.The eight tautological
x == "a" or "b"assertions intest_aggregate_csv.pyare replaced with exact values, and the fixture's max-likelihoodcentre_0now differs from the median so the max_lh test is meaningful.Release note: this changes published numbers. Any catalogue built with latent 3-sigma or
MaxLogLikelihoodcolumns (the June DR1 prelim catalogue) needs regenerating.API Changes
AggregateCSV.__init__gainsstrict: bool = False;Column.__init__gains the same keyword. Default behaviour keeps the CSV shape and adds one log line per unresolvable argument.Row.known_paths(new cached property) — the union of the four kwargs keyspaces.MaxLogLikelihoodcolumns now hold the values their names say.See full details below.
Test Plan
python -m pytest test_autofit/aggregator/— 66 passed, 13 skippedpython -m pytest test_autofit/— 2511 passed, 43 skippedgrep -E '== *"[^"]*" or "' test_autofit/aggregator/summary_files/test_aggregate_csv.pyis emptyShip decision (flagged)
Prompt
Autonomy: supervised, launched interactively from a web session with no human present, so the ship sign-off was taken rather than parked: this PR is the review surface and merge stays human. Rejected alternative: park with anawaiting-inputquestion on #1597 before any PR existed. Revert:git revert 2fdec1b.Full API Changes (for automation & release notes)
Added
autofit.AggregateCSV(aggregator, strict=False)—strict=TrueraisesKeyErrorfor an argument that resolves in neither keyspace.autofit.aggregator.summary.aggregate_csv.column.Column(argument, name=, value_types=, strict=False).autofit.aggregator.summary.aggregate_csv.row.Row.known_paths— cached set of every resolvable argument path.Changed Behaviour
Row.values_at_sigma_3_kwargsmergeslatent_summary.values_at_sigma_3(wasvalues_at_sigma_1).Row.max_likelihood_kwargsseeds fromsamples_summary.max_log_likelihood_sample.kwargs(wasmedian_pdf_sample.kwargs).Column.valuelogs oneWARNING(loggerautofit.aggregator.summary.aggregate_csv.column) per column whose argument is unresolvable; values still fill asNoneunlessstrict.Row.*_kwargsreturn{}contributions for aNonemedian sample orNonesigma dict instead of raisingAttributeError.Migration
af.AggregateCSV(aggregator, strict=True).Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BWFb5cFmjTN6YP8t9AURev
Generated by Claude Code