Skip to content

Commit

Permalink
Merge branch 'main' into cupy
Browse files Browse the repository at this point in the history
* main: (24 commits)
  Add `packaging` as dependency
  use engine flox for ordered groups (#266)
  Update pyproject.toml: py3.12
  Bump numpy to >=1.22 (#278)
  Cleanups (#276)
  benchmarks updates (#273)
  repo-review comments (#270)
  Significantly faster cohorts detection. (#272)
  Add engine="numbagg" (#72)
  Support quantile, median, mode with method="blockwise". (#269)
  Add multidimensional binning demo (#203)
  [pre-commit.ci] pre-commit autoupdate (#268)
  Drop python 3.8, test python 3.11 (#209)
  tests: move xfail out of functions (#265)
  Bump actions/checkout from 3 to 4 (#267)
  convert datetime: micro-optimizations (#261)
  compatibility with `numpy>=2.0` (#257)
  replace the deprecated `provision-with-micromamba` with `setup-micromamba` (#258)
  Fix some typing errors in asv_bench and tests (#253)
  [pre-commit.ci] pre-commit autoupdate (#250)
  ...
  • Loading branch information
dcherian committed Nov 3, 2023
2 parents 796dcd2 + c15572e commit eb81f56
Show file tree
Hide file tree
Showing 47 changed files with 16,532 additions and 795 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
benchmark:
# if: ${{ contains( github.event.pull_request.labels.*.name, 'run-benchmark') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} # Run if the PR has been labelled correctly.
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} # Always run.
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} # Always run.
name: Linux
runs-on: ubuntu-20.04
env:
Expand All @@ -17,24 +17,20 @@ jobs:
steps:
# We need the full repo to avoid this issue
# https://github.com/actions/checkout/issues/23
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up conda environment
uses: mamba-org/provision-with-micromamba@v15
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/environment.yml
environment-name: flox-tests
cache-env: true
# extra-specs: |
# python="${{ matrix.python-version }}"

# - name: Setup some dependencies
# shell: bash -l {0}
# run: |
# pip install asv
# sudo apt-get update -y
environment-name: flox-bench
create-args: >-
python=3.10
asv
mamba
init-shell: bash
cache-environment: true

- name: Run benchmarks
shell: bash -l {0}
Expand All @@ -46,14 +42,11 @@ jobs:
ASV_FACTOR: 1.5
ASV_SKIP_SLOW: 1
run: |
set -x
# set -x
# ID this runner
asv machine --yes
echo "Baseline: ${{ github.event.pull_request.base.sha }} (${{ github.event.pull_request.base.label }})"
echo "Contender: ${GITHUB_SHA} (${{ github.event.pull_request.head.label }})"
# Use mamba for env creation
# export CONDA_EXE=$(which mamba)
export CONDA_EXE=$(which conda)
# Run benchmarks for current commit against base
ASV_OPTIONS="--split --show-stderr --factor $ASV_FACTOR"
asv continuous $ASV_OPTIONS ${{ github.event.pull_request.base.sha }} ${GITHUB_SHA} \
Expand Down
37 changes: 21 additions & 16 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
outputs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: xarray-contrib/ci-trigger@v1.2
Expand All @@ -41,10 +41,10 @@ jobs:

env:
CONDA_ENV_FILE: ci/environment.yml
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.11"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

Expand All @@ -53,14 +53,15 @@ jobs:
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Setup micromamba
uses: mamba-org/provision-with-micromamba@v15
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{env.CONDA_ENV_FILE}}
environment-name: flox-tests
extra-specs: |
python=${{env.PYTHON_VERSION}}
cache-env: true
init-shell: bash
cache-environment: true
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
create-args: |
python=${{ env.PYTHON_VERSION }}
- name: Install flox
run: |
Expand All @@ -71,9 +72,12 @@ jobs:
conda list
- name: Run doctests
run: |
python -m pytest --doctest-modules flox --ignore flox/tests --cov=./ --cov-report=xml
python -m pytest --doctest-modules \
flox/aggregations.py flox/core.py flox/xarray.py \
--ignore flox/tests \
--cov=./ --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3.1.3
uses: codecov/codecov-action@v3.1.4
with:
file: ./coverage.xml
flags: unittests
Expand All @@ -91,25 +95,26 @@ jobs:
shell: bash -l {0}
env:
CONDA_ENV_FILE: ci/environment.yml
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.11"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: set environment variables
run: |
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Setup micromamba
uses: mamba-org/provision-with-micromamba@v15
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{env.CONDA_ENV_FILE}}
environment-name: flox-tests
extra-specs: |
python=${{env.PYTHON_VERSION}}
cache-env: true
init-shell: bash
cache-environment: true
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
create-args: |
python=${{ env.PYTHON_VERSION }}
- name: Install flox
run: |
python -m pip install --no-deps -e .
Expand All @@ -126,7 +131,7 @@ jobs:
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
- name: Upload mypy coverage to Codecov
uses: codecov/codecov-action@v3.1.3
uses: codecov/codecov-action@v3.1.4
with:
file: mypy_report/cobertura.xml
flags: mypy
Expand Down
57 changes: 30 additions & 27 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,31 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.8", "3.10"]
python-version: ["3.9", "3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set environment variables
run: |
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Set up conda environment
uses: mamba-org/provision-with-micromamba@v15
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/environment.yml
environment-name: flox-tests
cache-env: true
extra-specs: |
python="${{ matrix.python-version }}"
init-shell: bash
cache-environment: true
create-args: |
python=${{ matrix.python-version }}
- name: Install flox
run: |
python -m pip install --no-deps -e .
- name: Run Tests
run: |
pytest -n auto --cov=./ --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3.1.3
uses: codecov/codecov-action@v3.1.4
with:
file: ./coverage.xml
flags: unittests
Expand All @@ -58,40 +59,41 @@ jobs:

optional-deps:
name: ${{ matrix.env }}
runs-on: ${{ matrix.os }}
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
env:
[
"no-xarray",
"no-dask",
"minimal-requirements",
]
python-version: ["3.11"]
env: ["no-xarray", "no-dask"]
include:
- env: "no-numba"
python-version: "3.12"
- env: "minimal-requirements"
python-version: "3.9"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set up conda environment
uses: mamba-org/provision-with-micromamba@v15
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/${{ matrix.env }}.yml
environment-name: flox-tests
cache-env: true
extra-specs: |
python="${{ matrix.python-version }}"
init-shell: bash
cache-environment: true
create-args: |
python=${{ matrix.python-version }}
- name: Install flox
run: |
python -m pip install --no-deps -e .
- name: Run tests
run: |
python -m pytest -n auto --cov=./ --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3.1.3
uses: codecov/codecov-action@v3.1.4
with:
file: ./coverage.xml
flags: unittests
Expand All @@ -106,18 +108,19 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: 'pydata/xarray'
repository: "pydata/xarray"
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set up conda environment
uses: mamba-org/provision-with-micromamba@v15
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/requirements/environment.yml
environment-name: xarray-tests
cache-env: true
extra-specs: |
python="3.10"
init-shell: bash
cache-environment: true
create-args: |
python=3.10
- name: Install xarray
run: |
python -m pip install --no-deps .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/testpypi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
if: ${{ contains( github.event.pull_request.labels.*.name, 'test-build') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.10"
python-version: "3.11"

- name: Install dependencies
run: |
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.10"
python-version: "3.11"
- uses: actions/download-artifact@v3
with:
name: releases
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,30 @@ jobs:
upstream-dev:
name: upstream-dev
runs-on: ubuntu-latest
if: ${{ contains( github.event.pull_request.labels.*.name, 'test-upstream') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
if: ${{ (contains(github.event.pull_request.labels.*.name, 'test-upstream') && github.event_name == 'pull_request') || github.event_name == 'workflow_dispatch' }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set environment variables
run: |
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Set up conda environment
uses: mamba-org/provision-with-micromamba@v15
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/upstream-dev-env.yml
environment-name: flox-tests
extra-specs: |
python="${{ matrix.python-version }}"
init-shell: bash
cache-environment: true
create-args: >-
python=${{ matrix.python-version }}
pytest-reportlog
- name: Install flox
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
asv_bench/pkgs/
docs/source/generated/
html/
.asv/
asv_bench/pkgs/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
Loading

0 comments on commit eb81f56

Please sign in to comment.