@@ -497,7 +497,7 @@ class _Tick(object):
497
497
# ----------------------------------------------------------------------
498
498
# RelativeDelta Arithmetic
499
499
500
- cpdef datetime shift_day(datetime other, int days) :
500
+ def shift_day (other: datetime , days: int ) -> datetime :
501
501
"""
502
502
Increment the datetime `other` by the given number of days , retaining
503
503
the time-portion of the datetime. For tz-naive datetimes this is
@@ -816,7 +816,8 @@ def shift_months(int64_t[:] dtindex, int months, object day=None):
816
816
return np.asarray(out)
817
817
818
818
819
- cpdef datetime shift_month(datetime stamp, int months, object day_opt = None ):
819
+ def shift_month (stamp: datetime , months: int ,
820
+ day_opt: object = None ) -> datetime:
820
821
"""
821
822
Given a datetime (or Timestamp ) `stamp`, an integer `months` and an
822
823
option `day_opt`, return a new datetimelike that many months later ,
@@ -946,8 +947,8 @@ cpdef int roll_convention(int other, int n, int compare) nogil:
946
947
return n
947
948
948
949
949
- cpdef int roll_qtrday(datetime other, int n, int month, object day_opt ,
950
- int modby = 3 ) except ? - 1 :
950
+ def roll_qtrday (other: datetime , n: int , month: int ,
951
+ day_opt: object , modby: int = 3 ) -> int :
951
952
"""
952
953
Possibly increment or decrement the number of periods to shift
953
954
based on rollforward/rollbackward conventions.
@@ -989,8 +990,7 @@ cpdef int roll_qtrday(datetime other, int n, int month, object day_opt,
989
990
return n
990
991
991
992
992
- cpdef int roll_yearday(datetime other, int n, int month,
993
- object day_opt) except ? - 1 :
993
+ def roll_yearday (other: datetime , n: int , month: int , day_opt: object ) -> int:
994
994
"""
995
995
Possibly increment or decrement the number of periods to shift
996
996
based on rollforward/rollbackward conventions.
0 commit comments