Skip to content

Fix bug in initial stock rasters w/ NaNs not initializing to 0#34

Merged
katieb1 merged 2 commits intomainfrom
kb-stsim-119
Jul 29, 2025
Merged

Fix bug in initial stock rasters w/ NaNs not initializing to 0#34
katieb1 merged 2 commits intomainfrom
kb-stsim-119

Conversation

@katieb1
Copy link
Member

@katieb1 katieb1 commented Jul 28, 2025

No description provided.

@katieb1 katieb1 requested a review from alexembrey July 28, 2025 23:18
@katieb1
Copy link
Member Author

katieb1 commented Jul 28, 2025

Related to this Jira issue: https://apexrms.atlassian.net/browse/STSIM-119

@katieb1 katieb1 merged commit 6287149 into main Jul 29, 2025
@katieb1 katieb1 deleted the kb-stsim-119 branch July 29, 2025 18:44
Copy link
Collaborator

@alexembrey alexembrey left a comment

Choose a reason for hiding this comment

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

I'm not entirely confident about what will happen to these comparisons if v == NaN. See:
https://learn.microsoft.com/en-us/dotnet/api/system.double.nan?view=net-9.0

Consider something like the following?

if (v.IsNaN || v.IsNegativeInfinity())
{
    v = 0.0
}
else
{
    ...
}

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