Skip to content

Commit 8a45f6e

Browse files
committed
minor change to improve readability
1 parent d99148a commit 8a45f6e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

stumpy/fastmath.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ def set_flag(module_name, func_name, flag=None):
7171
-------
7272
None
7373
"""
74-
module = importlib.import_module(f".{module_name}", package="stumpy")
75-
func = getattr(module, func_name)
76-
7774
funcs_flags = get_default_fastmath(module_name)
7875
if func_name not in funcs_flags.keys():
7976
msg = f"The module `{module_name}` does not have a njit function `{func_name}`"
@@ -84,6 +81,8 @@ def set_flag(module_name, func_name, flag=None):
8481
flag = default_flag
8582

8683
if flag is not None:
84+
module = importlib.import_module(f".{module_name}", package="stumpy")
85+
func = getattr(module, func_name)
8786
func.targetoptions["fastmath"] = flag
8887
func.recompile()
8988

0 commit comments

Comments
 (0)