Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conda forge installs #202

Merged
merged 13 commits into from
Oct 10, 2022
Merged
5 changes: 2 additions & 3 deletions .github/workflows/CI_conda_forge.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: conda-forge

# This CI tries the conda-forge version of PYSR
# This CI tries the conda-forge version of PySR

on:
schedule:
Expand Down Expand Up @@ -33,12 +33,11 @@ jobs:
auto-activate-base: true
python-version: ${{ matrix.python-version }}
activate-environment: test
use-mamba: ${{ matrix.use-mamba }}
- name: "Install pysr with mamba"
run: conda activate test && mamba install pysr
if: ${{ matrix.use-mamba }}
- name: "Install pysr with conda"
run: conda activate test && conda install pysr
if: ${{ !matrix.use-mamba }}
- name: "Run tests"
run: conda activate test && python3 -m unittest test.test && python3 -m unittest test.test_env
run: conda activate test && python3 -m unittest test.test
14 changes: 10 additions & 4 deletions pysr/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,11 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
Default gives the Python package directory, where a
Project.toml file should be present from the install.
update: bool
Whether to automatically update Julia packages.
Default is `True`.
Whether to automatically update Julia packages when `fit` is called.
You should make sure that PySR is up-to-date itself first, as
the packaged Julia packages may not necessarily include all
updated dependencies.
Default is `False`.
output_jax_format : bool
Whether to create a 'jax_format' column in the output,
containing jax-callable functions and the default parameters in
Expand Down Expand Up @@ -700,7 +703,7 @@ def __init__(
tempdir=None,
delete_tempfiles=True,
julia_project=None,
update=True,
update=False,
output_jax_format=False,
output_torch_format=False,
extra_sympy_mappings=None,
Expand Down Expand Up @@ -1473,7 +1476,10 @@ def _run(self, X, y, mutated_params, weights, seed):
Main.eval(f"Pkg.resolve({io_arg})")
except (JuliaError, RuntimeError) as e:
raise ImportError(_import_error_string(julia_project)) from e
Main.eval("using SymbolicRegression")
try:
Main.eval("using SymbolicRegression")
except (JuliaError, RuntimeError) as e:
raise ImportError(_import_error_string(julia_project)) from e

Main.plus = Main.eval("(+)")
Main.sub = Main.eval("(-)")
Expand Down
2 changes: 1 addition & 1 deletion pysr/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.11.3"
__version__ = "0.11.4"
__symbolic_regression_jl_version__ = "0.12.2"