Repository navigation
Fixture: a second synthetic season so the catch model fits in CI (#153) - #155
Merged
Merged
Conversation
The fixture had 40 sets in one season, below the catch model's minimum (200 sets, nurseries with at least 30, two seasons), so /drivers never rendered its model section, fit diagnostics or selection chart in tests. - make-fixture.mjs appends a 2022-23 season: 200 sets, one a night over the five sites (40 each), clumped catches that thin out through the season, lemons at Vaiane and Haapiti, recaptures that keep their sex and grow. It uses its own seeded stream, so the 2021-22 workbook and the logger CSVs are unchanged (only the new workbook is added). - On the fixture all three models now fit: 239 sets for all sharks and blacktips, 96 for lemons, theta 2.7; one set lacks a tide value. - catchModel.test.ts fails if the fixture stops fitting; import test counts updated; the diagnostics e2e test no longer has a "no model" branch and runs axe on real fits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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 synthetic fixture had 40 gillnet sets in one season. The catch model needs at least 200 sets, nurseries with at least 30 each, and two seasons, so
catchModel()returned null in CI. The /drivers model section, the fit diagnostics (#151) and the selection chart with a model (#152) were only ever checked by hand on the private data.Changes
scripts/make-fixture.mjsappends a synthetic 2022-23 season. The values are invented by a seeded generator, with no real records.The models now fit on the fixture:
θ is 2.7, so the negative-binomial branch is exercised, not the Poisson limit. One set lacks a tide value, which exercises the "missing variable" sentence.
New
catchModel.test.tsfails if a fixture edit or a threshold change stops any of the three fits converging. Without it, the e2e checks below would quietly lose coverage.import.test.ts: set and season counts updated.e2e/model-diagnostics.spec.ts: the "no model" branch is gone. It now opens the section, runs axe in light and dark on the real fit charts, and switches between all three models.AGENTS.md: a note in the catch-model section.
Checks
pnpm lint,pnpm checkandpnpm test(107 passed).pnpm buildandpnpm test:e2e(37 passed in 1.2 min locally, against 34 in about 50 s before; unit tests also stay quick).Closes #153.
🤖 Generated with Claude Code