first commit

This commit is contained in:
Alberto-Audrix committed 2026-08-26 13:46:05 +07:00
commit 367533c02b
171 files changed
+101175

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
"""Generate chicken_weight.chicken_count as weigh-sample size (not leftover birds)."""
from __future__ import annotations
import random
# Deterministic: same cycle always gets the same sample sizes.
SAMPLE_RNG_SEED = 20260522
SAMPLE_MIN = 180
SAMPLE_MAX = 320
def weigh_sample_count(*, average_weight: float, rng: random.Random | None = None) -> int:
"""Birds used to compute that day's average_weight.
0 when there is no BW reading (age 38+ user decision).
"""
if average_weight is None or float(average_weight) <= 0:
return 0
rng = rng or random.Random(SAMPLE_RNG_SEED)
return rng.randint(SAMPLE_MIN, SAMPLE_MAX)