docs: ADR-0019 — the bandpower shape function lives in the binning operator#52
Merged
Conversation
…erator The binning weights w_l declare what the spectrum is assumed to do inside a bin; the estimator returns the amplitude of that declared shape. Unit weight is not neutral — it declares flat C_l — and the Dl path ignored that declaration, estimating C_b under the flat-C model and then rescaling by a single l(l+1)/2pi evaluated at the bin midpoint. No scalar can do that job: once a bin is collapsed the in-bin variation of l(l+1) is gone, and convexity gives sum_l w_l l(l+1) = l_eff(l_eff+1) + Var_w(l), so any single-l scalar undershoots by the weighted variance of l. The decision is to declare the shape once, in the binning operator, and delete the conversion rather than correct it: Dl selects w_l = 2pi/(l(l+1)) and the estimator returns D_b natively, with F_b already the Fisher for D_b. output_convention therefore becomes an estimator setting, not a presentation one. The effective multipole is the centroid of the estimator's realised window, which depends on noise and mask coupling and is knowable only from the per-l Fisher. It moves to Fisher, where the window lives. Bins keeps bin geometry and no notion of an effective multipole — bin edges cannot know where a bandpower sits, and by answering anyway they answered with the midpoint. CONTEXT.md gains the three terms the old lbin collapsed into one. Status: Proposed. Implementation tracked in issues 49, 50 and 20.
Codecov Report✔️ No coverage data to report, because files changed do not require tests or are set to ignore |
There was a problem hiding this comment.
Pull request overview
Adds a new Architecture Decision Record (ADR-0019) documenting that the bandpower “shape function” (in-bin spectral assumption) must be expressed in the binning operator (via weights (w_\ell)), and that effective multipoles should be derived from the realised window (via Fisher), not from bin midpoints. Also updates project glossary/context to explicitly separate the terms bandpower shape function, effective multipole, and bin midpoint.
Changes:
- Add ADR-0019 documenting the decision to eliminate post-hoc (C_\ell \to D_\ell) scalar conversion and instead declare the in-bin shape via (w_\ell).
- Index ADR-0019 in the ADR catalog and mark it as Proposed / deferred.
- Extend
CONTEXT.mdwith clearer binning terminology aligned with ADR-0019.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docs/adr/INDEX.md | Adds ADR-0019 to the bandpower/binning section and to the Proposed/deferred status list. |
| docs/adr/0019-bandpower-shape-function.md | New ADR specifying the bandpower shape-function decision, effective-multipole definition, and consequences. |
| CONTEXT.md | Adds and clarifies glossary terms: bandpower shape function, effective multipole, and bin midpoint (Bins.lmid). |
CONTEXT.md is a glossary, not a second copy of the ADR: drop the rationale, the implementation location and the rename history from the three new terms and leave the definitions. In the ADR, cut the Bins-cleanup consequence down to the decision-level fact (the P/Q machinery goes, ADR-0007 needs amending) rather than restating the issue that owns it, and stop naming source files a Proposed ADR has not touched.
This was referenced Jul 20, 2026
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.
What changed
Records ADR-0019 — the bandpower shape function lives in the binning operator —
and adds the three domain terms it separates to
CONTEXT.md. Decision only; no code.The implementation is tracked in three issues (below).
The binning weights
w_ℓindC^b = Σ_ℓ w_{b,ℓ} b²_ℓ dC^ℓdeclare what the spectrumis assumed to do inside a bin, and the estimator returns the amplitude of that declared
shape. Unit weight is not a neutral choice — it declares C_ℓ flat in the bin. The
Dlpath then ignored that declaration: it estimated
C_bunder the flat-C model andrescaled by a single
ℓ(ℓ+1)/2πevaluated at the bin midpoint. No scalar can dothat job. Once a bin is collapsed to one number the in-bin variation of
ℓ(ℓ+1)isgone, and convexity gives
Σ_ℓ w_ℓ·ℓ(ℓ+1) = ℓ_eff(ℓ_eff+1) + Var_w(ℓ)— so anysingle-ℓ scalar undershoots the true D-space factor by the weighted variance of ℓ
across the bin (≈5% at
delta_ell=5, low ℓ).The decision is to declare the shape once and delete the conversion rather than
correct it:
Dlselectsw_ℓ = 2π/(ℓ(ℓ+1)), the estimator returnsD_bnatively, andF_bis already the Fisher forD_b. Separately, the effective multipole is thecentroid of the estimator's realised window — QML applies inverse-variance weighting
automatically, so it depends on noise and mask coupling and is knowable only from the
per-ℓ Fisher. It moves to
Fisher, where the window lives.Binskeeps bin geometryand no notion of an effective multipole: bin edges cannot know where a bandpower sits,
and by answering anyway they answered with the midpoint.
Public surface
None in this PR — it adds an ADR (status Proposed) and glossary terms. The public
surface it decides on is breaking and lands in the implementation PRs:
output_conventionbecomes an estimator setting (Dlwill estimate a differentobservable, so D_ℓ values, covariance and Fisher all change, and not by a uniform
factor);
Bins.lbin→Bins.lmid;get_effective_ells()moves ontoFisherand willrequire a completed Fisher run. Each carries its own changelog entry.
Implementation
Sequenced, and the first is a hard prerequisite — effective ells differ per spectrum,
so TEB cannot be served until the window supports it:
Follow-up, deliberately unspecified: Fiducial-shaped binning operator.
Checklist
docs/source/changelog.rst— not applicable; no package source touched, so thechangelogjob does not gate this. The behaviour changes it decides carry theirentries in the implementation PRs.
docs/adr/0019-bandpower-shape-function.md, indexed inINDEX.md.CONTEXT.mdupdated — bandpower shape function, effective multipole and binmidpoint are now three distinct terms. Collapsing them into one
lbinis thebug.
bin_spectra/bin_covariance/Dlweighting as our extensions on top of xQML;the
Binscleanup PR deletes those and must amend it (attribution to Vanneste+2018 and the GPLv3 obligation stay regardless).