diff --git a/pysr/export_sympy.py b/pysr/export_sympy.py index 3c3c5f931..3ea0baf06 100644 --- a/pysr/export_sympy.py +++ b/pysr/export_sympy.py @@ -50,6 +50,7 @@ "max": lambda x, y: sympy.Piecewise((y, x < y), (x, True)), "min": lambda x, y: sympy.Piecewise((x, x < y), (y, True)), "round": lambda x: sympy.ceiling(x - 0.5), + "cond": lambda x, y: sympy.Heaviside(x, H0=0) * y, } diff --git a/pysr/julia_helpers.py b/pysr/julia_helpers.py index 7918c5e6d..e2f76090c 100644 --- a/pysr/julia_helpers.py +++ b/pysr/julia_helpers.py @@ -94,7 +94,15 @@ def install(julia_project=None, quiet=False, precompile=None): # pragma: no cov ], ) # Try installing again: - julia.install(quiet=quiet) + try: + julia.install(quiet=quiet) + except julia.tools.PyCallInstallError: + warnings.warn( + "PyCall.jl failed to install on second attempt. " + + "Please consult the GitHub issue " + + "https://github.com/MilesCranmer/PySR/issues/257 " + + "for advice on fixing this." + ) Main, init_log = init_julia(julia_project, quiet=quiet, return_aux=True) io_arg = _get_io_arg(quiet) diff --git a/pysr/version.py b/pysr/version.py index 4260786a0..8a8995f2f 100644 --- a/pysr/version.py +++ b/pysr/version.py @@ -1,2 +1,2 @@ -__version__ = "0.16.3" -__symbolic_regression_jl_version__ = "0.22.4" +__version__ = "0.16.4" +__symbolic_regression_jl_version__ = "0.22.5"