Spaces:
Running
Running
deepsource-autofix[bot]
commited on
Commit
•
81cfb5c
1
Parent(s):
52da3ff
Format code with black
Browse files- pysr/sr.py +1 -1
- test/test.py +2 -0
pysr/sr.py
CHANGED
@@ -48,7 +48,7 @@ sympy_mappings = {
|
|
48 |
"plus": lambda x, y: x + y,
|
49 |
"sub": lambda x, y: x - y,
|
50 |
"neg": lambda x: -x,
|
51 |
-
"pow": lambda x, y: x
|
52 |
"pow_abs": lambda x, y: abs(x) ** y,
|
53 |
"cos": sympy.cos,
|
54 |
"sin": sympy.sin,
|
|
|
48 |
"plus": lambda x, y: x + y,
|
49 |
"sub": lambda x, y: x - y,
|
50 |
"neg": lambda x: -x,
|
51 |
+
"pow": lambda x, y: x**y,
|
52 |
"pow_abs": lambda x, y: abs(x) ** y,
|
53 |
"cos": sympy.cos,
|
54 |
"sin": sympy.sin,
|
test/test.py
CHANGED
@@ -93,6 +93,7 @@ class TestPipeline(unittest.TestCase):
|
|
93 |
self.assertIn("1.23456789", model.equations_.iloc[-1]["equation"])
|
94 |
|
95 |
from pysr.sr import Main
|
|
|
96 |
# We should have that the model state is now a Float64 hof:
|
97 |
Main.test_state = model.raw_julia_state_
|
98 |
self.assertTrue(Main.eval("typeof(test_state[2]).parameters[1] == Float64"))
|
@@ -199,6 +200,7 @@ class TestPipeline(unittest.TestCase):
|
|
199 |
)
|
200 |
# Check that the the julia state is saved:
|
201 |
from pysr.sr import Main
|
|
|
202 |
# We should have that the model state is now a Float32 hof:
|
203 |
Main.test_state = regressor.raw_julia_state_
|
204 |
self.assertTrue(Main.eval("typeof(test_state[2]).parameters[1] == Float32"))
|
|
|
93 |
self.assertIn("1.23456789", model.equations_.iloc[-1]["equation"])
|
94 |
|
95 |
from pysr.sr import Main
|
96 |
+
|
97 |
# We should have that the model state is now a Float64 hof:
|
98 |
Main.test_state = model.raw_julia_state_
|
99 |
self.assertTrue(Main.eval("typeof(test_state[2]).parameters[1] == Float64"))
|
|
|
200 |
)
|
201 |
# Check that the the julia state is saved:
|
202 |
from pysr.sr import Main
|
203 |
+
|
204 |
# We should have that the model state is now a Float32 hof:
|
205 |
Main.test_state = regressor.raw_julia_state_
|
206 |
self.assertTrue(Main.eval("typeof(test_state[2]).parameters[1] == Float32"))
|