Repository navigation
Low-count alerts for samples with few stored aliquots - #208
Merged
Merged
Conversation
Closes #196. Co-Authored-By: Claude Sonnet 5.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.
Closes #196
What it does
A sample is flagged when it has few stored aliquots left, with two levels and a per-sample off switch, following the consumables low-stock idea.
SiteConfiguration.low_count_warnandlow_count_alert). A sample can also have its own warn and alert levels, or switch the check off (Sample.low_count_check,low_count_warn,low_count_alert), in its Edit form. An alert level above the warn level is refused; if a sample overrides only one level, the alert level is capped at the warn level.Decisions to check
Not in this PR
Email notifications (Django email is not configured). The attention module's stable keys (
low_count:sample:12) and levels are what an email job should use to avoid repeat alerts.Migrations
sample/0009_low_count_levels(three fields onSample) andperson/0006_low_count_levels(two fields onSiteConfiguration). All have defaults; no data changes.Verification
sample/tests/test_low_count.py(45 tests): what counts (disposition only, no position needed, soft-deleted ignored, no cross-sample leakage, no-aliquot samples skipped, all-used-up is an alert); the level boundaries and overrides; the attention item text, keys and levels; silence and unsilence through the overview and the endpoint; the pill; the Samples list column, badges, filter, pill and sort; the sample page; the form validation; and the Settings form (admin only, validation, audit log, independence from the feature switches). Existing tests that assumed the old counting rules or an always-empty low-count source are updated. Full suite: 737 tests, OK.makemigrations --checkis clean.🤖 Generated with Claude Code