Skip to content

Commit

Permalink
Include test of multi-line seval
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Feb 10, 2024
1 parent 7acebb6 commit 673e8d5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pysr/test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ def test_multiprocessing_turbo_custom_objective(self):
# Test options stored:
self.assertEqual(model.julia_options_.turbo, True)

def test_multiline_seval(self):
if jl.seval('VERSION >= v"1.9"'):
# The user should be able to run multiple things in a single seval call:
num = jl.seval(
"""
function my_new_objective(x)
x^2
end
1.5
"""
)
self.assertEqual(num, 1.5)

def test_high_precision_search_custom_loss(self):
y = 1.23456789 * self.X[:, 0]
model = PySRRegressor(
Expand Down

0 comments on commit 673e8d5

Please sign in to comment.