@@ -821,19 +821,6 @@ def tick_values(self, vmin, vmax):
821821
822822 self .rule .set (dtstart = start , until = stop )
823823
824- # estimate the number of ticks very approximately so we don't
825- # have to do a very expensive (and potentially near infinite)
826- # 'between' calculation, only to find out it will fail.
827- nmax , nmin = date2num ((vmax , vmin ))
828- estimate = (nmax - nmin ) / (self ._get_unit () * self ._get_interval ())
829- # This estimate is only an estimate, so be really conservative
830- # about bailing...
831- if estimate > self .MAXTICKS * 2 :
832- raise RuntimeError (
833- 'RRuleLocator estimated to generate %d ticks from %s to %s: '
834- 'exceeds Locator.MAXTICKS * 2 (%d) ' % (estimate , vmin , vmax ,
835- self .MAXTICKS * 2 ))
836-
837824 dates = self .rule .between (vmin , vmax , True )
838825 if len (dates ) == 0 :
839826 return date2num ([vmin , vmax ])
@@ -1254,6 +1241,8 @@ def __init__(self, bymonthday=None, interval=1, tz=None):
12541241
12551242 Default is to tick every day of the month: ``bymonthday=range(1,32)``
12561243 """
1244+ if not interval == int (interval ) or interval < 1 :
1245+ raise ValueError ("interval must be an integer greater than 0" )
12571246 if bymonthday is None :
12581247 bymonthday = range (1 , 32 )
12591248 elif isinstance (bymonthday , np .ndarray ):
0 commit comments