Document ces_source units and API contracts (closes #269)#271
Draft
yuema137 wants to merge 7 commits into
Draft
Conversation
Document that pdf() evaluates the PDF at given CES coordinates (keV) and returns an array of values, not a callable. Note out-of-range behavior for piecewise vs linear interpolation. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Open
Coverage Report for CI Build 25090677079Coverage remained the same at 76.422%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
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
Resolves all five items raised in #269 — primarily by adding/expanding
docstrings on
CESTemplateSourceand its methods so the public API isself-documenting (units, return types, lifecycle role).
Changes
CESTemplateSource(cedc847) — referencetable for required/optional config keys with explicit units, including
rate_multiplierin events / (ton·year),fiducial_massin ton,livetime_daysin days, and energies in keV. [CES issues #269 item 1]pdf()docstring (a7b2f17) — clarifies the method evaluatesthe PDF at given CES coordinates and returns an array of values
(not a callable); documents out-of-range behavior for piecewise vs
linear interpolation. [CES issues #269 item 2]
get_pmf_grid()docstring (a41fa82) — explains PMF vs PDF,why this method overrides the blueice default (per-source rebinning
to
minimal_energy_resolutiondiffers from the sharedanalysis_space), and what each return value represents.[CES issues #269 item 3]
365.26 → 365.25(a97b0a5). [CES issues #269 item 4]compute_pdf()docstring (c5c60b7) — explains the method is aone-time lifecycle hook (not a per-point evaluator) and flags that
the override is currently identical in body to
HistogramPdfSource.compute_pdf. [CES issues #269 item 5]Transformation.parameterstyping inces_transformation.py(
3c4ba41) — acceptint,bool, andstrin addition tofloat,so transformation parameters aren't forced through unnecessary float
coercion. Same API-clarity theme as the docstring work, though not
explicitly listed in CES issues #269.
Scope
The
ces_source.pychanges are doc-only; the only behavior changesare the
365.25day-year fix and the broadenedTransformationparameter typing.
Known follow-ups (intentionally out of scope)
_calculate_expected_eventsmultiplies byrate_multipliertwicewhile
* fiducial_massis commented out — looks like a units bugworth a separate fix.
get_pmf_gridstill has a strayprint("from cache?", ...)debugline, and its second return value is zeros where blueice's contract
documents
float('inf')for non-density-estimating sources.CESTemplateSource.compute_pdfis currently redundant with theblueice parent and could be removed.
Test plan
help(CESTemplateSource)shows the new config-key reference🤖 Generated with Claude Code