Skip to content

Take log-bin edges from dcio (M3) - #180

Merged
remislp merged 1 commit into
masterfrom
histogram
Sep 1, 2026
Merged

remislp merged 1 commit into
masterfrom
histogram

Conversation

@remislp

@remislp remislp commented Sep 1, 2026

Copy link
Copy Markdown
Member

Third part of M3. Depends on DCPROGS/dcio#3.

log_bin_edges keeps its signature and stays HJCFIT's documented entry point,
but the arithmetic now comes from dcio.analysis.histogram — one definition in
the stack instead of one here and a diverging one in EKDIST.

The two had the same start and the same ratio but different upper limits;
EKDIST's could fall below the longest interval and silently drop the tail
(DCPROGS/EKDIST#3). HJCFIT's was the correct one, and is what dcio implements.

Dependency discipline preserved

dcio is imported inside the function, exactly as read_idealized_bursts
already does. The likelihood library still works with numpy alone; only
dwell-time histograms need dcio. The ImportError says how to install it
rather than surfacing a bare ModuleNotFoundError from three frames down.

What stays

ideal_pdf_scale_factor looked like a duplicate of EKDIST's
__exponential_scale_factor and is a different quantity: this one renormalises
an ideal pdf onto the resolved intervals via the Q-matrix survival
φ_A exp(Q_AA t_res) u_A, EKDIST's normalises a mixture already fitted to data.

Verified

log_bin_edges and dwell_time_histogram both work through the delegation;
38 edges, nbdec 10, top edge covers max(X).

🤖 Generated with Claude Code

Third part of M3. log_bin_edges keeps its signature and stays HJCFIT's
documented entry point, but the arithmetic now comes from
dcio.analysis.histogram, so there is one definition of it in the stack rather
than one here and a diverging one in EKDIST.

dcio is imported inside the function, as read_idealized_bursts already does,
so it stays a soft dependency: the likelihood library still works with numpy
alone, and only dwell-time histograms need dcio. The ImportError says how to
install it rather than surfacing a bare ModuleNotFoundError from three frames
down.

ideal_pdf_scale_factor stays here. It looked like a duplicate of EKDIST's
__exponential_scale_factor and is a different quantity: this one renormalises
an ideal pdf onto the resolved intervals from the Q-matrix survival, EKDIST's
normalises an exponential mixture already fitted to data.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@remislp
remislp merged commit 93845fe into master Sep 1, 2026
12 checks passed
@remislp
remislp deleted the histogram branch September 1, 2026 16:55
remislp added a commit that referenced this pull request Sep 1, 2026
* Exercise the dcio-backed entry points in CI

read_idealized_bursts and log_bin_edges import dcio and scalcs at call time, so
the likelihood library needs nothing but numpy. The cost of that design is that
the CI matrix, which installs neither, could not exercise either entry point --
so both shipped with no coverage at all, and a green run said nothing about
them. #180's delegation was verified only on my machine.

Adds a dcio-integration job that installs both from git and runs tests against
an installed package rather than the checkout. It builds through
scikit-build-core, which is also what a user gets.

The tests pin golden values for the shipped CH82 record (572 bursts, 1100
intervals, 4.819128 s), that every burst has an odd interval count, that the
sign of tcrit does not change segmentation, the bins-per-decade rule, and that
the histogram bars account for every interval. One of them matters more than
the rest: importing HJCFIT in a subprocess must leave dcio and scalcs out of
sys.modules, which is the property the lazy imports exist to provide and the
one a future refactor is most likely to break.

Also corrects the ImportError guidance. It pointed at github.com/remislp/dcio
and github.com/remislp/SCALCS; both moved to the DCPROGS organisation and the
SCALCS fork has been deleted, so the only advice the error gave was a dead
link. It now gives the two pip commands.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Fix the ImportError message: it did not compile

An escaped newline collapsed into a real one while editing, splitting the
string literal across lines. python/__init__.py then failed to compile, which
ctest caught as python_qmatrix and every matrix job reported.

It passed locally because 'import HJCFIT' resolves to the installed package,
not the source tree, so nothing I ran locally ever compiled the file I had
edited. Compiling the sources directly is the check that catches this.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant