MilesCranmer / PySR

High-Performance Symbolic Regression in Python and Julia
https://astroautomata.com/PySR
Apache License 2.0
2.35k stars 211 forks source link

[BUG] `conda-forge` breaking #220

Closed MilesCranmer closed 1 year ago

MilesCranmer commented 1 year ago

FYI @mkitti @ngam

Weirdly the conda-forge tests are breaking again, even after I updated the conda-forge build to have a more recent julia depot: https://github.com/MilesCranmer/PySR/actions/runs/3396141209/jobs/5646873573

The errors are as follows. It seems like PyCall.jl has not been successfully built or something? The line which raises this error is here, meaning that info.is_pycall_built() is false.

Failed check_estimators_dtypes with:
    Traceback (most recent call last):
      File "/home/runner/work/PySR/PySR/test/test.py", line 652, in test_scikit_learn_compatibility
        check(model)
      File "/usr/share/miniconda3/envs/test/lib/python3.11/site-packages/sklearn/utils/_testing.py", line 320, in wrapper
        return fn(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^
      File "/usr/share/miniconda3/envs/test/lib/python3.11/site-packages/sklearn/utils/estimator_checks.py", line 1726, in check_estimators_dtypes
        estimator.fit(X_train, y)
      File "/home/runner/work/PySR/PySR/pysr/sr.py", line 1784, in fit
        self._run(X, y, mutated_params, weights=weights, seed=seed)
      File "/home/runner/work/PySR/PySR/pysr/sr.py", line [14](https://github.com/MilesCranmer/PySR/actions/runs/3396141209/jobs/5646873573#step:6:15)78, in _run
        Main = init_julia(self.julia_project)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/runner/work/PySR/PySR/pysr/julia_helpers.py", line [16](https://github.com/MilesCranmer/PySR/actions/runs/3396141209/jobs/5646873573#step:6:17)8, in init_julia
        raise ImportError(_import_error())
    ImportError: 
        Required dependencies are not installed or built.  Run the following code in the Python REPL:

            >>> import pysr
            >>> pysr.install()
mkitti commented 1 year ago

I'm looking

mkitti commented 1 year ago

When you run python3 -m unittest test.test what test are you actually running?

My sense is that you are not running the test.py installed with the conda-forge package, but running the test.py stored in this source tree.

MilesCranmer commented 1 year ago

Ah, perhaps that could be it; I can try changing it. Though I don’t see yet how that could cause this specific error.

MilesCranmer commented 1 year ago

I should move the test to be inside pysr so I can simply call it like pysr.test.testall().

MilesCranmer commented 1 year ago

Awesome. That was it! Thanks @mkitti for figuring that out! The conda-forge tests now actually run the one installed (via #221), and pass.