Following up on your comments about
bysetpos and the RFC, I don't see any mention of restricting this. My guess is that it was implemented with DAILY frequency in mind? The docstrings also don't mention anything
If given, it must be either an integer, or a sequence of integers,
positive or negative. Each given integer will specify an occurrence
number, corresponding to the nth occurrence of the rule inside the
frequency period. For example, a bysetpos of -1 if combined with a
MONTHLY frequency, and a byweekday of (MO, TU, WE, TH, FR), will
result in the last work day of every month.
list(rrule(MINUTELY, dtstart=datetime(2019, 1, 1, 0, 0), bysetpos=367, count=3, byweekday=MO))
In addition in playing around with this I think there may be an issue more broadly with
bysetpos when using
MINUTELY. This runs fine
In : list(rrule(MINUTELY, dtstart=datetime(2019, 1, 1, 0, 0), bysetpos=1, count=1, byweekday=MO)) Out: [datetime.datetime(2019, 1, 7, 0, 0)]
but this seems to run indefinitely
list(rrule(MINUTELY, dtstart=datetime(2019, 1, 1, 0, 0), bysetpos=2, count=1, byweekday=MO))
yieldstatement is never reached? Or else the algorithm is just taking a very long time, still haven't fully grokked how
bysetposmay be an exception here), I can transform the inputs the the rule to some canonicalization so that
freq=HOURLY, interval=1"compile down" to the same thing, which I can then optimize.
.whl) for both dateutil and six, you shouldn't have to download anything to install them
pip download python-dateutilshould download all the files.
(easter.easter(y, easter.EASTER_ORTHODOX) for y in range(y_start, y_end))should be a good start.
.betweenyou can create an
rrule.rrulset()and then add all the easters as
rruleis an interesting and complicated module, Part of my Pycon 2019 tutorial covers
rruleand might help you find some workarounds: https://youtu.be/Xt8age1Be4E?t=7189 (starts at the part where I discuss rrule)