cmrit
/
cmrithackathon-master
/.venv
/lib
/python3.11
/site-packages
/pandas
/_libs
/tslibs
/timestamps.pyi
from datetime import ( | |
date as _date, | |
datetime, | |
time as _time, | |
timedelta, | |
tzinfo as _tzinfo, | |
) | |
from time import struct_time | |
from typing import ( | |
ClassVar, | |
Literal, | |
TypeAlias, | |
overload, | |
) | |
import numpy as np | |
from pandas._libs.tslibs import ( | |
BaseOffset, | |
NaTType, | |
Period, | |
Tick, | |
Timedelta, | |
) | |
from pandas._typing import ( | |
Self, | |
TimestampNonexistent, | |
) | |
_TimeZones: TypeAlias = str | _tzinfo | None | int | |
def integer_op_not_supported(obj: object) -> TypeError: ... | |
class Timestamp(datetime): | |
_creso: int | |
min: ClassVar[Timestamp] | |
max: ClassVar[Timestamp] | |
resolution: ClassVar[Timedelta] | |
_value: int # np.int64 | |
# error: "__new__" must return a class instance (got "Union[Timestamp, NaTType]") | |
def __new__( # type: ignore[misc] | |
cls: type[Self], | |
ts_input: np.integer | float | str | _date | datetime | np.datetime64 = ..., | |
year: int | None = ..., | |
month: int | None = ..., | |
day: int | None = ..., | |
hour: int | None = ..., | |
minute: int | None = ..., | |
second: int | None = ..., | |
microsecond: int | None = ..., | |
tzinfo: _tzinfo | None = ..., | |
*, | |
nanosecond: int | None = ..., | |
tz: _TimeZones = ..., | |
unit: str | int | None = ..., | |
fold: int | None = ..., | |
) -> Self | NaTType: ... | |
def _from_value_and_reso( | |
cls, value: int, reso: int, tz: _TimeZones | |
) -> Timestamp: ... | |
def value(self) -> int: ... # np.int64 | |
def year(self) -> int: ... | |
def month(self) -> int: ... | |
def day(self) -> int: ... | |
def hour(self) -> int: ... | |
def minute(self) -> int: ... | |
def second(self) -> int: ... | |
def microsecond(self) -> int: ... | |
def nanosecond(self) -> int: ... | |
def tzinfo(self) -> _tzinfo | None: ... | |
def tz(self) -> _tzinfo | None: ... | |
def fold(self) -> int: ... | |
def fromtimestamp(cls, ts: float, tz: _TimeZones = ...) -> Self: ... | |
def utcfromtimestamp(cls, ts: float) -> Self: ... | |
def today(cls, tz: _TimeZones = ...) -> Self: ... | |
def fromordinal( | |
cls, | |
ordinal: int, | |
tz: _TimeZones = ..., | |
) -> Self: ... | |
def now(cls, tz: _TimeZones = ...) -> Self: ... | |
def utcnow(cls) -> Self: ... | |
# error: Signature of "combine" incompatible with supertype "datetime" | |
def combine( # type: ignore[override] | |
cls, date: _date, time: _time | |
) -> datetime: ... | |
def fromisoformat(cls, date_string: str) -> Self: ... | |
def strftime(self, format: str) -> str: ... | |
def __format__(self, fmt: str) -> str: ... | |
def toordinal(self) -> int: ... | |
def timetuple(self) -> struct_time: ... | |
def timestamp(self) -> float: ... | |
def utctimetuple(self) -> struct_time: ... | |
def date(self) -> _date: ... | |
def time(self) -> _time: ... | |
def timetz(self) -> _time: ... | |
# LSP violation: nanosecond is not present in datetime.datetime.replace | |
# and has positional args following it | |
def replace( # type: ignore[override] | |
self, | |
year: int | None = ..., | |
month: int | None = ..., | |
day: int | None = ..., | |
hour: int | None = ..., | |
minute: int | None = ..., | |
second: int | None = ..., | |
microsecond: int | None = ..., | |
nanosecond: int | None = ..., | |
tzinfo: _tzinfo | type[object] | None = ..., | |
fold: int | None = ..., | |
) -> Self: ... | |
# LSP violation: datetime.datetime.astimezone has a default value for tz | |
def astimezone(self, tz: _TimeZones) -> Self: ... # type: ignore[override] | |
def ctime(self) -> str: ... | |
def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ... | |
def strptime( | |
# Note: strptime is actually disabled and raises NotImplementedError | |
cls, | |
date_string: str, | |
format: str, | |
) -> Self: ... | |
def utcoffset(self) -> timedelta | None: ... | |
def tzname(self) -> str | None: ... | |
def dst(self) -> timedelta | None: ... | |
def __le__(self, other: datetime) -> bool: ... # type: ignore[override] | |
def __lt__(self, other: datetime) -> bool: ... # type: ignore[override] | |
def __ge__(self, other: datetime) -> bool: ... # type: ignore[override] | |
def __gt__(self, other: datetime) -> bool: ... # type: ignore[override] | |
# error: Signature of "__add__" incompatible with supertype "date"/"datetime" | |
# type: ignore[override] | |
def __add__(self, other: np.ndarray) -> np.ndarray: ... | |
def __add__(self, other: timedelta | np.timedelta64 | Tick) -> Self: ... | |
def __radd__(self, other: timedelta) -> Self: ... | |
# type: ignore[override] | |
def __sub__(self, other: datetime) -> Timedelta: ... | |
def __sub__(self, other: timedelta | np.timedelta64 | Tick) -> Self: ... | |
def __hash__(self) -> int: ... | |
def weekday(self) -> int: ... | |
def isoweekday(self) -> int: ... | |
# Return type "Tuple[int, int, int]" of "isocalendar" incompatible with return | |
# type "_IsoCalendarDate" in supertype "date" | |
def isocalendar(self) -> tuple[int, int, int]: ... # type: ignore[override] | |
def is_leap_year(self) -> bool: ... | |
def is_month_start(self) -> bool: ... | |
def is_quarter_start(self) -> bool: ... | |
def is_year_start(self) -> bool: ... | |
def is_month_end(self) -> bool: ... | |
def is_quarter_end(self) -> bool: ... | |
def is_year_end(self) -> bool: ... | |
def to_pydatetime(self, warn: bool = ...) -> datetime: ... | |
def to_datetime64(self) -> np.datetime64: ... | |
def to_period(self, freq: BaseOffset | str | None = None) -> Period: ... | |
def to_julian_date(self) -> np.float64: ... | |
def asm8(self) -> np.datetime64: ... | |
def tz_convert(self, tz: _TimeZones) -> Self: ... | |
# TODO: could return NaT? | |
def tz_localize( | |
self, | |
tz: _TimeZones, | |
ambiguous: bool | Literal["raise", "NaT"] = ..., | |
nonexistent: TimestampNonexistent = ..., | |
) -> Self: ... | |
def normalize(self) -> Self: ... | |
# TODO: round/floor/ceil could return NaT? | |
def round( | |
self, | |
freq: str, | |
ambiguous: bool | Literal["raise", "NaT"] = ..., | |
nonexistent: TimestampNonexistent = ..., | |
) -> Self: ... | |
def floor( | |
self, | |
freq: str, | |
ambiguous: bool | Literal["raise", "NaT"] = ..., | |
nonexistent: TimestampNonexistent = ..., | |
) -> Self: ... | |
def ceil( | |
self, | |
freq: str, | |
ambiguous: bool | Literal["raise", "NaT"] = ..., | |
nonexistent: TimestampNonexistent = ..., | |
) -> Self: ... | |
def day_name(self, locale: str | None = ...) -> str: ... | |
def month_name(self, locale: str | None = ...) -> str: ... | |
def day_of_week(self) -> int: ... | |
def dayofweek(self) -> int: ... | |
def day_of_year(self) -> int: ... | |
def dayofyear(self) -> int: ... | |
def quarter(self) -> int: ... | |
def week(self) -> int: ... | |
def to_numpy( | |
self, dtype: np.dtype | None = ..., copy: bool = ... | |
) -> np.datetime64: ... | |
def _date_repr(self) -> str: ... | |
def days_in_month(self) -> int: ... | |
def daysinmonth(self) -> int: ... | |
def unit(self) -> str: ... | |
def as_unit(self, unit: str, round_ok: bool = ...) -> Timestamp: ... | |