Skip to content

Commit 3646ea6

Browse files
committed
More changes
1 parent a10b86b commit 3646ea6

File tree

15 files changed

+82
-45
lines changed

15 files changed

+82
-45
lines changed

doc/source/reference/groupby.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
=======
66
GroupBy
77
=======
8-
.. currentmodule:: pandas.core.groupby
8+
.. currentmodule:: pandas.api.typing
99

1010
:class:`pandas.api.typing.DataFrameGroupBy` and :class:`pandas.api.typing.SeriesGroupBy`
1111
instances are returned by groupby calls :func:`pandas.DataFrame.groupby` and
@@ -40,7 +40,7 @@ Function application helper
4040

4141
NamedAgg
4242

43-
.. currentmodule:: pandas.core.groupby
43+
.. currentmodule:: pandas.api.typing
4444

4545
Function application
4646
--------------------

doc/source/reference/resampling.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
==========
66
Resampling
77
==========
8-
.. currentmodule:: pandas.core.resample
8+
.. currentmodule:: pandas.api.typing
99

1010
:class:`pandas.api.typing.Resampler` instances are returned by
1111
resample calls: :func:`pandas.DataFrame.resample`, :func:`pandas.Series.resample`.

doc/source/reference/window.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ calls: :func:`pandas.DataFrame.ewm` and :func:`pandas.Series.ewm`.
1717

1818
Rolling window functions
1919
------------------------
20-
.. currentmodule:: pandas.core.window.rolling
20+
.. currentmodule:: pandas.api.typing
2121

2222
.. autosummary::
2323
:toctree: api/
@@ -48,7 +48,8 @@ Rolling window functions
4848

4949
Weighted window functions
5050
-------------------------
51-
.. currentmodule:: pandas.core.window.rolling
51+
.. currentmodule:: pandas.api.typing
52+
5253

5354
.. autosummary::
5455
:toctree: api/
@@ -62,7 +63,8 @@ Weighted window functions
6263

6364
Expanding window functions
6465
--------------------------
65-
.. currentmodule:: pandas.core.window.expanding
66+
.. currentmodule:: pandas.api.typing
67+
6668

6769
.. autosummary::
6870
:toctree: api/
@@ -93,7 +95,8 @@ Expanding window functions
9395

9496
Exponentially-weighted window functions
9597
---------------------------------------
96-
.. currentmodule:: pandas.core.window.ewm
98+
.. currentmodule:: pandas.api.typing
99+
97100

98101
.. autosummary::
99102
:toctree: api/

doc/source/user_guide/enhancingperf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ by evaluate arithmetic and boolean expression all at once for large :class:`~pan
455455
:func:`~pandas.eval` is many orders of magnitude slower for
456456
smaller expressions or objects than plain Python. A good rule of thumb is
457457
to only use :func:`~pandas.eval` when you have a
458-
:class:`~pandas.core.frame.DataFrame` with more than 10,000 rows.
458+
:class:`~pandas.DataFrame` with more than 10,000 rows.
459459

460460
Supported syntax
461461
~~~~~~~~~~~~~~~~

pandas/_config/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ def __init__(self, d: dict[str, Any], prefix: str = "") -> None:
412412
object.__setattr__(self, "prefix", prefix)
413413

414414
def __setattr__(self, key: str, val: Any) -> None:
415+
if key == "__module__":
416+
super().__setattr__(key, val)
417+
return
415418
prefix = object.__getattribute__(self, "prefix")
416419
if prefix:
417420
prefix += "."
@@ -442,6 +445,7 @@ def __dir__(self) -> list[str]:
442445

443446

444447
options = DictWrapper(_global_config)
448+
options.__module__ = "pandas"
445449

446450
#
447451
# Functions for use by pandas developers, in addition to User - api

pandas/_libs/lib.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2944,7 +2944,9 @@ class _NoDefault(Enum):
29442944

29452945
# Note: no_default is exported to the public API in pandas.api.extensions
29462946
no_default = _NoDefault.no_default # Sentinel indicating the default value.
2947+
no_default.__module__ = "pandas.api.extensions"
29472948
NoDefault = Literal[_NoDefault.no_default]
2949+
NoDefault.__module__ = "pandas.api.typing"
29482950

29492951

29502952
@cython.boundscheck(False)

pandas/_libs/missing.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,3 +546,4 @@ class NAType(C_NAType):
546546

547547
C_NA = NAType() # C-visible
548548
NA = C_NA # Python-visible
549+
NA.__module__ = "pandas"

pandas/_libs/tslibs/nattype.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,7 @@ default 'raise'
18711871

18721872
c_NaT = NaTType() # C-visible
18731873
NaT = c_NaT # Python-visible
1874+
NaT.__module__ = "pandas"
18741875

18751876

18761877
# ----------------------------------------------------------------------

pandas/core/arrays/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1807,7 +1807,7 @@ def take(
18071807
.. code-block:: python
18081808
18091809
def take(self, indices, allow_fill=False, fill_value=None):
1810-
from pandas.core.algorithms import take
1810+
from pandas.api.extensions import take
18111811
18121812
# If the ExtensionArray is backed by an ndarray, then
18131813
# just pass that here instead of coercing to object.

pandas/core/dtypes/common.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def is_datetime64tz_dtype(arr_or_dtype) -> bool:
359359
>>> is_datetime64tz_dtype(pd.DatetimeIndex([1, 2, 3], tz="US/Eastern"))
360360
True
361361
362-
>>> from pandas.core.dtypes.dtypes import DatetimeTZDtype
362+
>>> from pandas.api.types import DatetimeTZDtype
363363
>>> dtype = DatetimeTZDtype("ns", tz="US/Eastern")
364364
>>> s = pd.Series([], dtype=dtype)
365365
>>> is_datetime64tz_dtype(dtype)
@@ -407,7 +407,7 @@ def is_timedelta64_dtype(arr_or_dtype) -> bool:
407407
408408
Examples
409409
--------
410-
>>> from pandas.core.dtypes.common import is_timedelta64_dtype
410+
>>> from pandas.api.types import is_timedelta64_dtype
411411
>>> is_timedelta64_dtype(object)
412412
False
413413
>>> is_timedelta64_dtype(np.timedelta64)
@@ -452,7 +452,7 @@ def is_period_dtype(arr_or_dtype) -> bool:
452452
453453
Examples
454454
--------
455-
>>> from pandas.core.dtypes.common import is_period_dtype
455+
>>> from pandas.api.types import is_period_dtype
456456
>>> is_period_dtype(object)
457457
False
458458
>>> is_period_dtype(pd.PeriodDtype(freq="D"))
@@ -507,7 +507,7 @@ def is_interval_dtype(arr_or_dtype) -> bool:
507507
508508
Examples
509509
--------
510-
>>> from pandas.core.dtypes.common import is_interval_dtype
510+
>>> from pandas.api.types import is_interval_dtype
511511
>>> is_interval_dtype(object)
512512
False
513513
>>> is_interval_dtype(pd.IntervalDtype())
@@ -684,10 +684,10 @@ def is_dtype_equal(source, target) -> bool:
684684
True
685685
>>> is_dtype_equal(object, "category")
686686
False
687-
>>> from pandas.core.dtypes.dtypes import CategoricalDtype
687+
>>> from pandas.api.types import CategoricalDtype
688688
>>> is_dtype_equal(CategoricalDtype(), "category")
689689
True
690-
>>> from pandas.core.dtypes.dtypes import DatetimeTZDtype
690+
>>> from pandas.api.types import DatetimeTZDtype
691691
>>> is_dtype_equal(DatetimeTZDtype(tz="UTC"), "datetime64")
692692
False
693693
"""
@@ -811,7 +811,7 @@ def is_signed_integer_dtype(arr_or_dtype) -> bool:
811811
812812
Examples
813813
--------
814-
>>> from pandas.core.dtypes.common import is_signed_integer_dtype
814+
>>> from pandas.api.types import is_signed_integer_dtype
815815
>>> is_signed_integer_dtype(str)
816816
False
817817
>>> is_signed_integer_dtype(int)
@@ -1006,7 +1006,7 @@ def is_datetime64_any_dtype(arr_or_dtype) -> bool:
10061006
Examples
10071007
--------
10081008
>>> from pandas.api.types import is_datetime64_any_dtype
1009-
>>> from pandas.core.dtypes.dtypes import DatetimeTZDtype
1009+
>>> from pandas.api.types import DatetimeTZDtype
10101010
>>> is_datetime64_any_dtype(str)
10111011
False
10121012
>>> is_datetime64_any_dtype(int)
@@ -1066,7 +1066,7 @@ def is_datetime64_ns_dtype(arr_or_dtype) -> bool:
10661066
Examples
10671067
--------
10681068
>>> from pandas.api.types import is_datetime64_ns_dtype
1069-
>>> from pandas.core.dtypes.dtypes import DatetimeTZDtype
1069+
>>> from pandas.api.types import DatetimeTZDtype
10701070
>>> is_datetime64_ns_dtype(str)
10711071
False
10721072
>>> is_datetime64_ns_dtype(int)
@@ -1121,7 +1121,7 @@ def is_timedelta64_ns_dtype(arr_or_dtype) -> bool:
11211121
11221122
Examples
11231123
--------
1124-
>>> from pandas.core.dtypes.common import is_timedelta64_ns_dtype
1124+
>>> from pandas.api.types import is_timedelta64_ns_dtype
11251125
>>> is_timedelta64_ns_dtype(np.dtype("m8[ns]"))
11261126
True
11271127
>>> is_timedelta64_ns_dtype(np.dtype("m8[ps]")) # Wrong frequency

0 commit comments

Comments
 (0)