Skip to content

test: pin CTI log-likelihood values for dataset_1d and imaging_ci - #25

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/cti-likelihood-pins
Nov 4, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/cti-likelihood-pins

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

autocti_workspace_test had no pinned log-likelihood values, so a CTI library PR, or the arcticpy upgrade planned in cti-upkeep phase 2, could change likelihood values without any test catching it. This adds NumPy-path pins in the same style as the jax_likelihood/ pins in the lens and galaxy test workspaces. Closes #24 (cti-upkeep phase 0b).

Each script simulates a noise-free dataset (read_noise=None, no Poisson noise, the simulator's constant noise map) and pins analysis.log_likelihood_function at rtol=1e-8 for two models:

  • truth: chi² is 0, so the value is the noise normalization.
  • offset: trap density ×1.2 and release timescale ×0.8, so the value tests arctic clocking and the chi² path.

Provenance: # pinned 2026-11-04: autocti main@2a91ff5d, arcticpy 2.6.

Scripts Changed

  • scripts/dataset_1d/likelihood/pins.py: new. Covers 1 and 2 trap species at two injection levels; about 2.4 s.
  • scripts/imaging_ci/likelihood/pins.py: new. Covers parallel-only, serial-only and parallel+serial clocking; about 2.4 s.
  • smoke_tests.txt: adds both scripts.
  • AGENTS.md: documents the re-pin rule. A pin moves only with a dated comment naming the PR and the cause; the arcticpy version is part of each pin's provenance; tolerances are never loosened.

model_fit.py and legacy/ are unchanged. There are no library changes.

Test Plan

  • python .github/scripts/run_smoke.py: all 5 scripts pass locally (Python 3.13, arcticpy 2.6).
  • Control test: a 1 % change to the offset trap density makes both scripts fail.
    • dataset_1d (1 species, offset): ACTUAL -18070.239608 vs pinned -16244.662767, giving AssertionError.
    • imaging_ci (parallel, offset): ACTUAL -2144.824963 vs pinned -1804.171419, giving AssertionError.
  • Per-PR Smoke Tests green in CI.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

Add scripts/{dataset_1d,imaging_ci}/likelihood/pins.py. Each simulates a
noise-free dataset and pins analysis.log_likelihood_function at the truth
model and at an offset model (density x1.2, release timescale x0.8), at
rtol=1e-8: 1 and 2 trap species (1D); parallel, serial and parallel+serial
(2D). Both scripts are added to smoke_tests.txt, and the re-pin rule is
documented in AGENTS.md.

Closes #24 (cti-upkeep phase 0b).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 72970e7 into main Nov 4, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/cti-likelihood-pins branch November 4, 2026 20:57
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.

test: pin CTI log-likelihood values for dataset_1d and imaging_ci

1 participant