Skip to content

Commit 69fe3c0

Browse files
authored
CLN: misc tslibs (#31673)
1 parent 3a4c310 commit 69fe3c0

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

pandas/_libs/tslibs/resolution.pyx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ cdef:
2727

2828
# ----------------------------------------------------------------------
2929

30-
cpdef resolution(int64_t[:] stamps, tz=None):
30+
cpdef resolution(const int64_t[:] stamps, tz=None):
3131
cdef:
3232
Py_ssize_t i, n = len(stamps)
3333
npy_datetimestruct dts
@@ -38,7 +38,7 @@ cpdef resolution(int64_t[:] stamps, tz=None):
3838
return _reso_local(stamps, tz)
3939

4040

41-
cdef _reso_local(int64_t[:] stamps, object tz):
41+
cdef _reso_local(const int64_t[:] stamps, object tz):
4242
cdef:
4343
Py_ssize_t i, n = len(stamps)
4444
int reso = RESO_DAY, curr_reso
@@ -106,7 +106,7 @@ cdef inline int _reso_stamp(npy_datetimestruct *dts):
106106
return RESO_DAY
107107

108108

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

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

191191
@classmethod
192-
def get_str(cls, reso):
192+
def get_str(cls, reso: int) -> str:
193193
"""
194194
Return resolution str against resolution code.
195195

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

203203
@classmethod
204-
def get_reso(cls, resostr):
204+
def get_reso(cls, resostr: str) -> int:
205205
"""
206206
Return resolution str against resolution code.
207207

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

218218
@classmethod
219-
def get_freq_group(cls, resostr):
219+
def get_freq_group(cls, resostr: str) -> int:
220220
"""
221221
Return frequency str against resolution str.
222222

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

230230
@classmethod
231-
def get_freq(cls, resostr):
231+
def get_freq(cls, resostr: str) -> str:
232232
"""
233233
Return frequency str against resolution str.
234234

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

242242
@classmethod
243-
def get_str_from_freq(cls, freq):
243+
def get_str_from_freq(cls, freq: str) -> str:
244244
"""
245245
Return resolution str against frequency str.
246246

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

254254
@classmethod
255-
def get_reso_from_freq(cls, freq):
255+
def get_reso_from_freq(cls, freq: str) -> int:
256256
"""
257257
Return resolution code against frequency str.
258258

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import collections
2-
import textwrap
32

43
import cython
54

pandas/_libs/tslibs/timestamps.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
import warnings
32

43
import numpy as np

0 commit comments

Comments
 (0)