From b6e8a8429c86cf84668d12b82ee842796ae96040 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Wed, 20 Mar 2024 13:23:56 -0300 Subject: [PATCH] handle non-numba case --- ioos_qc/qartod.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ioos_qc/qartod.py b/ioos_qc/qartod.py index cb4114c..80336cf 100644 --- a/ioos_qc/qartod.py +++ b/ioos_qc/qartod.py @@ -10,6 +10,11 @@ import numpy as np import pandas as pd +try: + from numba.core.errors import NumbaTypeError +except ImportError: + NumbaTypeError = TypeError + from ioos_qc.utils import ( isnan, isfixedlength, @@ -738,9 +743,8 @@ def attenuated_signal_test(inp : Sequence[N], def window_func(w): # When pandas>=1.0 and numba are installed, this is about twice as fast try: - import numba return w.apply(np.ptp, raw=True, engine='numba') - except (ImportError, TypeError, numba.core.errors.NumbaTypeError): + except (ImportError, TypeError, NumbaTypeError): return w.apply(np.ptp, raw=True) check_func = np.ptp else: