Skip to content

Commit 49b163d

Browse files
authored
Merge pull request #202 from MilesCranmer/fix-conda-forge
Fix conda forge installs
2 parents 134a0cd + a465e93 commit 49b163d

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.github/workflows/CI_conda_forge.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: conda-forge
22

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

55
on:
66
schedule:
@@ -33,12 +33,11 @@ jobs:
3333
auto-activate-base: true
3434
python-version: ${{ matrix.python-version }}
3535
activate-environment: test
36-
use-mamba: ${{ matrix.use-mamba }}
3736
- name: "Install pysr with mamba"
3837
run: conda activate test && mamba install pysr
3938
if: ${{ matrix.use-mamba }}
4039
- name: "Install pysr with conda"
4140
run: conda activate test && conda install pysr
4241
if: ${{ !matrix.use-mamba }}
4342
- name: "Run tests"
44-
run: conda activate test && python3 -m unittest test.test && python3 -m unittest test.test_env
43+
run: conda activate test && python3 -m unittest test.test

pysr/sr.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,11 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
523523
Default gives the Python package directory, where a
524524
Project.toml file should be present from the install.
525525
update: bool
526-
Whether to automatically update Julia packages.
527-
Default is `True`.
526+
Whether to automatically update Julia packages when `fit` is called.
527+
You should make sure that PySR is up-to-date itself first, as
528+
the packaged Julia packages may not necessarily include all
529+
updated dependencies.
530+
Default is `False`.
528531
output_jax_format : bool
529532
Whether to create a 'jax_format' column in the output,
530533
containing jax-callable functions and the default parameters in
@@ -700,7 +703,7 @@ def __init__(
700703
tempdir=None,
701704
delete_tempfiles=True,
702705
julia_project=None,
703-
update=True,
706+
update=False,
704707
output_jax_format=False,
705708
output_torch_format=False,
706709
extra_sympy_mappings=None,
@@ -1473,7 +1476,10 @@ def _run(self, X, y, mutated_params, weights, seed):
14731476
Main.eval(f"Pkg.resolve({io_arg})")
14741477
except (JuliaError, RuntimeError) as e:
14751478
raise ImportError(_import_error_string(julia_project)) from e
1476-
Main.eval("using SymbolicRegression")
1479+
try:
1480+
Main.eval("using SymbolicRegression")
1481+
except (JuliaError, RuntimeError) as e:
1482+
raise ImportError(_import_error_string(julia_project)) from e
14771483

14781484
Main.plus = Main.eval("(+)")
14791485
Main.sub = Main.eval("(-)")

pysr/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.11.3"
1+
__version__ = "0.11.4"
22
__symbolic_regression_jl_version__ = "0.12.2"

0 commit comments

Comments
 (0)