Skip to content
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

Typing of GroupBy & Co. #6702

Merged
merged 38 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b40e62a
initial groupby support
headtr1ck Jun 17, 2022
a4f2cd3
more typing of groupby funcs
headtr1ck Jun 17, 2022
2d06e25
type all groupby methods
headtr1ck Jun 17, 2022
c8f07bd
remove old groupby methods
headtr1ck Jun 17, 2022
ddb51f3
remove unused typevar
headtr1ck Jun 17, 2022
3d867a2
more consistent groupby.dims typing and new groupby.sizes
headtr1ck Jun 17, 2022
33e9d8d
typing for coarsen objects
headtr1ck Jun 17, 2022
cd2f2b2
type resample
headtr1ck Jun 17, 2022
0f7c3da
fix import in TYPE_CHECKING
headtr1ck Jun 17, 2022
5d43285
add new typing to whats-new
headtr1ck Jun 17, 2022
9200673
fix some import issues
headtr1ck Jun 17, 2022
64505af
fix some import issues
headtr1ck Jun 17, 2022
345a056
more fixes
headtr1ck Jun 17, 2022
89f4b88
add GroupKey synonym for Any
headtr1ck Jun 17, 2022
f8b6afa
no type checking for coarsen reductions
headtr1ck Jun 18, 2022
2a64022
remove type: ignore
headtr1ck Jun 18, 2022
7034563
remove some more type: ignore
headtr1ck Jun 18, 2022
2564d57
selected imports
headtr1ck Jun 18, 2022
484d303
minor typing and docstring improvements
headtr1ck Jun 18, 2022
14dd8dd
improve rolling typing
headtr1ck Jun 18, 2022
6b47c55
Update xarray/core/resample.py
headtr1ck Jun 19, 2022
265870b
Update xarray/core/rolling.py
headtr1ck Jun 19, 2022
0d7e12c
Update xarray/tests/test_groupby.py
headtr1ck Jun 19, 2022
0dc1532
Update xarray/core/rolling.py
headtr1ck Jun 19, 2022
c37fa70
Update xarray/tests/test_groupby.py
headtr1ck Jun 19, 2022
6008dae
Update xarray/tests/test_groupby.py
headtr1ck Jun 19, 2022
305716d
Update xarray/tests/test_groupby.py
headtr1ck Jun 19, 2022
4d37705
Update xarray/tests/test_groupby.py
headtr1ck Jun 19, 2022
608002b
Update xarray/core/variable.py
headtr1ck Jun 19, 2022
21c662b
Update xarray/core/variable.py
headtr1ck Jun 19, 2022
7e1b21e
Update xarray/tests/test_groupby.py
headtr1ck Jun 19, 2022
e400328
Merge branch 'main' into typing3
headtr1ck Jun 25, 2022
b89d9dc
reorder whats-new
headtr1ck Jun 25, 2022
2a6c48f
restructure Resample funcs
headtr1ck Jun 25, 2022
880eb77
change to math.prod
headtr1ck Jun 25, 2022
87d36ed
move asfreq Data{Array,set}Resample
headtr1ck Jun 26, 2022
4c0aa8d
remove abstract asfreq method
headtr1ck Jun 26, 2022
4d9c459
Merge branch 'main' into typing3
dcherian Jun 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ v2022.06.0 (unreleased)
New Features
~~~~~~~~~~~~

- Initial typing support for :py:meth:`groupby`, :py:meth:`rolling`, :py:meth:`rolling_exp`,
:py:meth:`coarsen`, :py:meth:`weighted`, :py:meth:`resample`,
(:pull:`6702`)
By `Michael Niklas <https://github.com/headtr1ck>`_.


Deprecations
~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def _normalize_indexes(
normalized_index_vars = {}
for idx, index_vars in Indexes(xr_indexes, xr_variables).group_by_index():
coord_names_and_dims = []
all_dims = set()
all_dims: set[Hashable] = set()

for name, var in index_vars.items():
dims = var.dims
Expand Down
Loading