Skip to content

Commit ce07dc8

Browse files
authored
Merge pull request #748 from MilesCranmer/release-v1-beta
Update to 1.0 backend
2 parents e8f1c70 + 0aaf3b9 commit ce07dc8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1787
-714
lines changed

.github/workflows/CI.yml

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
os: [ubuntu-latest]
3131
test-id: [main]
3232
include:
33-
- julia-version: '1.6'
34-
python-version: '3.8'
33+
- julia-version: '1.10'
34+
python-version: '3.10'
3535
os: ubuntu-latest
3636
test-id: include
3737
- julia-version: '1'
@@ -58,26 +58,18 @@ jobs:
5858
- name: "Install PySR"
5959
run: |
6060
python -m pip install --upgrade pip
61-
pip install .
61+
pip install '.[dev]'
6262
python -c 'import pysr'
6363
- name: "Assert Julia version"
6464
if: ${{ matrix.julia-version != '1'}}
6565
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"
66-
- name: "Install test dependencies"
67-
run: pip install coverage coveralls pytest nbval
6866
- name: "Set up coverage for subprocesses"
6967
run: echo 'import coverage; coverage.process_startup()' > "${{ github.workspace }}/sitecustomize.py"
7068
- name: "Run tests"
7169
run: coverage run -m pysr test main,cli,startup
72-
- name: "Install JAX"
73-
run: pip install jax jaxlib # (optional import)
74-
if: ${{ matrix.test-id == 'main' }}
7570
- name: "Run JAX tests"
7671
run: coverage run --append -m pysr test jax
7772
if: ${{ matrix.test-id == 'main' }}
78-
- name: "Install Torch"
79-
run: pip install torch # (optional import)
80-
if: ${{ matrix.test-id == 'main' }}
8173
- name: "Run Torch tests"
8274
run: coverage run --append -m pysr test torch
8375
if: ${{ matrix.test-id == 'main' }}
@@ -97,15 +89,15 @@ jobs:
9789
julia-version: ['1']
9890
include:
9991
- os: ubuntu-latest
100-
python-version: '3.8'
101-
julia-version: '1.6'
92+
python-version: '3.10'
93+
julia-version: '1.10'
10294
steps:
10395
- uses: actions/checkout@v4
10496
- uses: actions/setup-python@v5
10597
- name: "Install PySR"
10698
run: |
10799
python -m pip install --upgrade pip
108-
pip install .
100+
pip install '.[dev]'
109101
- name: "Run development test"
110102
run: PYSR_TEST_JULIA_VERSION=${{ matrix.julia-version }} PYSR_TEST_PYTHON_VERSION=${{ matrix.python-version }} python -m pysr test dev
111103

@@ -131,7 +123,7 @@ jobs:
131123
- name: "Set up Conda"
132124
uses: conda-incubator/setup-miniconda@v3
133125
with:
134-
miniforge-variant: Mambaforge
126+
miniforge-variant: Miniforge3
135127
miniforge-version: latest
136128
auto-activate-base: true
137129
python-version: ${{ matrix.python-version }}
@@ -176,7 +168,7 @@ jobs:
176168
matrix:
177169
python-version:
178170
- '3.12'
179-
- '3.8'
171+
- '3.10'
180172
os: ['ubuntu-latest']
181173

182174
steps:
@@ -189,14 +181,37 @@ jobs:
189181
- name: "Install PySR and all dependencies"
190182
run: |
191183
python -m pip install --upgrade pip
192-
pip install .
193-
pip install mypy
194-
- name: "Install additional dependencies"
195-
run: python -m pip install jax jaxlib torch
196-
if: ${{ matrix.python-version != '3.8' }}
184+
pip install '.[dev]'
197185
- name: "Run mypy"
198186
run: python -m mypy --install-types --non-interactive pysr
199-
if: ${{ matrix.python-version != '3.8' }}
187+
if: ${{ matrix.python-version != '3.10' }}
200188
- name: "Run compatible mypy"
201189
run: python -m mypy --ignore-missing-imports pysr
202-
if: ${{ matrix.python-version == '3.8' }}
190+
if: ${{ matrix.python-version == '3.10' }}
191+
192+
beartype:
193+
name: Test with beartype
194+
runs-on: ubuntu-latest
195+
defaults:
196+
run:
197+
shell: bash -l {0}
198+
env:
199+
PYSR_USE_BEARTYPE: "1"
200+
strategy:
201+
matrix:
202+
python-version: ['3.12']
203+
os: ['ubuntu-latest']
204+
205+
steps:
206+
- uses: actions/checkout@v4
207+
- name: "Set up Python"
208+
uses: actions/setup-python@v5
209+
with:
210+
python-version: ${{ matrix.python-version }}
211+
cache: pip
212+
- name: "Install PySR and all dependencies"
213+
run: |
214+
python -m pip install --upgrade pip
215+
pip install '.[dev]'
216+
- name: "Run tests"
217+
run: python -m pysr test main,jax,torch

.github/workflows/CI_Windows.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ jobs:
4646
- name: "Install PySR"
4747
run: |
4848
python -m pip install --upgrade pip
49-
pip install pytest nbval "numpy<2.0.0"
50-
pip install .
49+
pip install '.[dev]'
5150
python -c 'import pysr'
5251
- name: "Run tests"
5352
run: |

.github/workflows/CI_conda_forge.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
python-version: ['3.9', '3.10', '3.11', '3.12']
23+
python-version: ['3.10', '3.11', '3.12']
2424
os: ['ubuntu-latest']
2525
use-mamba: [true, false]
2626
include:
27-
- python-version: 3.9
27+
- python-version: 3.10
2828
os: 'windows-latest'
2929
use-mamba: true
3030
- python-version: 3.12
3131
os: 'windows-latest'
3232
use-mamba: true
33-
- python-version: 3.9
33+
- python-version: 3.10
3434
os: 'macos-latest'
3535
use-mamba: true
3636
- python-version: 3.12

.github/workflows/CI_docker_large_nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
julia-version: ['1.6', '1']
22-
python-version: ['3.8', '3.12']
21+
julia-version: ['1.10', '1']
22+
python-version: ['3.10', '3.12']
2323
os: [ubuntu-latest]
2424
arch: ['linux/amd64', 'linux/arm64']
2525

.github/workflows/CI_large_nightly.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
julia-version: ['1.6', '1.8', '1.10']
27-
python-version: ['3.8', '3.10', '3.12']
26+
julia-version: ['1.10', '1']
27+
python-version: ['3.10', '3.12']
2828
os: [ubuntu-latest, macos-latest, windows-latest]
2929

3030
steps:
@@ -40,8 +40,7 @@ jobs:
4040
- name: "Install PySR"
4141
run: |
4242
python -m pip install --upgrade pip
43-
pip install pytest nbval
44-
pip install .
43+
pip install '.[dev]'
4544
python -c 'import pysr'
4645
- name: "Assert Julia version"
4746
if: ${{ matrix.julia-version != '1'}}

.github/workflows/CI_mac.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,12 @@ jobs:
4646
- name: "Install PySR"
4747
run: |
4848
python -m pip install --upgrade pip
49-
pip install pytest nbval
50-
pip install .
49+
pip install '.[dev]'
5150
python -c 'import pysr'
5251
- name: "Run tests"
5352
run: |
5453
python -m pysr test main,cli,startup
55-
- name: "Install JAX"
56-
run: pip install jax jaxlib # (optional import)
5754
- name: "Run JAX tests"
5855
run: python -m pysr test jax
59-
- name: "Install Torch"
60-
run: pip install torch # (optional import)
6156
- name: "Run Torch tests"
6257
run: python -m pysr test torch

.github/workflows/docs.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,26 @@ jobs:
2525
- name: "Set up Python"
2626
uses: actions/setup-python@v5
2727
with:
28-
python-version: 3.9
28+
python-version: 3.12
2929
cache: pip
3030
- name: "Install packages for docs building"
3131
run: pip install -r docs/requirements.txt
3232
- name: "Install PySR"
3333
run: pip install . && python -c 'import pysr'
3434
- name: "Build API docs"
3535
run: cd docs && ./gen_docs.sh
36-
- name: "Deploy documentation"
36+
- name: "Deploy documentation to primary repository"
3737
run: mkdocs gh-deploy --force
38+
- name: "Deploy documentation to secondary repository"
39+
env:
40+
DEPLOY_KEY: ${{ secrets.DAMTP_DEPLOY_KEY }}
41+
run: |
42+
# Set up SSH key for authentication
43+
mkdir -p ~/.ssh
44+
echo "$DEPLOY_KEY" > ~/.ssh/id_rsa
45+
chmod 600 ~/.ssh/id_rsa
46+
ssh-keyscan github.com >> ~/.ssh/known_hosts
47+
48+
git checkout gh-pages
49+
git remote add secondary [email protected]:ai-damtp-cam-ac-uk/pysr.git
50+
git push secondary gh-pages --force

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ site
2525
venv
2626
requirements-dev.lock
2727
requirements.lock
28+
outputs
29+
.mypy_cache

Apptainer.def

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Build an Apptainer SIF file containing a working copy of PySR and its prereqs
22
Bootstrap: docker
3-
From: julia:1.10.4-bullseye
3+
From: julia:1.11.1-bullseye
44
Stage: jl
55

66
Bootstrap: docker
7-
From: python:3.12-bullseye
7+
From: python:3.12.6-bullseye
88
Stage: runtime
99

1010
%environment
@@ -19,7 +19,6 @@ Stage: runtime
1919
/usr/local/julia /usr/local/julia
2020

2121
%files
22-
./requirements.txt /pysr/requirements.txt
2322
./pyproject.toml /pysr/pyproject.toml
2423
./setup.py /pysr/setup.py
2524
./pysr /pysr/pysr

CONTRIBUTORS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In this guide you will get an overview of the contribution workflow from opening
66

77
## New contributor guide
88

9-
To get an overview of the project, read PySR's [README](README.md). The [PySR docs](https://astroautomata.com/PySR/) give additional information.
9+
To get an overview of the project, read PySR's [README](README.md). The [PySR docs](https://ai.damtp.cam.ac.uk/pysr/) give additional information.
1010
Here are some resources to help you get started with open source contributions in general:
1111

1212
- [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github)
@@ -39,7 +39,7 @@ Scan through our [existing issues](https://github.com/MilesCranmer/PySR/issues)
3939
2. Create a working branch and start with your changes!
4040

4141
3. (Optional) If you would like to make changes to PySR itself, skip to step 4. However, if you are interested in making changes to the _symbolic regression code_ itself,
42-
check out the [guide](https://astroautomata.com/PySR/backend/) on modifying a custom SymbolicRegression.jl library.
42+
check out the [guide](https://ai.damtp.cam.ac.uk/pysr/backend/) on modifying a custom SymbolicRegression.jl library.
4343
In this case, you might instead be interested in making suggestions to the [SymbolicRegression.jl](http://github.com/MilesCranmer/SymbolicRegression.jl) library.
4444

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

0 commit comments

Comments
 (0)