diff --git a/HISTORY.rst b/HISTORY.rst index c6d83b566f..d56a4aae2d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -84,6 +84,9 @@ Unreleased Changes than 2^31 pixels, the model would crash with an error relating to a negative (overflowed) index. https://github.com/natcap/invest/issues/1431 * Pollination + * Fixed a regression where nodata values were not being properly compared. + This was only an issue in some development builds after 3.14.0. + (`#1458 `_) * Replaced custom kernel implementation with ``pygeoprocessing.kernels``. Convolution results may be slightly different (more accurate). * SDR diff --git a/src/natcap/invest/pollination.py b/src/natcap/invest/pollination.py index f6fe6d221b..60def5ec3e 100644 --- a/src/natcap/invest/pollination.py +++ b/src/natcap/invest/pollination.py @@ -854,7 +854,8 @@ def execute(args): foraged_flowers_index_path, floral_resources_index_path_map[species], convolve_ps_path], - target_path=pollinator_abundance_path), + target_path=pollinator_abundance_path, + target_nodata=_INDEX_NODATA), dependent_task_list=[ foraged_flowers_index_task_map[(species, season)], floral_resources_index_task_map[species], @@ -1430,7 +1431,9 @@ def _multiply_by_scalar(raster_path, scalar, target_path): pygeoprocessing.raster_map( op=lambda array: array * scalar, rasters=[raster_path], - target_path=target_path) + target_path=target_path, + target_nodata=_INDEX_NODATA, + ) def _calculate_pollinator_supply_index( @@ -1451,7 +1454,9 @@ def _calculate_pollinator_supply_index( pygeoprocessing.raster_map( op=lambda f_r, h_n: species_abundance * f_r * h_n, rasters=[habitat_nesting_suitability_path, floral_resources_path], - target_path=target_path) + target_path=target_path, + target_nodata=_INDEX_NODATA + ) @validation.invest_validator