Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 19 additions & 29 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,30 @@ jobs:
python-version: ["3.9", "3.14"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install dependencies
run: |
pip install -U pip setuptools
pip install --progress-bar off optuna numpy scipy gpytorch torch
pip install --progress-bar off -U .
- run: python examples/quadratic_2d_function.py
- run: python examples/ipop_cma.py
- run: python examples/bipop_cma.py
- run: python examples/ellipsoid_function.py
- run: python examples/optuna_sampler.py
- run: python examples/lra_cma.py
- run: python examples/ws_cma.py
- run: python examples/cma_with_margin_binary.py
- run: python examples/cma_with_margin_integer.py
- run: python examples/safecma.py
- run: python examples/cma_sop.py
run: uv sync --group optional --group benchmark
- run: uv run python examples/quadratic_2d_function.py
- run: uv run python examples/ipop_cma.py
- run: uv run python examples/bipop_cma.py
- run: uv run python examples/ellipsoid_function.py
- run: uv run python examples/optuna_sampler.py
- run: uv run python examples/lra_cma.py
- run: uv run python examples/ws_cma.py
- run: uv run python examples/cma_with_margin_binary.py
- run: uv run python examples/cma_with_margin_integer.py
- run: uv run python examples/safecma.py
- run: uv run python examples/cma_sop.py
examples-cmawm-without-scipy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
architecture: x64
check-latest: true
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: |
pip install -U pip setuptools
pip install --progress-bar off -U .
- run: python examples/cma_with_margin_binary.py
- run: python examples/cma_with_margin_integer.py
run: uv sync
- run: uv run python examples/cma_with_margin_binary.py
- run: uv run python examples/cma_with_margin_integer.py
13 changes: 4 additions & 9 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,15 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v7
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --progress-bar off twine wheel build
- name: Build distribution packages
run: python -m build --sdist --wheel
run: uv build --sdist --wheel --no-sources
- name: Verify the distributions
run: twine check dist/*
run: uvx twine check dist/*

- uses: actions/upload-artifact@v4
with:
Expand All @@ -44,4 +40,3 @@ jobs:
run: |
export TAGNAME=$(jq --raw-output .ref "$GITHUB_EVENT_PATH" | sed -e "s/refs\/tags\///")
gh release create ${TAGNAME} --draft dist/*

45 changes: 12 additions & 33 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
architecture: x64
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --progress-bar off numpy matplotlib scipy mypy ruff torch gpytorch
- run: ruff check .
- run: ruff format --check .
- run: mypy cmaes
run: uv sync --group dev --group optional
- run: uv run ruff check .
- run: uv run ruff format --check .
- run: uv run mypy cmaes
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.9", "3.14"]
steps:
- uses: actions/checkout@v6
- name: Setup Python${{ matrix.python-version }}
uses: actions/setup-python@v6
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools numpy scipy hypothesis pytest torch gpytorch
pip install --progress-bar off .
- run: python -m pytest tests
test-numpy2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
architecture: x64
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools scipy hypothesis pytest torch gpytorch
python -m pip install --pre --upgrade numpy
pip install --progress-bar off .
- run: python -m pytest tests
run: uv sync --group dev --group optional
- run: uv run pytest tests

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ benchmark/*.json
*.stats
*.sqlite3

uv.lock

36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,39 @@ ignore = [
"E203",
]

[tool.uv]
exclude-newer = "1 week"
exclude-newer-package = { torch = false }

[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true

[tool.uv.sources]
torch = [
{ index = "pytorch-cpu" },
]

[dependency-groups]
dev = [
# lint
"mypy",
"ruff",
# tests
"pytest",
# visualization
"matplotlib",
]
optional = [
# for Safe CMA-ES
"torch",
"gpytorch",
# for CMA with margin
"scipy",
]
benchmark = [
"kurobako",
"cma",
"optuna",
]
3 changes: 0 additions & 3 deletions requirements-bench.txt

This file was deleted.

18 changes: 0 additions & 18 deletions requirements-dev.txt

This file was deleted.

63 changes: 0 additions & 63 deletions tests/test_fuzzing.py

This file was deleted.

Loading