From 75e17d4afd02e26cd07bbc4cb89cc48ab013d6fd Mon Sep 17 00:00:00 2001 From: ashmeigh Date: Thu, 18 Jul 2024 12:19:27 +0100 Subject: [PATCH] fixing errors --- mantidimaging/core/gpu/utility.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mantidimaging/core/gpu/utility.py b/mantidimaging/core/gpu/utility.py index 4e5c0eb44de..912b5bc58d5 100644 --- a/mantidimaging/core/gpu/utility.py +++ b/mantidimaging/core/gpu/utility.py @@ -158,7 +158,7 @@ def _create_block_and_grid_args(data: cp.ndarray): return block_size, grid_size -def _create_padded_array(data: np.ndarray, filter_size: int, scipy_mode: str) -> np.ndarray: +def _create_padded_array(data, filter_size, scipy_mode): """ Creates the padded array on the CPU for the median filter. :param data: The data array to be padded. @@ -168,9 +168,7 @@ def _create_padded_array(data: np.ndarray, filter_size: int, scipy_mode: str) -> """ # Use the 'mode' argument that is ordinarily given to 'scipy' and determine its numpy.pad equivalent. pad_size = _get_padding_value(filter_size) - pad_width = ((pad_size, pad_size), (pad_size, pad_size)) - mode = EQUIVALENT_PAD_MODE.get(scipy_mode, 'constant') - return np.pad(data, pad_width=pad_width, mode=mode) + return np.pad(data, pad_width=((pad_size, pad_size), (pad_size, pad_size)), mode=EQUIVALENT_PAD_MODE[scipy_mode]) def _replace_gpu_array_contents(gpu_array: cp.ndarray, cpu_array: np.ndarray, stream: cp.cuda.Stream) -> None: