Skip to content

Implement differentiable WaterbalanceFD#118

Merged
SCiarella merged 25 commits into
mainfrom
waterbalanced
May 18, 2026
Merged

Implement differentiable WaterbalanceFD#118
SCiarella merged 25 commits into
mainfrom
waterbalanced

Conversation

@SCiarella
Copy link
Copy Markdown
Collaborator

@SCiarella SCiarella commented May 8, 2026

Closes #116.

This PR introduces a differentiable and vectorized version of WaterbalanceFD in diffwofost.

The implementation is tested similarly to WaterbalancePP, so there are some specific unit tests for the class, the differentiability and vectorization is tested, and also the integration in wofost72. I am not sure if specific data for WaterbalanceFD exist similarly to the waterlimited_production, so the numerical results are not compared against pcse.

@SCiarella SCiarella requested a review from SarahAlidoost May 8, 2026 10:07
Copy link
Copy Markdown
Collaborator

@SarahAlidoost SarahAlidoost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SCiarella thanks, looks great 👍 . I left some comments, let me know if something is unclear. Another thing, can you please add the API reference to the documentation too?

Comment thread src/diffwofost/physical_models/soil/classic_waterbalance.py Outdated
Comment thread src/diffwofost/physical_models/soil/classic_waterbalance.py Outdated
Comment thread src/diffwofost/physical_models/soil/classic_waterbalance.py Outdated
Comment thread src/diffwofost/physical_models/soil/classic_waterbalance.py Outdated
Comment thread src/diffwofost/physical_models/soil/classic_waterbalance.py Outdated
Comment thread src/diffwofost/physical_models/soil/classic_waterbalance.py
Comment thread src/diffwofost/physical_models/soil/classic_waterbalance.py Outdated
Comment thread src/diffwofost/physical_models/soil/classic_waterbalance.py Outdated
Comment thread tests/physical_models/crop/test_wofost72.py Outdated
Comment thread tests/physical_models/soil/test_waterbalance.py
SCiarella and others added 23 commits May 12, 2026 13:15
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
Co-authored-by: SarahAlidoost <55081872+SarahAlidoost@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@SCiarella
Copy link
Copy Markdown
Collaborator Author

@SarahAlidoost Thanks for the review!

I have implemented your comments and updated tests and documentation.

@SCiarella SCiarella requested a review from SarahAlidoost May 12, 2026 16:08
Copy link
Copy Markdown
Collaborator

@SarahAlidoost SarahAlidoost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SCiarella thanks for addressing the comments 👍 let's merge it.

@SCiarella SCiarella merged commit 3b8d5af into main May 18, 2026
11 checks passed
@SCiarella SCiarella deleted the waterbalanced branch May 18, 2026 10:34
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.

[Task] Make wofost_72_WLP_CWB differentiable and vectorized

2 participants