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
45 changes: 15 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ jobs:
envs: ${{ steps.get-envs.outputs.envs }}
pythons: ${{ steps.get-pythons.outputs.pythons }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: blob:none
- name: Install uv
uses: astral-sh/setup-uv@v5
- uses: actions/checkout@v5
with: { fetch-depth: 0, filter: "blob:none" }
- uses: astral-sh/setup-uv@v7
- name: Get test environments
id: get-envs
run: |
Expand Down Expand Up @@ -53,14 +50,10 @@ jobs:
python: "3.13"
os: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: blob:none
- uses: astral-sh/setup-uv@v5
- uses: actions/checkout@v5
with: { fetch-depth: 0, filter: "blob:none" }
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
python-version: ${{ matrix.env.python }}
- name: create environment
run: uvx hatch env create ${{ matrix.env.name }}
Expand All @@ -80,33 +73,27 @@ jobs:
name: CPU Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with: { fetch-depth: 0, filter: "blob:none" }
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
- uses: astral-sh/setup-uv@v7
- run: uv pip install --system -e .[test,full]
- uses: CodSpeedHQ/action@v3
with:
run: pytest -m benchmark --codspeed
run: pytest -m benchmark --codspeed -n auto
token: ${{ secrets.CODSPEED_TOKEN }}
import:
name: Import Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: blob:none
- uses: actions/checkout@v5
with: { fetch-depth: 0, filter: "blob:none" }
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: pyproject.toml
- uses: astral-sh/setup-uv@v7
- run: uv pip install --system -e .
- run: python -c 'import fast_array_utils as fau; print(fau.__all__)'
- run: uv pip install --system -e .[testing]
Expand All @@ -121,10 +108,8 @@ jobs:
env:
SKIP: no-commit-to-branch # this CI runs on the main branch
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: blob:none
- uses: actions/checkout@v5
with: { fetch-depth: 0, filter: "blob:none" }
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ optional-dependencies.test-min = [
"pytest",
"pytest-codspeed",
"pytest-doctestplus",
"pytest-xdist",
]
optional-dependencies.testing = [ "packaging" ]
urls.'Documentation' = "https://icb-fast-array-utils.readthedocs-hosted.com/"
Expand Down
6 changes: 4 additions & 2 deletions tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,10 @@ def test_stats_benchmark(
axis: Literal[0, 1] | None,
dtype: type[np.float32 | np.float64],
) -> None:
shape = (10_000, 10_000) if "sparse" in array_type.mod else (1000, 1000)
arr = array_type.random(shape, dtype=dtype)
# test with 10M elements will take 20ms for the fastest functions
n_elems, density = 10_000_000, 0.01
n = int(np.sqrt(n_elems / density if "sparse" in array_type.mod else n_elems))
arr = array_type.random((n, n), density=density, dtype=dtype)

func(arr, axis=axis) # warmup: numba compile
benchmark(func, arr, axis=axis)
Loading