Skip to content

fix(aggregate_csv): latent 3-sigma bounds, max_lh seed, warn on unresolvable argument - #1598

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/autofit-aggregate-csv-sigma3-x8twln
Sep 10, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
claude/autofit-aggregate-csv-sigma3-x8twln

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Closes #1597. AggregateCSV wrote wrong numbers for two column kinds and hid a third failure:

  • 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 (shipped into the June 2026 Euclid DR1 prelim catalogue).
  • 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, so a renamed latent or a typo looked like a missing value (this hid the euclid pipeline's stale latent. 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 a KeyError instead. 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 in test_aggregate_csv.py are replaced with exact values, and the fixture's max-likelihood centre_0 now 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 MaxLogLikelihood columns (the June DR1 prelim catalogue) needs regenerating.

API Changes

  • AggregateCSV.__init__ gains strict: 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.
  • Behaviour change: latent 3-sigma and MaxLogLikelihood columns now hold the values their names say.
    See full details below.

Test Plan

  • python -m pytest test_autofit/aggregator/ — 66 passed, 13 skipped
  • python -m pytest test_autofit/ — 2511 passed, 43 skipped
  • grep -E '== *"[^"]*" or "' test_autofit/aggregator/summary_files/test_aggregate_csv.py is empty
  • CI matrix (3.12 / 3.13)

Ship 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 an awaiting-input question on #1597 before any PR existed. Revert: git revert 2fdec1b.

Full API Changes (for automation & release notes)

Added

  • autofit.AggregateCSV(aggregator, strict=False) — strict=True raises KeyError for 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_kwargs merges latent_summary.values_at_sigma_3 (was values_at_sigma_1).
  • Row.max_likelihood_kwargs seeds from samples_summary.max_log_likelihood_sample.kwargs (was median_pdf_sample.kwargs).
  • Column.value logs one WARNING (logger autofit.aggregator.summary.aggregate_csv.column) per column whose argument is unresolvable; values still fill as None unless strict.
  • Row.*_kwargs return {} contributions for a None median sample or None sigma dict instead of raising AttributeError.

Migration

  • None required. To fail fast on a bad argument: 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

…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
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Sep 10, 2026 — with Claude
@Jammy2211
Jammy2211 merged commit 68d43b0 into main Sep 10, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the claude/autofit-aggregate-csv-sigma3-x8twln branch September 10, 2026 18:29
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: aggregate_csv latent 3-sigma = 1-sigma, max_lh = median, silent None

2 participants