Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
1 change: 1 addition & 0 deletions pandas/_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class RegisteredOption(NamedTuple):


class OptionError(AttributeError, KeyError):
__module__ = "pandas.errors"
"""
Exception raised for pandas.options.

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/missing.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ class NAType(C_NAType):
>>> True | pd.NA
True
"""
__module__ = "pandas"
__module__ = "pandas.api.typing"

_instance = None

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/nattype.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class NaTType(_NaT):
1 NaT
"""

__module__ = "pandas"
__module__ = "pandas.api.typing"

def __new__(cls):
cdef _NaT base
Expand Down
2 changes: 2 additions & 0 deletions pandas/_libs/tslibs/np_datetime.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class OutOfBoundsDatetime(ValueError):
OutOfBoundsDatetime: Parsing "08335394550" to datetime overflows,
at position 0
"""
__module__ = "pandas.errors"
pass


Expand All @@ -212,6 +213,7 @@ class OutOfBoundsTimedelta(ValueError):
OutOfBoundsTimedelta: Cannot cast 139999 days 00:00:00
to unit='ns' without overflow.
"""
__module__ = "pandas.errors"
# Timedelta analogue to OutOfBoundsDatetime
pass

Expand Down
2 changes: 2 additions & 0 deletions pandas/_libs/tslibs/offsets.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1819,6 +1819,8 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta):
>>> ts + pd.DateOffset(hour=8)
Timestamp('2017-01-01 08:10:11')
"""
__module__ = "pandas"

def __setattr__(self, name, value):
raise AttributeError("DateOffset objects are immutable.")

Expand Down
1 change: 1 addition & 0 deletions pandas/_libs/tslibs/period.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1627,6 +1627,7 @@ DIFFERENT_FREQ = ("Input has different freq={other_freq} "


class IncompatibleFrequency(TypeError):
__module__ = "pandas.errors"
"""
Raised when trying to compare or operate between Periods with different
frequencies.
Expand Down
12 changes: 12 additions & 0 deletions pandas/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@


class SequenceNotStr(Protocol[_T_co]):
__module__ = "pandas.api.typing.aliases"

@overload
def __getitem__(self, index: SupportsIndex, /) -> _T_co: ...

Expand Down Expand Up @@ -278,12 +280,16 @@ def tell(self) -> int:


class ReadBuffer(BaseBuffer, Protocol[AnyStr_co]):
__module__ = "pandas.api.typing.aliases"

def read(self, n: int = ..., /) -> AnyStr_co:
# for BytesIOWrapper, gzip.GzipFile, bz2.BZ2File
...


class WriteBuffer(BaseBuffer, Protocol[AnyStr_contra]):
__module__ = "pandas.api.typing.aliases"

def write(self, b: AnyStr_contra, /) -> Any:
# for gzip.GzipFile, bz2.BZ2File
...
Expand All @@ -294,14 +300,20 @@ def flush(self) -> Any:


class ReadPickleBuffer(ReadBuffer[bytes], Protocol):
__module__ = "pandas.api.typing.aliases"

def readline(self) -> bytes: ...


class WriteExcelBuffer(WriteBuffer[bytes], Protocol):
__module__ = "pandas.api.typing.aliases"

def truncate(self, size: int | None = ..., /) -> int: ...


class ReadCsvBuffer(ReadBuffer[AnyStr_co], Protocol):
__module__ = "pandas.api.typing.aliases"

def __iter__(self) -> Iterator[AnyStr_co]:
# for engine=python
...
Expand Down
1 change: 1 addition & 0 deletions pandas/core/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@


class BaseExecutionEngine(abc.ABC):
__module__ = "pandas.api.executors"
"""
Base class for execution engines for map and apply methods.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/arrow/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ class ArrowExtensionArray(
ExtensionArraySupportsAnyAll,
ArrowStringArrayMixin,
):
__module__ = "pandas.arrays"
"""
Pandas ExtensionArray backed by a PyArrow ChunkedArray.

Expand Down
2 changes: 2 additions & 0 deletions pandas/core/arrays/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@


class ExtensionArray:
__module__ = "pandas.api.extensions"
"""
Abstract base class for custom 1-D array types.

Expand Down Expand Up @@ -2787,6 +2788,7 @@ def _add_logical_ops(cls) -> None:


class ExtensionScalarOpsMixin(ExtensionOpsMixin):
__module__ = "pandas.api.extensions"
"""
A mixin for defining ops on an ExtensionArray.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/boolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def coerce_to_array(


class BooleanArray(BaseMaskedArray):
__module__ = "pandas.arrays"
"""
Array of boolean (True/False) data with missing values.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def contains(cat, key, container) -> bool:


class Categorical(NDArrayBackedExtensionArray, PandasObject, ObjectStringArrayMixin):
__module__ = "pandas"
"""
Represent a categorical variable in classic R / S-plus fashion.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def f(self):


class DatetimeArray(dtl.TimelikeOps, dtl.DatelikeOps):
__module__ = "pandas.arrays"
"""
Pandas ExtensionArray for tz-naive or tz-aware datetime data.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/floating.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def _safe_cast(cls, values: np.ndarray, dtype: np.dtype, copy: bool) -> np.ndarr


class FloatingArray(NumericArray):
__module__ = "pandas.arrays"
"""
Array of floating (optional missing) values.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def _safe_cast(cls, values: np.ndarray, dtype: np.dtype, copy: bool) -> np.ndarr


class IntegerArray(NumericArray):
__module__ = "pandas.arrays"
"""
Array of integer (optional missing) values.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@


class IntervalArray(IntervalMixin, ExtensionArray):
__module__ = "pandas.arrays"
"""
Pandas array for interval data that are closed on the same side.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/numpy_.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class NumpyExtensionArray(
NDArrayBackedExtensionArray,
ObjectStringArrayMixin,
):
__module__ = "pandas.arrays"
"""
A pandas ExtensionArray for NumPy data.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def f(self):
# error: Definition of "_concat_same_type" in base class "NDArrayBacked" is
# incompatible with definition in base class "ExtensionArray"
class PeriodArray(dtl.DatelikeOps, libperiod.PeriodMixin): # type: ignore[misc]
__module__ = "pandas.arrays"
"""
Pandas ExtensionArray for storing Period data.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/sparse/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ def _wrap_result(


class SparseArray(OpsMixin, PandasObject, ExtensionArray):
__module__ = "pandas.arrays"
"""
An ExtensionArray for storing sparse data.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/string_.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ def view(self, dtype: Dtype | None = None) -> Self:
# error: Definition of "_concat_same_type" in base class "NDArrayBacked" is
# incompatible with definition in base class "ExtensionArray"
class StringArray(BaseStringArray, NumpyExtensionArray): # type: ignore[misc]
__module__ = "pandas.arrays"
"""
Extension array for string data.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/string_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def _is_string_view(typ):


class ArrowStringArray(ObjectStringArrayMixin, ArrowExtensionArray, BaseStringArray):
__module__ = "pandas.arrays"
"""
Extension array for string data in a ``pyarrow.ChunkedArray``.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/arrays/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def f(self) -> np.ndarray:


class TimedeltaArray(dtl.TimelikeOps):
__module__ = "pandas.arrays"
"""
Pandas ExtensionArray for timedelta data.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/col.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def _pretty_print_args_kwargs(*args: Any, **kwargs: Any) -> str:


class Expression:
__module__ = "pandas.api.typing"
"""
Class representing a deferred column.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/dtypes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@


class ExtensionDtype:
__module__ = "pandas.api.extensions"
"""
A custom data type, to be paired with an ExtensionArray.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@


class Flags:
__module__ = "pandas"
"""
Flags that apply to pandas objects.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/groupby/grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@


class Grouper:
__module__ = "pandas"
"""
A Grouper allows the user to specify a groupby instruction for an object.

Expand Down
3 changes: 3 additions & 0 deletions pandas/core/indexers/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@


class BaseIndexer:
__module__ = "pandas.api.indexers"
"""
Base class for window bounds calculations.

Expand Down Expand Up @@ -211,6 +212,7 @@ def get_window_bounds(


class VariableOffsetWindowIndexer(BaseIndexer):
__module__ = "pandas.api.indexers"
"""
Calculate window boundaries based on a non-fixed offset such as a BusinessDay.

Expand Down Expand Up @@ -434,6 +436,7 @@ def get_window_bounds(


class FixedForwardWindowIndexer(BaseIndexer):
__module__ = "pandas.api.indexers"
"""
Creates window boundaries for fixed-length windows that include the current row.

Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/frozen.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


class FrozenList(PandasObject, list):
__module__ = "pandas.api.typing"
"""
Container that doesn't allow setting item *but*
because it's technically hashable, will be used
Expand Down
1 change: 1 addition & 0 deletions pandas/core/indexes/range.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def min_fitting_element(start: int, step: int, lower_limit: int) -> int:

@set_module("pandas")
class RangeIndex(Index):
__module__ = "pandas"
"""
Immutable Index implementing a monotonic integer range.

Expand Down
2 changes: 0 additions & 2 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from pandas.errors.cow import _chained_assignment_msg
from pandas.util._decorators import (
doc,
set_module,
)

from pandas.core.dtypes.cast import (
Expand Down Expand Up @@ -104,7 +103,6 @@


# the public IndexSlicerMaker
@set_module("pandas")
class _IndexSlice:
"""
Create an object to more easily perform multi-index slicing.
Expand Down
1 change: 1 addition & 0 deletions pandas/core/interchange/dataframe_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ def get_buffers(self) -> ColumnBuffers:


class DataFrame(ABC):
__module__ = "pandas.api.interchange"
"""
A data frame class, with only the methods required by the interchange
protocol defined.
Expand Down
5 changes: 5 additions & 0 deletions pandas/core/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@


class Resampler(BaseGroupBy, PandasObject):
__module__ = "pandas.api.typing"
"""
Class for resampling datetimelike data, a groupby-like operation.
See aggregate, transform, and apply functions on this object.
Expand Down Expand Up @@ -2169,6 +2170,7 @@ def _wrap_result(self, result):
class DatetimeIndexResamplerGroupby( # type: ignore[misc]
_GroupByMixin, DatetimeIndexResampler
):
__module__ = "pandas.api.typing"
"""
Provides a resample of a groupby implementation
"""
Expand Down Expand Up @@ -2270,6 +2272,7 @@ def _upsample(self, method, limit: int | None = None, fill_value=None):
class PeriodIndexResamplerGroupby( # type: ignore[misc]
_GroupByMixin, PeriodIndexResampler
):
__module__ = "pandas.api.typing"
"""
Provides a resample of a groupby implementation.
"""
Expand Down Expand Up @@ -2306,6 +2309,7 @@ def _adjust_binner_for_upsample(self, binner):
class TimedeltaIndexResamplerGroupby( # type: ignore[misc]
_GroupByMixin, TimedeltaIndexResampler
):
__module__ = "pandas.api.typing"
"""
Provides a resample of a groupby implementation.
"""
Expand Down Expand Up @@ -2345,6 +2349,7 @@ def get_resampler_for_grouping(


class TimeGrouper(Grouper):
__module__ = "pandas.api.typing"
"""
Custom groupby class for time-interval grouping.

Expand Down
2 changes: 2 additions & 0 deletions pandas/core/window/ewm.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def _calculate_deltas(


class ExponentialMovingWindow(BaseWindow):
__module__ = "pandas.api.typing"
r"""
Provide exponentially weighted (EW) calculations.

Expand Down Expand Up @@ -903,6 +904,7 @@ def _cov(X, Y):


class ExponentialMovingWindowGroupby(BaseWindowGroupby, ExponentialMovingWindow):
__module__ = "pandas.api.typing"
"""
Provide an exponential moving window groupby implementation.
"""
Expand Down
Loading
Loading