-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into allow-dtype
* main: Update ci-additional.yaml (#167) Refactor before redoing cohorts (#164) Fix mypy errors in core.py (#150) Add link to numpy_groupies (#160) Bump codecov/codecov-action from 3.1.0 to 3.1.1 (#159) Use math.prod instead of np.prod (#157) Remove None output from _get_expected_groups (#152) Fix mypy errors in xarray.py, xrutils.py, cache.py (#144) Raise error if multiple by's are used with Ellipsis (#149) pre-commit autoupdate (#148) Add mypy ignores (#146) Get pre commit bot to update (#145) Remove duplicate examples headers (#147) Add ci additional (#143) Bump mamba-org/provision-with-micromamba from 12 to 13 (#141) Add ASV benchmark CI workflow (#139) Fix func count for dtype O with numpy and numba (#138)
- Loading branch information
Showing
20 changed files
with
734 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Benchmark | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize, labeled] | ||
workflow_dispatch: | ||
|
||
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. | ||
name: Linux | ||
runs-on: ubuntu-20.04 | ||
env: | ||
ASV_DIR: "./asv_bench" | ||
|
||
steps: | ||
# We need the full repo to avoid this issue | ||
# https://github.com/actions/checkout/issues/23 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up conda environment | ||
uses: mamba-org/provision-with-micromamba@v13 | ||
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 | ||
|
||
- name: Run benchmarks | ||
shell: bash -l {0} | ||
id: benchmark | ||
env: | ||
OPENBLAS_NUM_THREADS: 1 | ||
MKL_NUM_THREADS: 1 | ||
OMP_NUM_THREADS: 1 | ||
ASV_FACTOR: 1.5 | ||
ASV_SKIP_SLOW: 1 | ||
run: | | ||
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} \ | ||
| sed "/Traceback \|failed$\|PERFORMANCE DECREASED/ s/^/::error::/" \ | ||
| tee benchmarks.log | ||
# Report and export results for subsequent steps | ||
if grep "Traceback \|failed\|PERFORMANCE DECREASED" benchmarks.log > /dev/null ; then | ||
exit 1 | ||
fi | ||
working-directory: ${{ env.ASV_DIR }} | ||
|
||
- name: Add instructions to artifact | ||
if: always() | ||
run: | | ||
cp benchmarks/README_CI.md benchmarks.log .asv/results/ | ||
working-directory: ${{ env.ASV_DIR }} | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: asv-benchmark-results-${{ runner.os }} | ||
path: ${{ env.ASV_DIR }}/.asv/results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
name: CI Additional | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "*" | ||
workflow_dispatch: # allows you to trigger manually | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
detect-ci-trigger: | ||
name: detect ci trigger | ||
runs-on: ubuntu-latest | ||
if: | | ||
github.repository == 'xarray-contrib/flox' | ||
&& (github.event_name == 'push' || github.event_name == 'pull_request') | ||
outputs: | ||
triggered: ${{ steps.detect-trigger.outputs.trigger-found }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- uses: xarray-contrib/ci-trigger@v1.1 | ||
id: detect-trigger | ||
with: | ||
keyword: "[skip-ci]" | ||
|
||
doctest: | ||
name: Doctests | ||
runs-on: "ubuntu-latest" | ||
needs: detect-ci-trigger | ||
if: needs.detect-ci-trigger.outputs.triggered == 'false' | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
env: | ||
CONDA_ENV_FILE: ci/environment.yml | ||
PYTHON_VERSION: "3.10" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
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@34071ca7df4983ccd272ed0d3625818b27b70dcc | ||
with: | ||
environment-file: ${{env.CONDA_ENV_FILE}} | ||
environment-name: flox-tests | ||
extra-specs: | | ||
python=${{env.PYTHON_VERSION}} | ||
cache-env: true | ||
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" | ||
|
||
- name: Install flox | ||
run: | | ||
python -m pip install --no-deps -e . | ||
- name: Version info | ||
run: | | ||
conda info -a | ||
conda list | ||
- name: Run doctests | ||
run: | | ||
python -m pytest --doctest-modules flox --ignore flox/tests | ||
mypy: | ||
name: Mypy | ||
runs-on: "ubuntu-latest" | ||
needs: detect-ci-trigger | ||
if: needs.detect-ci-trigger.outputs.triggered == 'false' | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
env: | ||
CONDA_ENV_FILE: ci/environment.yml | ||
PYTHON_VERSION: "3.10" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
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@34071ca7df4983ccd272ed0d3625818b27b70dcc | ||
with: | ||
environment-file: ${{env.CONDA_ENV_FILE}} | ||
environment-name: xarray-tests | ||
extra-specs: | | ||
python=${{env.PYTHON_VERSION}} | ||
cache-env: true | ||
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" | ||
- name: Install xarray | ||
run: | | ||
python -m pip install --no-deps -e . | ||
- name: Version info | ||
run: | | ||
conda info -a | ||
conda list | ||
- name: Install mypy | ||
run: | | ||
python -m pip install mypy | ||
- name: Run mypy | ||
run: | | ||
python -m mypy --install-types --non-interactive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.