Skip to content

CLN: misc tslibs, annotations, unused imports #31673

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 1 commit into from
Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 9 additions & 9 deletions pandas/_libs/tslibs/resolution.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cdef:

# ----------------------------------------------------------------------

cpdef resolution(int64_t[:] stamps, tz=None):
cpdef resolution(const int64_t[:] stamps, tz=None):
cdef:
Py_ssize_t i, n = len(stamps)
npy_datetimestruct dts
Expand All @@ -38,7 +38,7 @@ cpdef resolution(int64_t[:] stamps, tz=None):
return _reso_local(stamps, tz)


cdef _reso_local(int64_t[:] stamps, object tz):
cdef _reso_local(const int64_t[:] stamps, object tz):
cdef:
Py_ssize_t i, n = len(stamps)
int reso = RESO_DAY, curr_reso
Expand Down Expand Up @@ -106,7 +106,7 @@ cdef inline int _reso_stamp(npy_datetimestruct *dts):
return RESO_DAY


def get_freq_group(freq):
def get_freq_group(freq) -> int:
"""
Return frequency code group of given frequency str or offset.

Expand Down Expand Up @@ -189,7 +189,7 @@ class Resolution:
_freq_reso_map = {v: k for k, v in _reso_freq_map.items()}

@classmethod
def get_str(cls, reso):
def get_str(cls, reso: int) -> str:
"""
Return resolution str against resolution code.

Expand All @@ -201,7 +201,7 @@ class Resolution:
return cls._reso_str_map.get(reso, 'day')

@classmethod
def get_reso(cls, resostr):
def get_reso(cls, resostr: str) -> int:
"""
Return resolution str against resolution code.

Expand All @@ -216,7 +216,7 @@ class Resolution:
return cls._str_reso_map.get(resostr, cls.RESO_DAY)

@classmethod
def get_freq_group(cls, resostr):
def get_freq_group(cls, resostr: str) -> int:
"""
Return frequency str against resolution str.

Expand All @@ -228,7 +228,7 @@ class Resolution:
return get_freq_group(cls.get_freq(resostr))

@classmethod
def get_freq(cls, resostr):
def get_freq(cls, resostr: str) -> str:
"""
Return frequency str against resolution str.

Expand All @@ -240,7 +240,7 @@ class Resolution:
return cls._reso_freq_map[resostr]

@classmethod
def get_str_from_freq(cls, freq):
def get_str_from_freq(cls, freq: str) -> str:
"""
Return resolution str against frequency str.

Expand All @@ -252,7 +252,7 @@ class Resolution:
return cls._freq_reso_map.get(freq, 'day')

@classmethod
def get_reso_from_freq(cls, freq):
def get_reso_from_freq(cls, freq: str) -> int:
"""
Return resolution code against frequency str.

Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import collections
import textwrap

import cython

Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
import warnings

import numpy as np
Expand Down