Skip to content

Add winter cereal cold hardiness (LT50) model#133

Open
runck014 wants to merge 4 commits intomasterfrom
feature/winter-injury-model
Open

Add winter cereal cold hardiness (LT50) model#133
runck014 wants to merge 4 commits intomasterfrom
feature/winter-injury-model

Conversation

@runck014
Copy link
Contributor

Summary

  • Adds the Winter Cereal Survival Model (WCSM) from Byrns et al. (2020, Crop Science) to agricultural_modeling
  • Implements daily LT50 simulation based on crown temperature, daylength, and cultivar-specific parameters (acclimation, dehardening, vernalization, respiration stress, LT damage)
  • Includes CLI commands (winter-injury simulate and winter-injury cultivars) and 8 cultivar presets (Norstar, Cougar, Sisler, etc.)
  • Comprehensive test suite (1300+ lines): formula-level golden tests, integration scenarios, process interaction checks, and machine-precision validation against R reference output

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

  • Verify test_winter_injury.py passes (formula tests, integration tests, R reference validation)
  • Test CLI: rtgs agricultural-modeling winter-injury cultivars
  • Test CLI: rtgs agricultural-modeling winter-injury simulate --cultivar Norstar --crown-temp-csv <file> --daylength-csv <file> -o output.csv
  • Verify verification data CSVs are included (force-added past .gitignore)

🤖 Generated with Claude Code

runck014 and others added 4 commits March 17, 2026 19:55
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>
@runck014 runck014 requested a review from zradlicz March 18, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants