From fa882a890b4306424635ae7334a89c97193677b3 Mon Sep 17 00:00:00 2001 From: Ahmet Can Solak Date: Tue, 18 Oct 2022 13:49:53 -0700 Subject: [PATCH] Removing numba deprecation warnings (#262) * initial commit * flake8 fixes Co-authored-by: acs-ws --- aydin/it/normalisers/base.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/aydin/it/normalisers/base.py b/aydin/it/normalisers/base.py index 2d4eef7b..d385079e 100644 --- a/aydin/it/normalisers/base.py +++ b/aydin/it/normalisers/base.py @@ -195,14 +195,16 @@ def denormalise( return array - @jit(parallel=True, error_model='numpy') - def normalize_numba(self, array, min_value, max_value, epsilon): - for _ in prange(numpy.prod(array.shape)): + @staticmethod + @jit(nopython=True, parallel=True, error_model='numpy') + def normalize_numba(array, min_value, max_value, epsilon): + for _ in prange(numpy.prod(numpy.array(array.shape))): array.flat[_] -= min_value array.flat[_] /= max_value - min_value + epsilon - @jit(parallel=True, error_model='numpy') - def denormalize_numba(self, array, min_value, max_value, epsilon): - for _ in prange(numpy.prod(array.shape)): + @staticmethod + @jit(nopython=True, parallel=True, error_model='numpy') + def denormalize_numba(array, min_value, max_value, epsilon): + for _ in prange(numpy.prod(numpy.array(array.shape))): array.flat[_] *= max_value - min_value + epsilon array.flat[_] += min_value