Repository navigation
Add a [fitting] extra rather than hard dependencies - #193
Merged
Merged
Conversation
The fitting layer goes here, and mechanisms, rate constants and constraints
stay in SCALCS, so HJCFIT needs SCALCS to handle a mechanism. That is a
dependency it has never had, and making it a hard one would cost something
worth keeping: the likelihood needs numpy and scipy and nothing else, and a
test asserts that importing HJCFIT leaves dcio and scalcs out of sys.modules.
Someone who wants Log10Likelihood on a Q matrix they already have should not
acquire a mechanism library and a plotting stack to get it.
pip install hjcfit the likelihood
pip install hjcfit[fitting] records, mechanisms, fits, displays
dcio for records, scalcs for mechanisms and theoretical curves, matplotlib for
the displays. All three resolve from PyPI; verified in a clean virtualenv.
dcio is pinned at >=0.1.2 rather than >=0.1.1 because 0.1.1 reports the wrong
__version__ (DCPROGS/dcio#8).
EKDIST is deliberately not an extra. Exponential mixtures and t_crit
estimation belong to the displays that want them, but EKDIST is not on PyPI,
and declaring it would make pip install hjcfit[...] fail outright rather than
install what it can -- which is exactly how EKDIST's own dcio dependency
behaved until dcio was published.
This is metadata only; no import changes. What actually goes in the fitting
layer follows.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
remislp
added a commit
that referenced
this pull request
Sep 11, 2026
1.0.0 published the likelihood. This publishes the fitting layer, so that `pip install hjcfit[fitting]` means something: on PyPI the extra does not exist yet, and the command warns and installs the bare likelihood, which is the quiet kind of failure -- a working import, and the gap found later at read_idealized_bursts. Since 1.0.0: #186 read_idealized_bursts segments the record's periods rather than its resolved intervals, and needs dcio alone rather than dcio and scalcs. No shipped record has a sub-conductance level, so this changes nothing for them; it removes a way for the next one to be read wrongly and silently. #187 simplex_hjc, a port of SIMPHJC.FOR -- the search that produced every published HJCFIT result, and not SciPy's Nelder-Mead. #189 SWIG taken from PyPI on macOS rather than Homebrew. #192 that simplex made usable: documented at all for the first time, given reset_out_of_range for the limits the Fortran program applied around it, and tested end to end against the C++ likelihood rather than only against quadratics. #193 a [fitting] extra rather than hard dependencies, so the likelihood keeps needing nothing but numpy and scipy. #194 HJCFitter, FitResult and Record, lifted from the reproduction of Colquhoun, Hatton & Hawkes (2003). Duck-typed on a mechanism, so the fitting layer imports no mechanism library. The extra needs scalcs>=1.2.0 and dcio>=0.1.2, both released and both pinned for a reason recorded in pyproject.toml: the looser pins resolved and then failed on a missing attribute. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.
The fitting layer goes here, and mechanisms, rate constants and constraints stay
in SCALCS — so HJCFIT needs SCALCS to handle a mechanism. That is a dependency
it has never had.
Making it a hard one would cost something worth keeping: the likelihood
needs numpy and scipy and nothing else, and a test asserts that importing
HJCFIT leaves
dcioandscalcsout ofsys.modules. Someone who wantsLog10Likelihoodon a Q matrix they already have should not acquire a mechanismlibrary and a plotting stack to get it.
dcio>=0.1.2scalcs>=1.1.0matplotlib>=3.6All three resolve from PyPI — verified in a clean virtualenv.
The licence had to move first
scalcs was declared
GPL-2.0-only, which is mutually incompatible withHJCFIT's GPL-3.0-or-later: the combination could not have been distributed at
all. DCPROGS/SCALCS#24 corrects it to
GPL-2.0-or-later, which is what the codealready permitted — no file in
scalcs/carries a licence notice, and GPLv2 §9lets a recipient choose any version where the program specifies none.
MIT was considered and rejected there: SCALCS has a second copyright holder, and
popen.pyis a re-implementation of the GPL'd DCPROGSHJC_HILL.FOR.Two things deliberately not done
EKDIST is not an extra. Exponential mixtures and t_crit estimation belong to
the displays that want them, but EKDIST is not on PyPI and declaring it would
make
pip install hjcfit[...]fail outright rather than install what it can —exactly how EKDIST's own
dciodependency behaved until dcio was published.dcio>=0.1.2, not>=0.1.1. 0.1.1 reports the wrong__version__(DCPROGS/dcio#8), which I found while checking this extra resolved.
Metadata only; no import changes. What actually goes in the fitting layer
follows.
🤖 Generated with Claude Code