Skip to content

Commit e4ca066

Browse files
committed
Merge branch 'main' into numbagg
* 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 ...
2 parents acfd0ec + bed52b1 commit e4ca066

27 files changed

+2891
-316
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"

.github/workflows/cancel-duplicate-runs.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/ci-additional.yaml

Lines changed: 0 additions & 105 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 110 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
- cron: "0 0 * * *" # Daily “At 00:00”
1111
workflow_dispatch: # allows you to trigger manually
1212

13+
concurrency:
14+
group: ${{ github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
build:
1519
name: Build (${{ matrix.python-version }}, ${{ matrix.os }})
@@ -21,77 +25,132 @@ jobs:
2125
fail-fast: false
2226
matrix:
2327
os: ["ubuntu-latest"]
24-
python-version: ["3.7", "3.8", "3.9"]
28+
python-version: ["3.8", "3.10"]
2529
steps:
26-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v3
2731
with:
2832
fetch-depth: 0 # Fetch all history for all branches and tags.
2933
- name: Set environment variables
3034
run: |
31-
echo "CONDA_ENV_FILE=ci/environment.yml" >> $GITHUB_ENV
3235
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
33-
- name: Cache conda
34-
uses: actions/cache@v2
35-
with:
36-
path: ~/conda_pkgs_dir
37-
key:
38-
${{ runner.os }}-conda-py${{ matrix.python-version }}-${{
39-
hashFiles('ci/**.yml') }}
40-
- uses: conda-incubator/setup-miniconda@v2
41-
with:
42-
channels: conda-forge
43-
channel-priority: strict
44-
mamba-version: "*"
45-
activate-environment: flox-tests
46-
auto-update-conda: false
47-
python-version: ${{ matrix.python-version }}
48-
use-only-tar-bz2: true
49-
50-
- name: Install conda dependencies
51-
run: |
52-
mamba env update -f $CONDA_ENV_FILE
53-
5436
- name: Set up conda environment
55-
shell: bash -l {0}
37+
uses: mamba-org/provision-with-micromamba@v12
38+
with:
39+
environment-file: ci/environment.yml
40+
environment-name: flox-tests
41+
cache-env: true
42+
extra-specs: |
43+
python="${{ matrix.python-version }}"
44+
- name: Install flox
5645
run: |
5746
python -m pip install -e .
5847
conda list
59-
6048
- name: Run Tests
61-
shell: bash -l {0}
6249
run: |
6350
pytest -n auto --cov=./ --cov-report=xml
64-
6551
- name: Upload code coverage to Codecov
66-
uses: codecov/codecov-action@v1
52+
uses: codecov/codecov-action@v3.1.0
6753
with:
6854
file: ./coverage.xml
6955
flags: unittests
7056
env_vars: RUNNER_OS,PYTHON_VERSION
7157
name: codecov-umbrella
7258
fail_ci_if_error: false
7359

74-
# docs-build:
75-
# name: Documentation build
76-
# runs-on: ubuntu-latest
77-
# steps:
78-
# - name: Checkout
79-
# uses: actions/checkout@v2
80-
# - name: set up Python 3.8
81-
# uses: actions/setup-python@v2
82-
# with:
83-
# python-version: 3.8
84-
85-
# - name: Install package
86-
# run: |
87-
# python -m pip install --upgrade pip
88-
# python -m pip install -e .
60+
optional-deps:
61+
name: ${{ matrix.env }}
62+
runs-on: ${{ matrix.os }}
63+
defaults:
64+
run:
65+
shell: bash -l {0}
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
os: ["ubuntu-latest"]
70+
env:
71+
[
72+
"no-xarray",
73+
"no-dask",
74+
"minimal-requirements",
75+
]
76+
steps:
77+
- uses: actions/checkout@v3
78+
with:
79+
fetch-depth: 0 # Fetch all history for all branches and tags.
80+
- name: Set up conda environment
81+
uses: mamba-org/provision-with-micromamba@v12
82+
with:
83+
environment-file: ci/${{ matrix.env }}.yml
84+
environment-name: flox-tests
85+
cache-env: true
86+
extra-specs: |
87+
python="${{ matrix.python-version }}"
88+
- name: Install flox
89+
run: |
90+
python -m pip install --no-deps -e .
91+
- name: Run tests
92+
run: |
93+
python -m pytest -n auto
8994
90-
# - name: Install documentation dependencies
91-
# run: |
92-
# python -m pip install -r docs/requirements-docs.txt
95+
upstream-dev:
96+
name: upstream-dev
97+
runs-on: ubuntu-latest
98+
defaults:
99+
run:
100+
shell: bash -l {0}
101+
steps:
102+
- uses: actions/checkout@v3
103+
- name: Set up conda environment
104+
uses: mamba-org/provision-with-micromamba@v12
105+
with:
106+
environment-file: ci/upstream-dev-env.yml
107+
environment-name: flox-tests
108+
extra-specs: |
109+
python="3.10"
110+
- name: Run Tests
111+
run: |
112+
pytest -n 2
93113
94-
# - name: Build docs
95-
# run: |
96-
# cd docs
97-
# make html
114+
xarray-groupby:
115+
name: xarray-groupby
116+
runs-on: ubuntu-latest
117+
defaults:
118+
run:
119+
shell: bash -l {0}
120+
steps:
121+
- uses: actions/checkout@v3
122+
with:
123+
repository: 'pydata/xarray'
124+
fetch-depth: 0 # Fetch all history for all branches and tags.
125+
- name: Set up conda environment
126+
uses: mamba-org/provision-with-micromamba@v12
127+
with:
128+
environment-file: ci/requirements/environment.yml
129+
environment-name: xarray-tests
130+
cache-env: true
131+
extra-specs: |
132+
python="3.10"
133+
- name: Install xarray
134+
run: |
135+
python -m pip install --no-deps .
136+
- name: Install upstream flox
137+
run: |
138+
python -m pip install --no-deps \
139+
git+https://github.com/dcherian/flox.git@${{ github.ref }}
140+
- name: Version info
141+
run: |
142+
conda info -a
143+
conda list
144+
python xarray/util/print_versions.py
145+
- name: import xarray
146+
run: |
147+
python -c 'import xarray'
148+
- name: import flox
149+
run: |
150+
python -c 'import flox'
151+
- name: Run Tests
152+
if: success()
153+
id: status
154+
run: |
155+
set -euo pipefail
156+
python -m pytest -n auto xarray/tests/test_groupby.py

.github/workflows/pypi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ jobs:
88
deploy:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212
- name: Set up Python
13-
uses: actions/setup-python@v2
13+
uses: actions/setup-python@v4
1414
with:
1515
python-version: '3.x'
1616
- name: Install dependencies

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ ci:
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v4.1.0
6+
rev: v4.3.0
77
hooks:
88
- id: trailing-whitespace
99
- id: end-of-file-fixer
1010
- id: check-docstring-first
1111

1212
- repo: https://github.com/psf/black
13-
rev: 22.3.0
13+
rev: 22.6.0
1414
hooks:
1515
- id: black
1616

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
[![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)
1+
[![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)
2+
[![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)
3+
[![image](https://img.shields.io/codecov/c/github/xarray-contrib/flox.svg?style=flat)](https://codecov.io/gh/xarray-contrib/flox)
4+
[![Documentation Status](https://readthedocs.org/projects/flox/badge/?version=latest)](https://flox.readthedocs.io/en/latest/?badge=latest)
5+
6+
[![PyPI](https://img.shields.io/pypi/v/flox.svg?style=flat)](https://pypi.org/project/flox/)
7+
[![Conda-forge](https://img.shields.io/conda/vn/conda-forge/flox.svg?style=flat)](https://anaconda.org/conda-forge/flox)
8+
9+
[![NASA-80NSSC18M0156](https://img.shields.io/badge/NASA-80NSSC18M0156-blue)](https://earthdata.nasa.gov/esds/competitive-programs/access/pangeo-ml)
10+
[![NASA-80NSSC22K0345](https://img.shields.io/badge/NASA-80NSSC22K0345-blue)](https://science.nasa.gov/open-science-overview)
211

312
# flox
413

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

1726
## Acknowledgements
1827

19-
This work was funded in part by NASA-ACCESS 80NSSC18M0156 "Community tools for analysis of NASA Earth Observing System
20-
Data in the Cloud" (PI J. Hamman), and [NCAR's Earth System Data Science Initiative](https://ncar.github.io/esds/).
28+
This work was funded in part by
29+
1. NASA-ACCESS 80NSSC18M0156 "Community tools for analysis of NASA Earth Observing System
30+
Data in the Cloud" (PI J. Hamman, NCAR),
31+
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
32+
3. [NCAR's Earth System Data Science Initiative](https://ncar.github.io/esds/).
33+
2134
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.
2235

2336
## API

ci/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ dependencies:
1616
- ipykernel
1717
- jupyter
1818
- pip:
19-
- git+https://github.com/dcherian/flox
19+
- git+https://github.com/xarray-contrib/flox

ci/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
- pytest-xdist
1414
- xarray
1515
- pre-commit
16-
- numpy_groupies
16+
- numpy_groupies>=0.9.15
1717
- pooch
1818
- toolz
1919
- numba

0 commit comments

Comments
 (0)