Skip to content

Commit

Permalink
handle non-numba case
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed Mar 20, 2024
1 parent 6a3e5ec commit b6e8a84
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ioos_qc/qartod.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b6e8a84

Please sign in to comment.