Vectorize phenology#112
Open
fnattino wants to merge 2 commits into
Open
Conversation
This was referenced Apr 22, 2026
|
| # TODO: revisit this when fixing engine for agromanager, see issue #60 | ||
| if torch.any(should_mature) and p.CROP_END_TYPE in ["maturity", "earliest"]: | ||
| # Send crop_finish signal if maturity reached for all. | ||
| if torch.all(s.STAGE == 3) and p.CROP_END_TYPE in ["maturity", "earliest"]: |
Collaborator
There was a problem hiding this comment.
The change from torch.any(...) to torch.all(...) here is fine as this is the work in progress. But please note that the reason that tests are passing is that we assumed that STAGE is the same for all inputs, if STAGE is an array we select the first item, see get_variable in tests. The reason is that currently in Engine there is no mechanism to handle none weather data when a matured crop is waiting for others.
SarahAlidoost
approved these changes
May 12, 2026
Collaborator
SarahAlidoost
left a comment
There was a problem hiding this comment.
@fnattino thanks! just a comment about STAGE as a reminder for ourselves. please feel free to merge.
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.



As part of #60, we should make sure the phenology model can run even if some elements have reached maturity.