prob_at_least_one_new_card drops probability mass for rarities with no cards in the pack and never clamps #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In `apps/tracker/utils.py`, the inner loop does `if total == 0: continue` when a rarity in the generation table has no cards in the pack. That rarity's slot probability is simply removed from `slot_prob_no_new`, so the per-slot distribution no longer sums to 1 and P(no new) is underestimated, i.e. the displayed chance is inflated. In the extreme (all rarities of a slot missing, e.g. slot 6 of a G4 shiny pack applied to a pack without shiny cards) the slot contributes 0 and the chance becomes 100% regardless of collection.
Today this is triggered by A4b (shiny_rare row, no shiny_rare cards) and by any pack whose `rarity_version` points at the wrong generation (see the import_data issue).
Suggested fix: renormalise over the rarities actually present in the pack (divide by the sum of their slot probs), or treat the missing-rarity mass as "no new card", and clamp the final result to [0, 1]. Also run `validate_probabilities` in CI or at the end of `import_data` so bad tables fail loudly instead of producing wrong numbers.