Spaces:
Sleeping
Sleeping
Merge pull request #482 from MilesCranmer:create-pull-request/patch
Browse files- pysr/export_sympy.py +1 -0
- pysr/julia_helpers.py +9 -1
- pysr/version.py +2 -2
pysr/export_sympy.py
CHANGED
|
@@ -50,6 +50,7 @@ sympy_mappings = {
|
|
| 50 |
"max": lambda x, y: sympy.Piecewise((y, x < y), (x, True)),
|
| 51 |
"min": lambda x, y: sympy.Piecewise((x, x < y), (y, True)),
|
| 52 |
"round": lambda x: sympy.ceiling(x - 0.5),
|
|
|
|
| 53 |
}
|
| 54 |
|
| 55 |
|
|
|
|
| 50 |
"max": lambda x, y: sympy.Piecewise((y, x < y), (x, True)),
|
| 51 |
"min": lambda x, y: sympy.Piecewise((x, x < y), (y, True)),
|
| 52 |
"round": lambda x: sympy.ceiling(x - 0.5),
|
| 53 |
+
"cond": lambda x, y: sympy.Heaviside(x, H0=0) * y,
|
| 54 |
}
|
| 55 |
|
| 56 |
|
pysr/julia_helpers.py
CHANGED
|
@@ -94,7 +94,15 @@ def install(julia_project=None, quiet=False, precompile=None): # pragma: no cov
|
|
| 94 |
],
|
| 95 |
)
|
| 96 |
# Try installing again:
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
Main, init_log = init_julia(julia_project, quiet=quiet, return_aux=True)
|
| 100 |
io_arg = _get_io_arg(quiet)
|
|
|
|
| 94 |
],
|
| 95 |
)
|
| 96 |
# Try installing again:
|
| 97 |
+
try:
|
| 98 |
+
julia.install(quiet=quiet)
|
| 99 |
+
except julia.tools.PyCallInstallError:
|
| 100 |
+
warnings.warn(
|
| 101 |
+
"PyCall.jl failed to install on second attempt. "
|
| 102 |
+
+ "Please consult the GitHub issue "
|
| 103 |
+
+ "https://github.com/MilesCranmer/PySR/issues/257 "
|
| 104 |
+
+ "for advice on fixing this."
|
| 105 |
+
)
|
| 106 |
|
| 107 |
Main, init_log = init_julia(julia_project, quiet=quiet, return_aux=True)
|
| 108 |
io_arg = _get_io_arg(quiet)
|
pysr/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
__version__ = "0.16.
|
| 2 |
-
__symbolic_regression_jl_version__ = "0.22.
|
|
|
|
| 1 |
+
__version__ = "0.16.4"
|
| 2 |
+
__symbolic_regression_jl_version__ = "0.22.5"
|