Skip to content

TYP: add Shape alias to pandas._typing #37128

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

Merged
merged 20 commits into from
Nov 4, 2020
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5e4f0e8
ENH: add Shape alias to _typing
arw2019 Oct 15, 2020
e55300c
TYP: use Shape alias in core/arrays/_mixins.py
arw2019 Oct 15, 2020
c88296c
TYP: use Shape alias in core/arrays/base.py
arw2019 Oct 15, 2020
6ab0461
TYP: use Shape alias in core/dtypes/cast.py
arw2019 Oct 15, 2020
1874f1f
TYP: use Shape alias in core/groupby/ops.py
arw2019 Oct 15, 2020
bd44ab7
TYP: use Shape alias in core/indexes/base.py
arw2019 Oct 15, 2020
cce1fc5
TYP: use Shape alias in core/indexes/multi.py
arw2019 Oct 15, 2020
0270d8d
TYP: use Shape alias in core/internals/blocks.py
arw2019 Oct 15, 2020
fab97b4
TYP: use Shape alias in core/internals/concat.py
arw2019 Oct 15, 2020
82ee79b
TYP: use Shape alias in core/internals/managers.py
arw2019 Oct 15, 2020
be11b55
TYP: use Shape alias in core/internals/managers.py
arw2019 Oct 15, 2020
c1faa9f
TYP: use Shape alias in core/io/pytables.py
arw2019 Oct 15, 2020
759e04f
use Shape = Tuple[int]
arw2019 Oct 15, 2020
1bdc0f3
revert change to _maybe_upcast_for_op docstring
arw2019 Oct 16, 2020
5a11286
Merge remote-tracking branch 'upstream/master' into TYP_add_shape_alias
arw2019 Oct 29, 2020
9f97162
Merge remote-tracking branch 'upstream/master' into TYP_add_shape_alias
arw2019 Oct 30, 2020
3c1679e
Merge remote-tracking branch 'upstream/master' into TYP_add_shape_alias
arw2019 Nov 1, 2020
ef2dd72
merge with master
arw2019 Nov 1, 2020
7f8a811
Merge remote-tracking branch 'upstream/master' into TYP_add_shape_alias
arw2019 Nov 4, 2020
b6c93ee
Merge remote-tracking branch 'upstream/master' into TYP_add_shape_alias
arw2019 Nov 4, 2020
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
Prev Previous commit
Next Next commit
TYP: use Shape alias in core/arrays/_mixins.py
  • Loading branch information
arw2019 committed Oct 17, 2020
commit e55300ccbb46a2e9ee5bdfe4623ab1d0b9630823
5 changes: 3 additions & 2 deletions pandas/core/arrays/_mixins.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from typing import Any, Sequence, Tuple, TypeVar
from typing import Any, Sequence, TypeVar

import numpy as np

from pandas._libs import lib
from pandas._typing import Shape
from pandas.compat.numpy import function as nv
from pandas.errors import AbstractMethodError
from pandas.util._decorators import cache_readonly, doc
Expand Down Expand Up @@ -84,7 +85,7 @@ def _validate_fill_value(self, fill_value):
# TODO: make this a cache_readonly; for that to work we need to remove
# the _index_data kludge in libreduction
@property
def shape(self) -> Tuple[int, ...]:
def shape(self) -> Shape:
return self._ndarray.shape

def __len__(self) -> int:
Expand Down