Skip to content

Commit 04eac83

Browse files
committed
Add shell script code to check for harcoded fastmath flags
1 parent 2369e33 commit 04eac83

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

stumpy/fastmath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from . import config
66

77

8-
@njit(fastmath=True)
8+
@njit(fastmath=config.STUMPY_FASTMATH_TRUE)
99
def _add_assoc(x, y): # pragma: no cover
1010
"""
1111
A dummy function to test the fastmath module

test.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ check_fastmath()
9898
echo "Checking Missing fastmath flags in njit functions"
9999
./fastmath.py --check stumpy
100100
check_errs $?
101+
102+
echo "Checking hardcoded fastmath flags in njit functions"
103+
if [[ $(grep -n fastmath= stumpy/*py | grep -vE 'fastmath=config' | wc -l) -gt "0" ]]; then
104+
grep -n fastmath= stumpy/*py | grep -vE 'fastmath=config'
105+
echo "Found one or more \`@njit()\` functions with a hardcoded \`fastmath\` flag."
106+
exit 1
107+
fi
101108
}
102109

103110
check_naive()

0 commit comments

Comments
 (0)