MilesCranmer commited on
Commit
a4261d1
2 Parent(s): 3fbfdc9 1b34e61

Merge pull request #93 from MilesCranmer/simplification_fix

Browse files

Reverts to SymbolicUtils.jl v0.6 to temporarily fix the simplification backend

Files changed (2) hide show
  1. pysr/sr.py +12 -9
  2. 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.01,
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
- if update:
449
- try:
450
  Pkg.resolve()
451
- except RuntimeError as e:
452
- raise ImportError(
453
- f"""
 
 
 
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
- ) from e
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.6.19"
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.0a2",
9
  author="Miles Cranmer",
10
  author_email="[email protected]",
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="[email protected]",
11
  description="Simple and efficient symbolic regression",