diff --git a/src/aws/osml/model_runner/tile_worker/tile_worker_utils.py b/src/aws/osml/model_runner/tile_worker/tile_worker_utils.py index 036e3fc8..99797455 100755 --- a/src/aws/osml/model_runner/tile_worker/tile_worker_utils.py +++ b/src/aws/osml/model_runner/tile_worker/tile_worker_utils.py @@ -103,7 +103,7 @@ def process_tiles( """ tile_array = generate_crops( - region_request.region_bounds, # type: ignore[arg-type] + region_request.region_bounds, region_request.tile_size, region_request.tile_overlap, ) diff --git a/test/aws/osml/model_runner/tile_worker/test_tile_worker_utils.py b/test/aws/osml/model_runner/tile_worker/test_tile_worker_utils.py index 69802427..6e3238a1 100755 --- a/test/aws/osml/model_runner/tile_worker/test_tile_worker_utils.py +++ b/test/aws/osml/model_runner/tile_worker/test_tile_worker_utils.py @@ -63,21 +63,17 @@ def test_setup_tile_workers_exception(self, mock_service_config, mock_tile_worke # with self.assertRaises(ValueError): setup_tile_workers(mock_region_request, mock_sensor_model, mock_elevation_model) - @patch("aws.osml.model_runner.tile_worker.tile_worker_utils.ServiceConfig", autospec=True) def test_process_tiles( self, - mock_service_config, ): from aws.osml.gdal.gdal_utils import load_gdal_dataset from aws.osml.model_runner.api import RegionRequest from aws.osml.model_runner.tile_worker.tile_worker_utils import process_tiles, setup_tile_workers - mock_num_tile_workers = 4 - mock_service_config.workers = mock_num_tile_workers mock_region_request = RegionRequest( { "tile_size": (10, 10), - "tile_overlap": (1, 1), + "tile_overlap": (0, 0), "tile_format": "NITF", "image_id": "1", "image_url": "/mock/path", @@ -91,7 +87,7 @@ def test_process_tiles( mock_elevation_model = None work_queue, tile_worker_list = setup_tile_workers(mock_region_request, sensor_model, mock_elevation_model) - assert 25, 0 == process_tiles( + completed_tiles, failed_tiles = process_tiles( region_request=mock_region_request, tile_queue=work_queue, tile_workers=tile_worker_list, @@ -99,6 +95,9 @@ def test_process_tiles( sensor_model=sensor_model, ) + assert completed_tiles == 25 + assert failed_tiles == 0 + def test_chip_generator(self): from aws.osml.model_runner.tile_worker.tile_worker_utils import generate_crops