Skip to content

Commit

Permalink
Merge tag 'v0.18.4' into sympy-or
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Jun 3, 2024
2 parents 5c0a49a + 6dfed1b commit 0f47a59
Show file tree
Hide file tree
Showing 74 changed files with 2,125 additions and 1,861 deletions.
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
16 changes: 0 additions & 16 deletions .deepsource.toml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"

- package-ecosystem: "github-actions"
# Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.)
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
113 changes: 75 additions & 38 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,31 @@ jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
env:
COVERAGE_PROCESS_START: "${{ github.workspace }}/.coveragerc"
defaults:
run:
shell: bash
strategy:
matrix:
julia-version: ['1.9']
python-version: ['3.10']
julia-version: ['1']
python-version: ['3.12']
os: [ubuntu-latest]
test-id: [main]
include:
- julia-version: '1.6'
python-version: '3.8'
os: ubuntu-latest
test-id: include
- julia-version: '1'
python-version: '3.12'
os: ubuntu-latest
test-id: include

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
- name: "Cache Julia"
Expand All @@ -45,47 +57,63 @@ jobs:
cache-name: ${{ matrix.os }}-test-${{ matrix.julia-version }}-${{ matrix.python-version }}
cache-packages: false
- name: "Set up Python"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- 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
- name: "Run custom env tests"
run: coverage run --append --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr.test env
run: coverage run --append -m pysr test torch
if: ${{ matrix.test-id == 'main' }}
- name: "Coveralls"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: test-${{ matrix.test-name }}
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.12']
julia-version: ['1']
include:
- os: ubuntu-latest
python-version: '3.8'
julia-version: '1.6'
steps:
- uses: actions/checkout@v2
- 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/checkout@v4
- 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 All @@ -94,20 +122,20 @@ jobs:
shell: bash -l {0}
strategy:
matrix:
python-version: ['3.9']
python-version: ['3.12']
os: ['ubuntu-latest']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Cache conda"
uses: actions/cache@v2
uses: actions/cache@v4
env:
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
- name: "Set up Conda"
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
Expand All @@ -123,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 All @@ -152,20 +180,29 @@ jobs:
shell: bash -l {0}
strategy:
matrix:
python-version: ['3.10']
python-version:
- '3.12'
- '3.8'
os: ['ubuntu-latest']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Set up Python"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: "Install PySR and all dependencies"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install mypy jax jaxlib torch
python setup.py install
pip install .
pip install mypy
- name: "Install additional dependencies"
run: python -m pip install jax jaxlib torch
if: ${{ matrix.python-version != '3.8' }}
- name: "Run mypy"
run: mypy --install-types --non-interactive pysr
run: python -m mypy --install-types --non-interactive pysr
if: ${{ matrix.python-version != '3.8' }}
- name: "Run compatible mypy"
run: python -m mypy --ignore-missing-imports pysr
if: ${{ matrix.python-version == '3.8' }}
23 changes: 10 additions & 13 deletions .github/workflows/CI_Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ jobs:
shell: bash
strategy:
matrix:
julia-version: ['1.9']
python-version: ['3.10']
julia-version: ['1']
python-version: ['3.12']
os: [windows-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
- name: "Cache Julia"
Expand All @@ -45,23 +45,20 @@ jobs:
cache-name: ${{ matrix.os }}-test-${{ matrix.julia-version }}-${{ matrix.python-version }}
cache-packages: false
- name: "Set up Python"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- 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
23 changes: 19 additions & 4 deletions .github/workflows/CI_conda_forge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,26 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
os: ['ubuntu-latest', 'macos-latest']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: ['ubuntu-latest']
use-mamba: [true, false]
include:
- python-version: 3.9
os: 'windows-latest'
use-mamba: true
- python-version: 3.12
os: 'windows-latest'
use-mamba: true
- python-version: 3.9
os: 'macos-latest'
use-mamba: true
- python-version: 3.12
os: 'macos-latest'
use-mamba: true

steps:
- name: "Set up Conda"
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
Expand All @@ -40,4 +53,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
4 changes: 2 additions & 2 deletions .github/workflows/CI_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
arch: ['linux/amd64']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- 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'
10 changes: 5 additions & 5 deletions .github/workflows/CI_docker_large_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ jobs:
strategy:
fail-fast: false
matrix:
julia-version: ['1.6', '1.9']
python-version: ['3.10']
julia-version: ['1.6', '1']
python-version: ['3.8', '3.12']
os: [ubuntu-latest]
arch: ['linux/amd64', 'linux/arm64']


steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Build docker
run: docker build --platform=${{ matrix.arch }} -t pysr --build-arg JLVERSION=${{ matrix.julia-version }} .
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'
26 changes: 12 additions & 14 deletions .github/workflows/CI_large_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,28 @@ jobs:
strategy:
fail-fast: false
matrix:
julia-version: ['1.6', '1.8', '1.9']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
julia-version: ['1.6', '1.8', '1.10']
python-version: ['3.8', '3.10', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
- name: "Set up Python"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- 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
Loading

0 comments on commit 0f47a59

Please sign in to comment.