Skip to content

Commit

Permalink
Merge branch 'main' into numbagg
Browse files Browse the repository at this point in the history
* main: (44 commits)
  Rename repo to xarray-contrib/flox (#125)
  Propagate attrs better (#124)
  Update README.md (#123)
  Update README.md
  micromamba in CI (#122)
  Many optimizations (#120)
  Add xarray groupby test (#121)
  Update README.md
  Update README.md
  Add NASA Xarray grant
  [pre-commit.ci] pre-commit autoupdate (#118)
  Allow custom numpy aggregations for "blockwise" (#117)
  Don't execute hourly climatology notebook (#98)
  Bump actions/setup-python from 3 to 4 (#116)
  Fix factorizing some more. (#115)
  Correctly factorize values outside bin edges
  Better error message
  Avoid a copy.
  Fix bug where we had extra groups in expected_groups. (#112)
  Fix binning by nD variable
  ...
  • Loading branch information
dcherian committed Jul 13, 2022
2 parents acfd0ec + bed52b1 commit e4ca066
Show file tree
Hide file tree
Showing 27 changed files with 2,891 additions and 316 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
14 changes: 0 additions & 14 deletions .github/workflows/cancel-duplicate-runs.yaml

This file was deleted.

105 changes: 0 additions & 105 deletions .github/workflows/ci-additional.yaml

This file was deleted.

161 changes: 110 additions & 51 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
- cron: "0 0 * * *" # Daily “At 00:00”
workflow_dispatch: # allows you to trigger manually

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build (${{ matrix.python-version }}, ${{ matrix.os }})
Expand All @@ -21,77 +25,132 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.7", "3.8", "3.9"]
python-version: ["3.8", "3.10"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set environment variables
run: |
echo "CONDA_ENV_FILE=ci/environment.yml" >> $GITHUB_ENV
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Cache conda
uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-py${{ matrix.python-version }}-${{
hashFiles('ci/**.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
channel-priority: strict
mamba-version: "*"
activate-environment: flox-tests
auto-update-conda: false
python-version: ${{ matrix.python-version }}
use-only-tar-bz2: true

- name: Install conda dependencies
run: |
mamba env update -f $CONDA_ENV_FILE
- name: Set up conda environment
shell: bash -l {0}
uses: mamba-org/provision-with-micromamba@v12
with:
environment-file: ci/environment.yml
environment-name: flox-tests
cache-env: true
extra-specs: |
python="${{ matrix.python-version }}"
- name: Install flox
run: |
python -m pip install -e .
conda list
- name: Run Tests
shell: bash -l {0}
run: |
pytest -n auto --cov=./ --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3.1.0
with:
file: ./coverage.xml
flags: unittests
env_vars: RUNNER_OS,PYTHON_VERSION
name: codecov-umbrella
fail_ci_if_error: false

# docs-build:
# name: Documentation build
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: set up Python 3.8
# uses: actions/setup-python@v2
# with:
# python-version: 3.8

# - name: Install package
# run: |
# python -m pip install --upgrade pip
# python -m pip install -e .
optional-deps:
name: ${{ matrix.env }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
env:
[
"no-xarray",
"no-dask",
"minimal-requirements",
]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set up conda environment
uses: mamba-org/provision-with-micromamba@v12
with:
environment-file: ci/${{ matrix.env }}.yml
environment-name: flox-tests
cache-env: true
extra-specs: |
python="${{ matrix.python-version }}"
- name: Install flox
run: |
python -m pip install --no-deps -e .
- name: Run tests
run: |
python -m pytest -n auto
# - name: Install documentation dependencies
# run: |
# python -m pip install -r docs/requirements-docs.txt
upstream-dev:
name: upstream-dev
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- name: Set up conda environment
uses: mamba-org/provision-with-micromamba@v12
with:
environment-file: ci/upstream-dev-env.yml
environment-name: flox-tests
extra-specs: |
python="3.10"
- name: Run Tests
run: |
pytest -n 2
# - name: Build docs
# run: |
# cd docs
# make html
xarray-groupby:
name: xarray-groupby
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
with:
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@v12
with:
environment-file: ci/requirements/environment.yml
environment-name: xarray-tests
cache-env: true
extra-specs: |
python="3.10"
- name: Install xarray
run: |
python -m pip install --no-deps .
- name: Install upstream flox
run: |
python -m pip install --no-deps \
git+https://github.com/dcherian/flox.git@${{ github.ref }}
- name: Version info
run: |
conda info -a
conda list
python xarray/util/print_versions.py
- name: import xarray
run: |
python -c 'import xarray'
- name: import flox
run: |
python -c 'import flox'
- name: Run Tests
if: success()
id: status
run: |
set -euo pipefail
python -m pytest -n auto xarray/tests/test_groupby.py
4 changes: 2 additions & 2 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.6.0
hooks:
- id: black

Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[![GitHub Workflow CI Status](https://img.shields.io/github/workflow/status/dcherian/flox/CI?logo=github&style=flat)](https://github.com/dcherian/flox/actions)[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/dcherian/flox/main.svg)](https://results.pre-commit.ci/latest/github/dcherian/flox/main)[![image](https://img.shields.io/codecov/c/github/dcherian/flox.svg?style=flat)](https://codecov.io/gh/dcherian/flox)[![PyPI](https://img.shields.io/pypi/v/flox.svg?style=flat)](https://pypi.org/project/flox/)[![Conda-forge](https://img.shields.io/conda/vn/conda-forge/flox.svg?style=flat)](https://anaconda.org/conda-forge/flox)[![Documentation Status](https://readthedocs.org/projects/flox/badge/?version=latest)](https://flox.readthedocs.io/en/latest/?badge=latest)[![NASA-80NSSC18M0156](https://img.shields.io/badge/NASA-80NSSC18M0156-blue)](https://earthdata.nasa.gov/esds/competitive-programs/access/pangeo-ml)
[![GitHub Workflow CI Status](https://img.shields.io/github/workflow/status/xarray-contrib/flox/CI?logo=github&style=flat)](https://github.com/xarray-contrib/flox/actions)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/xarray-contrib/flox/main.svg)](https://results.pre-commit.ci/latest/github/xarray-contrib/flox/main)
[![image](https://img.shields.io/codecov/c/github/xarray-contrib/flox.svg?style=flat)](https://codecov.io/gh/xarray-contrib/flox)
[![Documentation Status](https://readthedocs.org/projects/flox/badge/?version=latest)](https://flox.readthedocs.io/en/latest/?badge=latest)

[![PyPI](https://img.shields.io/pypi/v/flox.svg?style=flat)](https://pypi.org/project/flox/)
[![Conda-forge](https://img.shields.io/conda/vn/conda-forge/flox.svg?style=flat)](https://anaconda.org/conda-forge/flox)

[![NASA-80NSSC18M0156](https://img.shields.io/badge/NASA-80NSSC18M0156-blue)](https://earthdata.nasa.gov/esds/competitive-programs/access/pangeo-ml)
[![NASA-80NSSC22K0345](https://img.shields.io/badge/NASA-80NSSC22K0345-blue)](https://science.nasa.gov/open-science-overview)

# flox

Expand All @@ -16,8 +25,12 @@ about this package, from the Pangeo Showcase).

## Acknowledgements

This work was funded in part by NASA-ACCESS 80NSSC18M0156 "Community tools for analysis of NASA Earth Observing System
Data in the Cloud" (PI J. Hamman), and [NCAR's Earth System Data Science Initiative](https://ncar.github.io/esds/).
This work was funded in part by
1. NASA-ACCESS 80NSSC18M0156 "Community tools for analysis of NASA Earth Observing System
Data in the Cloud" (PI J. Hamman, NCAR),
2. NASA-OSTFL 80NSSC22K0345 "Enhancing analysis of NASA data with the open-source Python Xarray Library" (PIs Scott Henderson, University of Washington; Deepak Cherian, NCAR; Jessica Scheick, University of New Hampshire), and
3. [NCAR's Earth System Data Science Initiative](https://ncar.github.io/esds/).

It was motivated by [very](https://github.com/pangeo-data/pangeo/issues/266) [very](https://github.com/pangeo-data/pangeo/issues/271) [many](https://github.com/dask/distributed/issues/2602) [discussions](https://github.com/pydata/xarray/issues/2237) in the [Pangeo](https://pangeo.io) community.

## API
Expand Down
2 changes: 1 addition & 1 deletion ci/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ dependencies:
- ipykernel
- jupyter
- pip:
- git+https://github.com/dcherian/flox
- git+https://github.com/xarray-contrib/flox
2 changes: 1 addition & 1 deletion ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- pytest-xdist
- xarray
- pre-commit
- numpy_groupies
- numpy_groupies>=0.9.15
- pooch
- toolz
- numba
Expand Down
Loading

0 comments on commit e4ca066

Please sign in to comment.