Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
2621d76
1
Parent(s):
bbec288
Include check for extra_sympy_mappings not None
Browse files- pysr/sr.py +3 -1
pysr/sr.py
CHANGED
@@ -139,7 +139,9 @@ def _maybe_create_inline_operators(
|
|
139 |
"Only alphanumeric characters, numbers, "
|
140 |
"and underscores are allowed."
|
141 |
)
|
142 |
-
if not
|
|
|
|
|
143 |
raise ValueError(
|
144 |
f"Custom function {function_name} is not defined in :param`extra_sympy_mappings`. "
|
145 |
"You can define it with, "
|
|
|
139 |
"Only alphanumeric characters, numbers, "
|
140 |
"and underscores are allowed."
|
141 |
)
|
142 |
+
if (extra_sympy_mappings is not None) and (
|
143 |
+
not function_name in extra_sympy_mappings
|
144 |
+
):
|
145 |
raise ValueError(
|
146 |
f"Custom function {function_name} is not defined in :param`extra_sympy_mappings`. "
|
147 |
"You can define it with, "
|