-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different behavior of groupby with / without flox #9279
Comments
The error message mentions: |
Or we can fix the bug here: Lines 812 to 818 in d0048ef
We need to raise the error for virtual variables too. |
OK great! (so I understand — when we change the default, would |
Turns out it has to do with sortedness of xarray/xarray/core/groupers.py Lines 122 to 126 in d0048ef
Could switch it to add |
OK great! So it sounds like after we make that change, it won't be required to pass any dimensions to the aggregation func — That'll be much better than the current state, where not passing anything to TY! |
Setting #7427 removes the dependence on sortedness. That is, once merged, it will dependably error on |
Closes pydata#9279 Closes pydata#1460 Closes pydata#2157
Closes pydata#9279 Closes pydata#1460 Closes pydata#2157
Closes pydata#9279 Closes pydata#1460 Closes pydata#2157
Closes pydata#9279 Closes pydata#1460 Closes pydata#2157
OK v nice — on #7427 this dependably works on both flox & no flox, both ordered & unordered. with xr.set_options(use_flox=True):
print(da.assign_coords(lat=lambda x: x.lat % 2).groupby('lat', squeeze=False).sum()) |
Closed by #9280, thanks ! |
* Fully deprecate squeeze kwarg to groupby Closes #9279 Closes #1460 Closes #2157 * Fix doctests * Update xarray/core/groupby.py Co-authored-by: Maximilian Roos <[email protected]> * Fix whats-new * Update doc/whats-new.rst --------- Co-authored-by: Maximilian Roos <[email protected]>
What happened?
(Following up from #8263)
Without flox:
But with flox:
What did you expect to happen?
Identical behavior
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
No response
Anything else we need to know?
No response
Environment
INSTALLED VERSIONS
commit: d0048ef
python: 3.11.9 (main, Apr 2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.3.9.4)]
python-bits: 64
OS: Darwin
OS-release: 23.5.0
machine: arm64
processor: arm
byteorder: little
LC_ALL: en_US.UTF-8
LANG: None
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.12.2
libnetcdf: 4.9.3-development
xarray: 2024.6.1.dev50+g7b08a948
pandas: 2.2.2
numpy: 1.26.4
scipy: 1.13.1
netCDF4: 1.6.5
pydap: None
h5netcdf: 1.3.0
h5py: 3.11.0
zarr: 2.18.2
cftime: 1.6.3
nc_time_axis: 1.4.1
iris: None
bottleneck: 1.3.8
dask: 2024.7.0
distributed: 2024.7.0
matplotlib: 3.9.0
cartopy: None
seaborn: 0.13.2
numbagg: 0.8.1
fsspec: 2024.5.0
cupy: None
pint: None
sparse: None
flox: 0.9.8
numpy_groupies: 0.11.1
setuptools: 69.2.0
pip: 24.0
conda: None
pytest: 8.2.1
mypy: 1.8.0
IPython: 8.25.0
sphinx: None
The text was updated successfully, but these errors were encountered: