Skip to content

Commit 2b889f4

Browse files
authored
Test with flox (#339)
* Test with flox * Actually test * [test-upstream] * [test-upstream] * [test-upstream] * Fix grouped subtraction test a bit
1 parent 3ddf96a commit 2b889f4

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

cf_xarray/tests/test_accessor.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,8 +1318,12 @@ def test_groupby_special_ops():
13181318
assert_identical(group, cfgroup)
13191319

13201320
# arithmetic
1321-
expected = grouped - grouped.mean()
1322-
actual = grouped - cfgrouped.mean()
1321+
# TODO: Extremely buggy!
1322+
# 1. cfgrouped - cfgrouped.mean() raises RecursionError
1323+
# 2. use_flox=True doesn't preserve attributes for some reason
1324+
with xr.set_options(keep_attrs=True):
1325+
expected = grouped - grouped.mean()
1326+
actual = grouped - cfgrouped.mean()
13231327
assert_identical(expected, actual)
13241328

13251329

ci/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dependencies:
66
- pytest
77
- pytest-xdist
88
- dask
9+
- flox
910
- matplotlib-base
1011
- netcdf4
1112
- pandas

ci/upstream-dev-env.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ dependencies:
1313
- shapely
1414
- pip:
1515
- git+https://github.com/pydata/xarray
16+
- git+https://github.com/dcherian/flox
1617
- git+https://github.com/hgrecco/pint

0 commit comments

Comments
 (0)