Conversation
M3 of the record-layer plan: the binning maths moves down, the figures stay where they are. EKDIST draws for a person, HJCFIT draws inside a notebook and SCALCS feeds a Qt canvas; those are legitimately different figures over the same bins, and only the bins were ever duplicated. Comparing the two existing copies turned up a defect rather than a duplicate. The bin edges agree exactly -- same start, same ratio -- but the upper limit does not. EKDIST computes it as exp(ceil(log(max))), which rounds up to the next power of e, while the whole scheme is bins per decade. That limit can land below the longest interval, and numpy.histogram then drops the tail of the distribution silently: across 400 randomly drawn exponential samples it happened in 119 of them. HJCFIT's 10 ** ceil(log10(max)) is right, and is what this implements. Also splits out what was tangled together. The two "scale factor" helpers are not copies of each other: EKDIST's normalises a fitted exponential mixture, HJCFIT's renormalises an ideal pdf onto resolved intervals from the Q matrix survival. Different quantities, both staying put. Exports bins_per_decade, log_bin_edges, log_bin_histogram and staircase -- counts, edges and step coordinates, no matplotlib anywhere. 29 new tests, including the truncation regression over 200 random samples. 262 passing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 1, 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.
M3 of the record-layer plan: the binning maths moves down, the figures stay
where they are.
The premise held, but not for the reason stated
The proposal called this "roughly thirty lines copied". Reading both
implementations side by side, the bin edges agree exactly — same start,
same ratio, same bins-per-decade rule — but the upper limit does not:
exp(ceil(log(max)))10 ** ceil(log10(max))The whole scheme is bins per decade.
exp(ceil(log(x)))rounds up to thenext power of e, which is what you get from writing the decade round-up
with a natural log by mistake. It can land below the longest interval, and
numpy.histogramthen drops those intervals with no warning.Across 400 randomly drawn exponential samples the top edge fell below
max(X)in 119 of them. On
glyr_experimental.scnit happens not to bite — openand shut periods both clear it — which is presumably why it survived.
This implements the decade-aligned version and pins it with a regression test
over 200 random samples.
What is not shared
The two "scale factor" helpers looked like a third duplicate and are not.
EKDIST's
__exponential_scale_factornormalises a fitted exponential mixtureagainst the data; HJCFIT's
ideal_pdf_scale_factorrenormalises an ideal pdfonto the resolved intervals via the Q-matrix survival
φ_A exp(Q_AA t_res) u_A. Different quantities. Both stay where they are.API
bins_per_decade,log_bin_edges,log_bin_histogram,staircase— counts,edges and step coordinates. No matplotlib anywhere in the module.
Tests
29 new. 262 passing overall.
Next
Repointing EKDIST and HJCFIT at this is the other half of M3 and follows in
their own PRs. Worth flagging that EKDIST hard-depending on dcio needs dcio to
be installable — it is not on PyPI, so that dependency has to be a git URL
until it is.
🤖 Generated with Claude Code