Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I. #406 Refactor and patch GLOBIO msa bugs. #407

Conversation

dcdenu4
Copy link
Member

@dcdenu4 dcdenu4 commented Dec 8, 2020

Description

Fixes #406

The following problems were discovered when eye spotting the sample data results.

This PR refactors the msa operations to fix masking and dictionary mutation issues. These operations were raster_calculator tasks but are now wrapped in a function such that passing in raw static types can be avoided which provides cleaner code within the operation itself.

The big issue was the operations initiating the result with numpy.empty which creates random initial values. The sequence of checking <, > for msa value ranges against the distance_to_infrastructure raster would then pop the <, > from the raw dictionary and replace all the numpty.empty values for THAT block. However, on subsequent calls that pop would return the default None and thus the ranges for <, > would not be covered, leaving in random numpy.empty values.

That overall problem has been fixed here with more thorough checking of nodata values, using numpy.full_like with an initial value of the output nodata value.

These changes had no effect on current state of tests for this model.

First noted issue in #402

Checklist

  • Updated HISTORY.rst (if these changes are user-facing)

@dcdenu4 dcdenu4 merged commit 5480e8c into natcap:release/3.9 Dec 9, 2020
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