File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 99import site
1010import warnings
1111
12- import numba
13-
1412CACHE_WARNING = "Caching `numba` functions is purely for experimental purposes "
1513CACHE_WARNING += "and should never be used or depended upon as it is not supported! "
1614CACHE_WARNING += "All caching capabilities are not tested and may be removed/changed "
@@ -131,16 +129,21 @@ def _recompile(func=None, fastmath=None):
131129 None
132130 """
133131 warnings .warn (CACHE_WARNING )
132+ njit_funcs = get_njit_funcs ()
133+
134+ recompile_funcs = []
134135 if func is None :
135- njit_funcs = get_njit_funcs ()
136136 for module_name , func_name in njit_funcs :
137137 module = importlib .import_module (f".{ module_name } " , package = "stumpy" )
138138 func = getattr (module , func_name )
139- func .recompile ()
139+ recompile_funcs .append (func )
140+ elif func in njit_funcs :
141+ recompile_funcs .append (func )
140142 else :
141- if not numba .extending .is_jitted (func ):
142- msg = "The function `func` must be a (n)jit function."
143- raise ValueError (msg )
143+ msg = "The function `func` is not a njit function in STUMPY"
144+ raise ValueError (msg )
145+
146+ for func in recompile_funcs :
144147 if fastmath is not None :
145148 func .targetoptions ["fastmath" ] = fastmath
146149 func .recompile ()
You can’t perform that action at this time.
0 commit comments