Repository navigation
Check burst segmentation against the rule transcribed from the Fortran - #7
Merged
Merged
Conversation
test_bursts.py fixes the burst conventions by stating them. This fixes them against a separate reading of the original, which is a different kind of evidence: the three implementations in the DCPROGS stack disagreed on exactly these points, and agreeing with each other would not have settled which was right. hjclik.for in DCPROGS/DCFORTRAN is the likelihood that produced every published HJCFIT result, Colquhoun, Hatton & Hawkes (2003) among them. It does not pre-split a record; line 1009 walks it and ends the group when a shut time exceeds tcrit: if(tint(in,jset).gt.tcrit(jset)) goto 92 !end present group with prev opening Three things follow, and each gets a test: the comparison is strictly greater, so a gap exactly equal to tcrit is within-burst; the group ends "with prev opening", so the separating gap belongs to no group and every group starts and ends on an opening; the test is NOT guarded by burst(jset), so a tcrit of zero ends the group at every shut time. HJCFIT means "do not divide" by setting tcrit enormous -- 3.1536e10 ms, one year (Hjcfit1-09122003.for line 1568) -- not by setting it to zero. That last one is worth a test on its own. A caller who passes zero expecting "no division" gets one group per opening, silently and with no error, and both implementations behave that way. Finding it cost real time. The two agree group for group on five records of 4000 intervals and at four values of tcrit. 13 tests. 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.
test_bursts.pyfixes the burst conventions by stating them. This fixes them against a separate reading of the original, which is a different kind of evidence: the three implementations in the DCPROGS stack disagreed on exactly these points, and agreeing with each other would not have settled which was right.hjclik.forin DCPROGS/DCFORTRAN is the likelihood that produced every published HJCFIT result, Colquhoun, Hatton & Hawkes (2003) among them. It does not pre-split a record; line 1009 walks it and ends the group when a shut time exceedstcrit:Three things follow, and each gets a test
The comparison is strictly greater, so a gap exactly equal to
tcritis within-burst.The group ends "with prev opening", so the separating gap belongs to no group and every group starts and ends on an opening.
The test is not guarded by
burst(jset)— so atcritof zero ends the group at every shut time. HJCFIT means "do not divide" by settingtcritenormous: 3.1536e10 ms, one year (Hjcfit1-09122003.forline 1568), not by setting it to zero.That last one deserves its own test. A caller who passes zero expecting "no division" gets one group per opening, silently and with no error, and both implementations behave that way. It cost real time to find, and a test is cheaper than finding it again.
Result
The two implementations agree group for group on five records of 4000 intervals and at four values of
tcrit, from one that splits almost everything to one that splits almost nothing.13 tests. Full suite: 358 passed, 2 skipped.
Written while reproducing Colquhoun, Hatton & Hawkes (2003), where the same transcription showed 0 differences over 83 282 bursts — this brings that check into the repository so it keeps being run.
🤖 Generated with Claude Code