Skip to content

Make 'assimilation' differentiable/vectorized#71

Merged
SCiarella merged 18 commits into
mainfrom
assimilation
Jan 15, 2026
Merged

Make 'assimilation' differentiable/vectorized#71
SCiarella merged 18 commits into
mainfrom
assimilation

Conversation

@SCiarella
Copy link
Copy Markdown
Collaborator

@SCiarella SCiarella commented Jan 12, 2026

closes #42

Comment thread src/diffwofost/physical_models/crop/assimilation.py Outdated
Comment thread src/diffwofost/physical_models/crop/assimilation.py Outdated
Comment thread src/diffwofost/physical_models/crop/assimilation.py Outdated
Comment thread src/diffwofost/physical_models/crop/assimilation.py
Comment thread src/diffwofost/physical_models/crop/assimilation.py Outdated
Comment thread src/diffwofost/physical_models/crop/assimilation.py Outdated
Comment thread src/diffwofost/physical_models/crop/assimilation.py
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 I suggested a few changes so the tests can pass. If you agree, let's implement the suggestions. If something not clear, let me know.

SCiarella and others added 8 commits January 13, 2026 17:34
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>
@SCiarella SCiarella marked this pull request as ready for review January 13, 2026 16:45
@SCiarella
Copy link
Copy Markdown
Collaborator Author

@SarahAlidoost thanks for the suggestions! I have implemented all of them. I think that masking the average was the crucial point, causing the failure of the tests.

Comment thread src/diffwofost/physical_models/crop/assimilation.py Outdated
Comment thread src/diffwofost/physical_models/crop/assimilation.py Outdated
Comment thread src/diffwofost/physical_models/crop/assimilation.py Outdated
Comment thread src/diffwofost/physical_models/crop/assimilation.py Outdated
Comment thread src/diffwofost/physical_models/crop/assimilation.py
return {"PGASS": torch.stack([item["PGASS"] for item in results])}


def _afgen_y_mask(table_1d: torch.Tensor) -> torch.Tensor:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this function is better to be in utils.

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 comments. Just some minor changes for doctring and a test function that can be moved to utils. Then go ahead with merging 👍

SCiarella and others added 6 commits January 15, 2026 11:51
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 SCiarella merged commit a1550f1 into main Jan 15, 2026
11 checks passed
@SCiarella SCiarella deleted the assimilation branch January 15, 2026 11:38
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 Assimilation differentiable and efficient

2 participants