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

(BREAKING) Rewrite Julia interface with PyJulia -> JuliaCall; other changes #535

Merged
merged 115 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
68ea1be
Start third attempt at porting to PythonCall
MilesCranmer Jan 21, 2024
e530637
Force conversion to Vector
MilesCranmer Jan 26, 2024
4037c2d
Disable PythonCall GC during equation search
MilesCranmer Jan 26, 2024
d325c42
Fix environ assertion
MilesCranmer Jan 26, 2024
139b8d0
Disable unused install command
MilesCranmer Jan 26, 2024
a4bb529
Run in `Main`
MilesCranmer Jan 26, 2024
2abf017
Set num threads before juliacall init
MilesCranmer Jan 26, 2024
32b2f6e
Automatically check if juliacall was already imported
MilesCranmer Jan 26, 2024
7a42396
Avoid disabling GC by simply copying inside Julia
MilesCranmer Jan 27, 2024
d72c643
Save raw bytes so can warm-restart in new python session
MilesCranmer Jan 27, 2024
44ff874
Fix hanging with GC disabled
MilesCranmer Jan 27, 2024
8d0381b
Remove unneeded copying
MilesCranmer Jan 27, 2024
eb10c90
Better docs
MilesCranmer Jan 27, 2024
74da094
Remove unused function
MilesCranmer Jan 27, 2024
6b61b25
Fix missing pickle warning
MilesCranmer Jan 27, 2024
3bcbc49
Fix symbolic regression version exactly
MilesCranmer Jan 27, 2024
4803d41
Fix PythonCall issue of not converting `np.str_` to `String`
MilesCranmer Jan 27, 2024
4a5693e
Check if user already set JULIA_NUM_THREADS
MilesCranmer Feb 4, 2024
f335ea1
Clean up default params
MilesCranmer Feb 4, 2024
3555cfd
WIP move `python -m pysr.test` call to click interface
MilesCranmer Feb 4, 2024
6625eac
Use git version of SymbolicRegression.jl to avoid Pkg server issues
MilesCranmer Feb 7, 2024
d236214
Add Serialization.jl to juliapkg.json
MilesCranmer Feb 7, 2024
0d92619
Remove Python 3.12 warning
MilesCranmer Feb 7, 2024
98fa83e
Fix click API usage
MilesCranmer Feb 7, 2024
4320392
Update all workflows to use `python -m pysr test` syntax
MilesCranmer Feb 7, 2024
725c510
Switch to using pyproject.toml for build options
MilesCranmer Feb 7, 2024
e373739
Use setuptools_scm for version management
MilesCranmer Feb 7, 2024
6823848
Remove generated version.py file
MilesCranmer Feb 7, 2024
d05dc90
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 7, 2024
c091db0
Update conda env
MilesCranmer Feb 7, 2024
fb8ee4a
Remove unused juliapkg
MilesCranmer Feb 7, 2024
043980c
Update installation guide
MilesCranmer Feb 7, 2024
811ca37
Add missing pyproject.toml file
MilesCranmer Feb 7, 2024
b53ca97
Permit versioning without git repo
MilesCranmer Feb 7, 2024
877c539
Use relative import for CMD line interface
MilesCranmer Feb 7, 2024
f333659
Add missing juliapkg.json to dockerfile
MilesCranmer Feb 7, 2024
7ea0b2f
Ignore lack of type hints in JuliaCall
MilesCranmer Feb 7, 2024
65151c8
Move juliapkg into source
MilesCranmer Feb 7, 2024
796a8ad
Remove Feynman problems and dataset
MilesCranmer Feb 7, 2024
ade2ab0
Ensure that juliapkg.json is installed
MilesCranmer Feb 7, 2024
1ab76b8
Fix incremental install tests
MilesCranmer Feb 7, 2024
56f0425
Remove incremental install altogether
MilesCranmer Feb 7, 2024
31ecc71
Remove custom environment tests
MilesCranmer Feb 7, 2024
7aa7884
Remove use of custom env tests
MilesCranmer Feb 7, 2024
caf58a4
Ensure julia is loaded as soon as possible
MilesCranmer Feb 7, 2024
8cf4bf3
Add install function back with deprecation warning
MilesCranmer Feb 8, 2024
47ce661
Include asserts for Julia version found by PythonCall
MilesCranmer Feb 8, 2024
73e8a1a
Merge branch 'master' into pythoncall-try-3
MilesCranmer Feb 8, 2024
06aebb6
Fix version assertion for earlier Julia
MilesCranmer Feb 8, 2024
32cadad
Update docs to use `seval`
MilesCranmer Feb 8, 2024
7c93437
Avoid git version to fix windows issues
MilesCranmer Feb 9, 2024
d70ae0c
Override seval to allow multiple expressions
MilesCranmer Feb 9, 2024
d3c6385
Update colab notebook
MilesCranmer Feb 9, 2024
2600822
Automatically load ipython extension
MilesCranmer Feb 9, 2024
20646f9
Simplify IPython detection
MilesCranmer Feb 9, 2024
9f65133
Use `julia_state_` instead
MilesCranmer Feb 10, 2024
5a99aa3
Remove use of `julia_kwargs`
MilesCranmer Feb 10, 2024
b7ca126
Only show warnings if juliacall not yet imported
MilesCranmer Feb 10, 2024
ae8fa7f
Automatically load ipython extension
MilesCranmer Feb 10, 2024
d7841a4
Allow user to disable juliacall extension
MilesCranmer Feb 10, 2024
5921e9c
Don't install editable version of docker file
MilesCranmer Feb 10, 2024
83ef326
Fix `julia_state_` typo
MilesCranmer Feb 10, 2024
b96e8d3
Only overwrite seval on recent Julia versions
MilesCranmer Feb 10, 2024
62ecf50
Add Python 3.12 to test suite
MilesCranmer Feb 10, 2024
e957e34
Export SymbolicRegression.jl module
MilesCranmer Feb 10, 2024
70b842a
Save options to PySRRegressor
MilesCranmer Feb 10, 2024
ffc5f5c
Overload operators at import rather than fit
MilesCranmer Feb 10, 2024
c5c6896
Update julia_helpers.py
MilesCranmer Feb 10, 2024
90fd5d4
Clean up torch tests
MilesCranmer Feb 10, 2024
3cbb7c6
Rename all instances of PyJulia to juliacall in docs
MilesCranmer Feb 10, 2024
3fe50ab
Update documentation on backend modifications
MilesCranmer Feb 10, 2024
eaaccb0
Mention new backend page
MilesCranmer Feb 10, 2024
af63177
Fix juliacall version as we are using non-public API
MilesCranmer Feb 10, 2024
618a3f8
Add warm_start test
MilesCranmer Feb 10, 2024
2a98f83
Update test suite to test warm starts
MilesCranmer Feb 10, 2024
9b3be67
Update CLI tests
MilesCranmer Feb 10, 2024
8685680
Clean up testing caller
MilesCranmer Feb 10, 2024
87880d1
Deprecate ncyclesperiteration -> ncycles_per_iteration
MilesCranmer Feb 10, 2024
fc67c56
Remove unused TODO file
MilesCranmer Feb 10, 2024
d16abb4
Rename loss => elementwise_loss and full_objective => loss_function
MilesCranmer Feb 10, 2024
8f60615
Do tests of deprecated functions
MilesCranmer Feb 10, 2024
6d3c900
Unused imports
MilesCranmer Feb 10, 2024
a02a4f0
Fix SymbolicRegression version
MilesCranmer Feb 10, 2024
f729ba4
Ensure equation state is reset for warm start test
MilesCranmer Feb 10, 2024
7049740
Test additional branches of code
MilesCranmer Feb 10, 2024
92eb30b
Extend startup tests to other warning messages
MilesCranmer Feb 10, 2024
7614219
Fix CLI tests
MilesCranmer Feb 10, 2024
dd9c3ed
Fix CLI tests
MilesCranmer Feb 10, 2024
2be448f
Weaken complex test
MilesCranmer Feb 10, 2024
c48a68e
Try to get coverage working in subprocesses
MilesCranmer Feb 10, 2024
603c5f4
Use correct python for subprocess
MilesCranmer Feb 10, 2024
698d616
Remove COVERAGE_PROCESS_START
MilesCranmer Feb 10, 2024
46f8a60
Try to get subprocess coverage working again
MilesCranmer Feb 10, 2024
7acebb6
Standard names for JuliaCall env variables
MilesCranmer Feb 10, 2024
673e8d5
Include test of multi-line seval
MilesCranmer Feb 10, 2024
24a4349
Test that we can use development version of backend
MilesCranmer Feb 11, 2024
65159ce
Test jupyter notebook in test suite
MilesCranmer Feb 11, 2024
ddadb22
Sanitize nb output for testing
MilesCranmer Feb 11, 2024
4db7637
Try to fix nb sanitizer
MilesCranmer Feb 11, 2024
ef66f4a
Try to fix nb sanitizer
MilesCranmer Feb 11, 2024
9dbc6d3
Fix CLI test
MilesCranmer Feb 11, 2024
2fe6870
Always try to set `jl.seval`
MilesCranmer Feb 11, 2024
3fba294
Skip param groupings test if doesnt exist
MilesCranmer Feb 11, 2024
1a177ee
Fix tests on Julia 1.7 due to module assignment
MilesCranmer Feb 11, 2024
dbb3f97
Add Zygote.jl to PySR env
MilesCranmer Feb 12, 2024
ad8ed14
Fail job if unittest unsuccessful
MilesCranmer Feb 12, 2024
3fcdd9a
Always overwrite with Meta.parseall version
MilesCranmer Feb 12, 2024
8fe6c62
Turn back up complex test
MilesCranmer Feb 12, 2024
6e07d35
Needs longer for complex search
MilesCranmer Feb 12, 2024
7c2bce0
Fix `jl.test_state` issue
MilesCranmer Feb 12, 2024
52f940c
Only load Julia extension on recent julia
MilesCranmer Feb 12, 2024
b7d54b1
Skip notebook test on older Julia
MilesCranmer Feb 12, 2024
02376fd
Skip notebook test on Windows
MilesCranmer Feb 12, 2024
a949e43
Skip warm start test on Windows
MilesCranmer Feb 12, 2024
c4e5886
Show off `%%julia` magic in notebook example
MilesCranmer Feb 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[run]
omit =
*/test/*
source = pysr
63 changes: 40 additions & 23 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
env:
COVERAGE_PROCESS_START: "${{ github.workspace }}/.coveragerc"
defaults:
run:
shell: bash
Expand All @@ -38,6 +40,10 @@ jobs:
python-version: '3.7'
os: ubuntu-latest
test-id: include
- julia-version: '1'
python-version: '3.12'
os: ubuntu-latest
test-id: include

steps:
- uses: actions/checkout@v4
Expand All @@ -58,44 +64,56 @@ jobs:
- name: "Install PySR"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python setup.py install
python -m pysr install
- name: "Install Coverage tool"
run: pip install coverage coveralls
pip install .
python -c 'import pysr'
- name: "Assert Julia version"
if: ${{ matrix.julia-version != '1'}}
run: python3 -c "from pysr import jl; assert jl.VERSION.major == jl.seval('v\"${{ matrix.julia-version }}\"').major; assert jl.VERSION.minor == jl.seval('v\"${{ matrix.julia-version }}\"').minor"
- name: "Install test dependencies"
run: pip install coverage coveralls pytest nbval
- name: "Set up coverage for subprocesses"
run: echo 'import coverage; coverage.process_startup()' > "${{ github.workspace }}/sitecustomize.py"
- name: "Run tests"
run: |
coverage run --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr.test main
coverage run --append --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr.test cli
run: coverage run -m pysr test main,cli,startup
- name: "Install JAX"
run: pip install jax jaxlib # (optional import)
if: ${{ matrix.test-id == 'main' }}
- name: "Run JAX tests"
run: coverage run --append --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr.test jax
run: coverage run --append -m pysr test jax
if: ${{ matrix.test-id == 'main' }}
- name: "Install Torch"
run: pip install torch # (optional import)
if: ${{ matrix.test-id == 'main' }}
- name: "Run Torch tests"
run: coverage run --append --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr.test torch
run: coverage run --append -m pysr test torch
if: ${{ matrix.test-id == 'main' }}
- name: "Run custom env tests"
run: coverage run --append --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr.test env
- name: "Coveralls"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: test-${{ matrix.julia-version }}-${{ matrix.python-version }}
COVERALLS_PARALLEL: true
run: coveralls --service=github

incremental_install:
runs-on: ubuntu-latest
dev_install:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.11']
julia-version: ['1']
include:
- os: ubuntu-latest
python-version: '3.7'
julia-version: '1.6'
steps:
- uses: actions/checkout@v4
- name: "Build incremental install"
run: docker build -t pysr -f pysr/test/incremental_install_simulator.dockerfile .
- name: "Test incremental install"
run: docker run --rm pysr /bin/bash -l -c 'python3 -m pysr.test main && python3 -m pysr.test env'
- uses: actions/setup-python@v5
- name: "Install PySR"
run: |
python -m pip install --upgrade pip
pip install .
- name: "Run development test"
run: PYSR_TEST_JULIA_VERSION=${{ matrix.julia-version }} PYSR_TEST_PYTHON_VERSION=${{ matrix.python-version }} python -m pysr test dev

conda_test:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -133,9 +151,9 @@ jobs:
- name: "Install PySR"
run: |
python3 -m pip install .
python3 -m pysr install
python3 -c 'import pysr'
- name: "Run tests"
run: cd /tmp && python -m pysr.test main
run: cd /tmp && python -m pysr test main

coveralls:
name: Indicate completion to coveralls.io
Expand Down Expand Up @@ -177,9 +195,8 @@ jobs:
- name: "Install PySR and all dependencies"
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install mypy
python -m pip install .
pip install .
pip install mypy
- name: "Install additional dependencies"
run: python -m pip install jax jaxlib torch
if: ${{ matrix.python-version != '3.7' }}
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/CI_Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,13 @@ jobs:
- name: "Install PySR"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python setup.py install
python -m pysr install
pip install pytest nbval
pip install .
python -c 'import pysr'
- name: "Run tests"
run: |
python -m pysr.test main
python -m pysr.test cli
python -m pysr test main,cli,startup
- name: "Install Torch"
run: pip install torch # (optional import)
- name: "Run Torch tests"
run: python -m pysr.test torch
- name: "Run custom env tests"
run: python -m pysr.test env
run: python -m pysr test torch
4 changes: 3 additions & 1 deletion .github/workflows/CI_conda_forge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ jobs:
run: conda activate pysr-test && conda install pysr
if: ${{ !matrix.use-mamba }}
- name: "Run tests"
run: python -m pysr.test main
run: |
pip install pytest nbval
python -m pysr test main,startup
2 changes: 1 addition & 1 deletion .github/workflows/CI_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
- name: Build docker
run: docker build --platform=${{ matrix.arch }} -t pysr .
- name: Test docker
run: docker run --platform=${{ matrix.arch }} --rm pysr /bin/bash -c 'python3 -m pysr.test main && python3 -m pysr.test cli && python3 -m pysr.test env'
run: docker run --platform=${{ matrix.arch }} --rm pysr /bin/bash -c 'pip install pytest nbval && python3 -m pysr test main,cli,startup'
2 changes: 1 addition & 1 deletion .github/workflows/CI_docker_large_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
- name: Build docker
run: docker build --platform=${{ matrix.arch }} -t pysr --build-arg JLVERSION=${{ matrix.julia-version }} --build-arg PYVERSION=${{ matrix.python-version }} .
- name: Test docker
run: docker run --platform=${{ matrix.arch }} --rm pysr /bin/bash -c 'python3 -m pysr.test main && python3 -m pysr.test cli && python3 -m pysr.test env'
run: docker run --platform=${{ matrix.arch }} --rm pysr /bin/bash -c 'pip install pytest nbval && python3 -m pysr test main,cli,startup'
16 changes: 7 additions & 9 deletions .github/workflows/CI_large_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ jobs:
- name: "Install PySR"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python setup.py install
python -m pysr install
pip install pytest nbval
pip install .
python -c 'import pysr'
- name: "Assert Julia version"
if: ${{ matrix.julia-version != '1'}}
run: python3 -c "from pysr import jl; assert jl.VERSION.major == jl.seval('v\"${{ matrix.julia-version }}\"').major; assert jl.VERSION.minor == jl.seval('v\"${{ matrix.julia-version }}\"').minor"
- name: "Run tests"
run: |
python -m pysr.test main
python -m pysr.test cli
- name: "Run new env test"
run: python -m pysr.test env
if: ${{ !(matrix.os == 'windows-latest' && matrix.python-version == '3.7') }}
run: python -m pysr test main,cli,startup
15 changes: 6 additions & 9 deletions .github/workflows/CI_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,17 @@ jobs:
- name: "Install PySR"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python setup.py install
python -m pysr install
pip install pytest nbval
pip install .
python -c 'import pysr'
- name: "Run tests"
run: |
python -m pysr.test main
python -m pysr.test cli
python -m pysr test main,cli,startup
- name: "Install JAX"
run: pip install jax jaxlib # (optional import)
- name: "Run JAX tests"
run: python -m pysr.test jax
run: python -m pysr test jax
- name: "Install Torch"
run: pip install torch # (optional import)
- name: "Run Torch tests"
run: python -m pysr.test torch
- name: "Run custom env tests"
run: python -m pysr.test env
run: python -m pysr test torch
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ repos:
hooks:
- id: black
- id: black-jupyter
exclude: pysr/test/test_nb.ipynb
# Stripping notebooks
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
exclude: pysr/test/test_nb.ipynb
# Unused imports
- repo: https://github.com/hadialqattan/pycln
rev: "v2.4.0"
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Scan through our [existing issues](https://github.com/MilesCranmer/PySR/issues)
check out the [guide](https://astroautomata.com/PySR/backend/) on modifying a custom SymbolicRegression.jl library.
In this case, you might instead be interested in making suggestions to the [SymbolicRegression.jl](http://github.com/MilesCranmer/SymbolicRegression.jl) library.

4. You can install your local version of PySR with `python setup.py install`, and run tests with `python -m pysr.test main`.
4. You can install your local version of PySR with `python setup.py install`, and run tests with `python -m pysr test main`.

### Commit your update

Expand Down
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@ COPY --from=jl /usr/local/julia /usr/local/julia
ENV PATH="/usr/local/julia/bin:${PATH}"

# Install IPython and other useful libraries:
RUN pip install ipython matplotlib
RUN pip install --no-cache-dir ipython matplotlib

WORKDIR /pysr

# Caches install (https://stackoverflow.com/questions/25305788/how-to-avoid-reinstalling-packages-when-building-docker-image-for-python-project)
ADD ./requirements.txt /pysr/requirements.txt
RUN pip3 install -r /pysr/requirements.txt
RUN pip3 install --no-cache-dir -r /pysr/requirements.txt

# Install PySR:
# We do a minimal copy so it doesn't need to rerun at every file change:
ADD ./pyproject.toml /pysr/pyproject.toml
ADD ./setup.py /pysr/setup.py
ADD ./pysr/ /pysr/pysr/
RUN pip3 install .
ADD ./pysr /pysr/pysr
RUN pip3 install --no-cache-dir .

# Install Julia pre-requisites:
RUN python3 -m pysr install
RUN python3 -c 'import pysr'

# metainformation
LABEL org.opencontainers.image.authors = "Miles Cranmer"
Expand Down
50 changes: 12 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ If you've finished a project with PySR, please submit a PR to showcase your work
- [Contributors](#contributors-)
- [Why PySR?](#why-pysr)
- [Installation](#installation)
- [pip](#pip)
- [conda](#conda)
- [docker](#docker-build)
- [Troubleshooting](#troubleshooting)
- [Quickstart](#quickstart)
- [→ Documentation](https://astroautomata.com/PySR)

Expand Down Expand Up @@ -129,48 +125,31 @@ an explicit and powerful way to interpret deep neural networks.

## Installation

| [pip](#pip) | [conda](#conda) | [docker](#docker-build) |
|:---:|:---:|:---:|
| Everywhere (recommended) | Linux and Intel-based macOS | Everywhere (if all else fails) |
### Pip

---

### pip
You can install PySR with pip:

1. [Install Julia](https://julialang.org/downloads/)
- Alternatively, my personal preference is to use [juliaup](https://github.com/JuliaLang/juliaup#installation), which performs this automatically.
2. Then, run:
```bash
pip3 install -U pysr
pip install pysr
```
3. Finally, to install Julia dependencies:
```bash
python3 -m pysr install
```
> (Alternatively, from within Python, you can call `import pysr; pysr.install()`)

---
Julia dependencies will be installed at first import.

### conda
### Conda

The PySR build in conda includes all required dependencies, so you can install it by simply running:
Similarly, with conda:

```bash
conda install -c conda-forge pysr
```

from within your target conda environment.

However, note that the conda install does not support precompilation of Julia libraries, so the
start time may be slightly slower as the JIT-compilation will be running.
(Once the compilation finishes, there will not be a performance difference though.)

---
### Docker

### docker build
You can also use the `Dockerfile` to install PySR in a docker container

1. Clone this repo.
2. In the repo, run the build command with:
2. Within the repo's directory, build the docker container:
```bash
docker build -t pysr .
```
Expand All @@ -185,11 +164,7 @@ For more details, see the [docker section](#docker).

### Troubleshooting

Common issues tend to be related to Python not finding Julia.
To debug this, try running `python3 -c 'import os; print(os.environ["PATH"])'`.
If none of these folders contain your Julia binary, then you need to add Julia's `bin` folder to your `PATH` environment variable.

Another issue you might run into can result in a hard crash at import with
One issue you might run into can result in a hard crash at import with
a message like "`GLIBCXX_...` not found". This is due to another one of the Python dependencies
loading an incorrect `libstdc++` library. To fix this, you should modify your
`LD_LIBRARY_PATH` variable to reference the Julia libraries. For example, if the Julia
Expand All @@ -202,7 +177,6 @@ export LD_LIBRARY_PATH=$HOME/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/lib/jul

to your `.bashrc` or `.zshrc` file.

**Running PySR on macOS with an M1 processor:** you should use the pip version, and make sure to get the Julia binary for ARM/M-series processors.

## Quickstart

Expand Down Expand Up @@ -240,7 +214,7 @@ model = PySRRegressor(
],
extra_sympy_mappings={"inv": lambda x: 1 / x},
# ^ Define operator for SymPy as well
loss="loss(prediction, target) = (prediction - target)^2",
elementwise_loss="loss(prediction, target) = (prediction - target)^2",
# ^ Custom loss function (julia syntax)
)
```
Expand Down Expand Up @@ -323,7 +297,7 @@ model = PySRRegressor(
# ^ 2 populations per core, so one is always running.
population_size=50,
# ^ Slightly larger populations, for greater diversity.
ncyclesperiteration=500,
ncycles_per_iteration=500,
# ^ Generations between migrations.
niterations=10000000, # Run forever
early_stop_condition=(
Expand Down
Loading
Loading