Promote a simulated count too big for int16 instead of refusing it - #4
Merged
Merged
Conversation
PR #3 declared both in pyproject.toml without relocking, so every `pixi run` rewrote the lock's metadata for the watteg package. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sceptre's fitted mean for a very highly expressed gene can reach far past anything observed in the cells with extreme covariates. HBA2 in DC-TAP K562 has an observed maximum of 6,583 and a fitted mean of 20,104 in its most extreme cell, so NB(20,104, theta 2.1) passes 32,767 about one draw in seven, and every simulation task on that screen failed with an OverflowError. Those are legitimate draws from the model the test assumes, so draw_counts now returns the narrowest of int16/int32/int64 that holds the largest draw. No value is wrapped or clipped, and a draw that fits int16 is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Summary
draw_countsreturned simulated counts as int16 and raisedOverflowErrorwhen a draw passed 32,767. The comment assumed no real screen gets close (largest observed count 2,717).draw_countsnow returns the narrowest of int16, int32 or int64 that holds the largest draw. Nothing is wrapped or clipped, and any draw that fits in int16 comes back exactly as before.pixi.lockwith the anndata/mudata entries that PR CI: put pysceptre's scripts/ on PYTHONPATH for the Nextflow DAG step #3 added topyproject.toml. Without that, everypixi runrewrote the lock.Test plan
pixi run -e dev pytest tests/: 78 passed. The int16 test now checks that an oversized draw comes back as int32 and equals the full-width draw.--driver engine --null-fits refit, 8 workers) failed before the change and completes after it, in 171 s.🤖 Generated with Claude Code