Skip to content

Commit

Permalink
Adding a test for when the LULC has no nodata value. RE:natcap#1293
Browse files Browse the repository at this point in the history
  • Loading branch information
phargogh committed Sep 19, 2024
1 parent b6339e6 commit e6eb1a0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_urban_nature_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,21 @@ def test_core_model(self):
self.assertAlmostEqual(numpy.min(valid_pixels), 1171.7352294921875)
self.assertAlmostEqual(numpy.max(valid_pixels), 11898.0712890625)

def test_no_lulc_nodata(self):
"""UNA: verify behavior when the LULC has no nodata value."""
from natcap.invest import urban_nature_access

args = _build_model_args(self.workspace_dir)
args['search_radius_mode'] = urban_nature_access.RADIUS_OPT_UNIFORM
args['search_radius'] = 100

raster = gdal.OpenEx(args['lulc_raster_path'], gdal.OF_RASTER)
band = raster.GetRasterBand(1)
band.DeleteNoDataValue()
band = None
raster = None
urban_nature_access.execute(args)

def test_split_urban_nature(self):
from natcap.invest import urban_nature_access

Expand Down

0 comments on commit e6eb1a0

Please sign in to comment.