Skip to content

Vectorize phenology#112

Open
fnattino wants to merge 2 commits into
mainfrom
60-vectorize-phenology
Open

Vectorize phenology#112
fnattino wants to merge 2 commits into
mainfrom
60-vectorize-phenology

Conversation

@fnattino
Copy link
Copy Markdown
Collaborator

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

@sonarqubecloud
Copy link
Copy Markdown

# 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"]:
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.

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.

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.

@fnattino thanks! just a comment about STAGE as a reminder for ourselves. please feel free to merge.

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