Skip to content

Photosynthesis#17

Merged
AleMorales merged 3 commits into
masterfrom
photosynthesis
Jun 17, 2026
Merged

Photosynthesis#17
AleMorales merged 3 commits into
masterfrom
photosynthesis

Conversation

@AleMorales

Copy link
Copy Markdown
Member

Two main changes:

  • Switch to solving for Ci and then calculating gs in the analytical models of C3 and C4 photosynthesis. This prevents the error in the calculation of gs (thanks to Jorad de Vries for figuring out the bug and a possible fix).

  • To further detect this kind of errors, I added tests that check that certain qualitative properties of response curves are met. Specifically:

  • A increases monotonically with Ca (above compensation point)

  • A increases monotonically with PAR

  • gs increases monotonically with RH

  • Temperature response of A is peaked (interior maximum in 10–40 °C)

  • Net A < 0 in darkness (PAR = 0)

  • CO2 compensation point exists at physiologically appropriate Ca

  • gs ≥ gso over a PAR × Ca grid

  • A decreases monotonically as O2 increases (photorespiration)

Claude Code was used as assistant to help generate the tests.

AleMorales and others added 3 commits June 17, 2026 12:45
Introduces test_C3_properties.jl and test_C4_properties.jl, which test
mathematical invariants of the FvCB model implementations rather than
fixed numeric outputs. Each file covers eight (C3) or seven (C4)
properties: monotonic response of assimilation to Ca, PAR, and
temperature (peaked, with interior maximum in 10-40 C range); monotonic
increase of stomatal conductance with RH; dark respiration (An < 0 at
PAR = 0); CO2 compensation point (sign change at physiologically
appropriate Ca); minimum stomatal conductance (gs >= gso across a grid
of PAR x Ca conditions); and O2 inhibition of assimilation via
photorespiration (C3 only).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AleMorales AleMorales merged commit 9c83eaf into master Jun 17, 2026
1 check passed
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.79%. Comparing base (8bceb96) to head (573830f).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #17      +/-   ##
==========================================
- Coverage   97.24%   93.79%   -3.45%     
==========================================
  Files          10       10              
  Lines         290      290              
==========================================
- Hits          282      272      -10     
- Misses          8       18      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant