Spaces:
Sleeping
Sleeping
Merge pull request #93 from MilesCranmer/simplification_fix
Browse filesReverts to SymbolicUtils.jl v0.6 to temporarily fix the simplification backend
- pysr/sr.py +12 -9
- setup.py +1 -1
pysr/sr.py
CHANGED
|
@@ -121,7 +121,7 @@ def pysr(
|
|
| 121 |
weightMutateConstant=10,
|
| 122 |
weightMutateOperator=1,
|
| 123 |
weightRandomize=1,
|
| 124 |
-
weightSimplify=0.
|
| 125 |
perturbationFactor=1.0,
|
| 126 |
extra_sympy_mappings=None,
|
| 127 |
extra_torch_mappings=None,
|
|
@@ -445,19 +445,22 @@ def pysr(
|
|
| 445 |
from julia import Pkg
|
| 446 |
|
| 447 |
Pkg.activate(f"{_escape_filename(julia_project)}")
|
| 448 |
-
|
| 449 |
-
|
| 450 |
Pkg.resolve()
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
|
|
|
|
|
|
|
|
|
| 454 |
Required dependencies are not installed or built. Run the following code in the Python REPL:
|
| 455 |
|
| 456 |
>>> import pysr
|
| 457 |
>>> pysr.install()
|
| 458 |
-
|
| 459 |
Tried to activate project {julia_project} but failed."""
|
| 460 |
-
|
| 461 |
Main.eval("using SymbolicRegression")
|
| 462 |
|
| 463 |
Main.plus = Main.eval("(+)")
|
|
@@ -1044,7 +1047,7 @@ def _write_project_file(tmp_dir):
|
|
| 1044 |
SymbolicRegression = "8254be44-1295-4e6a-a16d-46603ac705cb"
|
| 1045 |
|
| 1046 |
[compat]
|
| 1047 |
-
SymbolicRegression = "0.
|
| 1048 |
julia = "1.5"
|
| 1049 |
"""
|
| 1050 |
|
|
|
|
| 121 |
weightMutateConstant=10,
|
| 122 |
weightMutateOperator=1,
|
| 123 |
weightRandomize=1,
|
| 124 |
+
weightSimplify=0.002,
|
| 125 |
perturbationFactor=1.0,
|
| 126 |
extra_sympy_mappings=None,
|
| 127 |
extra_torch_mappings=None,
|
|
|
|
| 445 |
from julia import Pkg
|
| 446 |
|
| 447 |
Pkg.activate(f"{_escape_filename(julia_project)}")
|
| 448 |
+
try:
|
| 449 |
+
if update:
|
| 450 |
Pkg.resolve()
|
| 451 |
+
Pkg.instantiate()
|
| 452 |
+
else:
|
| 453 |
+
Pkg.instantiate()
|
| 454 |
+
except RuntimeError as e:
|
| 455 |
+
raise ImportError(
|
| 456 |
+
f"""
|
| 457 |
Required dependencies are not installed or built. Run the following code in the Python REPL:
|
| 458 |
|
| 459 |
>>> import pysr
|
| 460 |
>>> pysr.install()
|
| 461 |
+
|
| 462 |
Tried to activate project {julia_project} but failed."""
|
| 463 |
+
) from e
|
| 464 |
Main.eval("using SymbolicRegression")
|
| 465 |
|
| 466 |
Main.plus = Main.eval("(+)")
|
|
|
|
| 1047 |
SymbolicRegression = "8254be44-1295-4e6a-a16d-46603ac705cb"
|
| 1048 |
|
| 1049 |
[compat]
|
| 1050 |
+
SymbolicRegression = "0.7.0"
|
| 1051 |
julia = "1.5"
|
| 1052 |
"""
|
| 1053 |
|
setup.py
CHANGED
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
| 5 |
|
| 6 |
setuptools.setup(
|
| 7 |
name="pysr",
|
| 8 |
-
version="0.7.
|
| 9 |
author="Miles Cranmer",
|
| 10 |
author_email="miles.cranmer@gmail.com",
|
| 11 |
description="Simple and efficient symbolic regression",
|
|
|
|
| 5 |
|
| 6 |
setuptools.setup(
|
| 7 |
name="pysr",
|
| 8 |
+
version="0.7.0a3",
|
| 9 |
author="Miles Cranmer",
|
| 10 |
author_email="miles.cranmer@gmail.com",
|
| 11 |
description="Simple and efficient symbolic regression",
|