Skip to content

Fixes #234: make_described_run spreads image_count over technical repeats - #236

Merged
guijacquemet merged 3 commits into
mainfrom
claude/described-run-counts
Nov 9, 2026
Merged

guijacquemet merged 3 commits into
mainfrom
claude/described-run-counts

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

Fixes #234

What

make_described_run (testing_described.py) now distributes exactly member.image_count images across the member's technical repeats: image_count // n each, and the first image_count % n units (sorted unit ID) get one more. If image_count < n it raises ValueError naming the member and repeat, before anything is written. The existing _expected() in tests/test_make_described_run.py, which repeated the bug, is corrected.

Why

image_count is the member total over its units (description_reconcile.py:242-263), but the helper wrote it into every technical repeat, so the biological N was wrong while the test passed.

Regression evidence

New tests in tests/test_make_described_run.py, with expected counts read from the parsed v34 description rather than the helper's unit expansion:

  • v34: CTRL/rep1 = 12 FOVs over acq1+acq2 (6+6), DrugA/rep1 = 11 (6+5), both acq1 and acq2 present, and for every (condition_id, repeat_group) the FOV total equals member.image_count (43 FOVs overall).
  • Refusal: v34 with DrugA/rep1 image_count = 1 raises, naming 'DrugA', and writes no experiment folder.

Old code (src reverted, new tests kept): 3 failed, 20 passed. The v34 count test got CTRL/rep1 = 24 (12 per unit) and DrugA/rep1 = 22 (11 per unit), and the refusal case did not raise. With the fix: all pass.

Checks

python tools/check.py (fresh venv, .[dev,notebook,zarr]): exit 0, 4696 passed, 4 skipped (3 case-insensitive filesystem checks, 1 file-mode check running as root), 0 failed.


Generated by Claude Code

…ribed_run

image_count is the member total over its units, but the helper wrote it into each
technical repeat (v34 CTRL/rep1: 24 images instead of 12; DrugA/rep1: 22 instead of 11).
Distribute exactly image_count images, earlier units by sorted ID taking the remainder,
and refuse (ValueError naming the member) when image_count < technical repeats.
Fix the test whose _expected() repeated the bug; add v34 and refusal regressions.

Fixes #234

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
@guijacquemet
guijacquemet merged commit 6dc8c26 into main Nov 9, 2026
7 checks passed
@guijacquemet
guijacquemet deleted the claude/described-run-counts branch November 9, 2026 05:45
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.

make_described_run writes image_count images per technical repeat instead of per member

2 participants