I. #406 Refactor and patch GLOBIO msa bugs. #407
Merged
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.
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 wereraster_calculator
tasks but are now wrapped in a function such that passing inraw
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<, >
formsa
value ranges against thedistance_to_infrastructure
raster would thenpop
the<, >
from theraw
dictionary and replace all thenumpty.empty
values for THAT block. However, on subsequent calls thatpop
would return the defaultNone
and thus the ranges for<, >
would not be covered, leaving in randomnumpy.empty
values.That overall problem has been fixed here with more thorough checking of
nodata
values, usingnumpy.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