Add winter cereal cold hardiness (LT50) model#133
Open
Conversation
Implement the Winter Cereal Survival Model (WCSM) from Byrns et al. (2020, Crop Science) as a new module in agricultural_modeling. The model simulates daily LT50 evolution based on crown temperature, daylength, and cultivar-specific parameters using Euler integration. Includes: - winter_injury.py: model core, cultivar presets, simulation runner - CLI commands: simulate (run model from CSV inputs) and cultivars (list presets) - Comprehensive test suite with golden tests for all formulas, integration scenarios, process interaction checks, and R reference validation - Verification data: R reference output generated from the original R code (deSolve::ode, method='euler') confirming machine-precision agreement Scientific references: - Byrns, Greer, & Fowler (2020). Crop Science, 60, 2408-2419 - Fowler & Limin (2004), Porter & Gawith (1999), Bergjord et al. (2008) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
zradlicz
approved these changes
Mar 19, 2026
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
agricultural_modelingwinter-injury simulateandwinter-injury cultivars) and 8 cultivar presets (Norstar, Cougar, Sisler, etc.)Attribution
Mathematical formulas are from published literature (Byrns et al. 2020; Fowler & Limin 2004; Porter & Gawith 1999; Bergjord et al. 2008). The original R implementation (GPL-3, University of Saskatchewan) was used for output validation only — this Python code is an independent implementation of the published equations.
Test plan
test_winter_injury.pypasses (formula tests, integration tests, R reference validation)rtgs agricultural-modeling winter-injury cultivarsrtgs agricultural-modeling winter-injury simulate --cultivar Norstar --crown-temp-csv <file> --daylength-csv <file> -o output.csv🤖 Generated with Claude Code