mirror of
https://git.pumpin.online/funkpower/typikon.git
synced 2026-10-23 03:07:12 +00:00
An adversarial pass found the rules throwing away the feast rank that
describe() computes, in exactly the seasons where it decides the answer.
- A saint of vigil or polyeleos rank now lifts a weekday of a fast, to wine
and oil inside the Great Fast and as far as fish in the three lesser
ones. This is why the printed calendars mark so many Wednesdays in the
Nativity Fast; 74 days across 2020-2030 were being reported stricter than
any published calendar keeps them, St Nicholas and the Forty Martyrs of
Sebaste among them.
- The Annunciation was tested after Great Friday and Great Saturday, so on
the years it lands there it vanished into them entirely -- the Great Feast
of the Incarnation demoted to a bullet, reported as a total fast, and its
rank overwritten with the lesser movable one the rules then read. It is
now tested first and lifts those days to wine and oil. Five such years
this century on the Gregorian paschalion, seven on the Julian.
- Lazarus Saturday and Palm Sunday belonged to no season at all, sitting
between the Forty Days and Great Week. Any rule keying on the season fell
through, so Byzantine Catholic jurisdictions reported a meat glyph and
'no fast' on Palm Sunday.
- The eves of the Nativity and Theophany are relaxed to wine and oil when
they fall on a weekend, which ruthenian.py already implemented and this
module did not.
Also: iCalendar folded on characters where RFC 5545 counts octets, so an
emoji put lines up to 80 octets over a 75-octet limit; a malformed --date
printed a traceback; the overlaid menologion was rebuilt for every single day
asked about; the Nativity of the Forerunner was ranked below its class.
Fourteen new tests, each one able to fail. The old sweep asserted only
all(d.fast), and 'none' is a truthy string.
76 lines
3.2 KiB
Python
76 lines
3.2 KiB
Python
"""Which season of the year a day falls in.
|
|
|
|
The Great Fast here runs from Clean Monday through Palm Sunday. The Forty Days
|
|
proper end on the Friday before Lazarus Saturday — ``great_fast_end`` in the
|
|
movable cycle, which is what the fasting rules count from — but a season is a
|
|
label for a reader, and a Palm Sunday belonging to no season at all is worse
|
|
than one belonging loosely to the Fast.
|
|
|
|
The movable seasons are counted from Pascha and so are compared as civil
|
|
dates. The fixed ones — the Nativity and Dormition Fasts, the fast-free days
|
|
after the Nativity — are compared in **ecclesiastical** space, against the date
|
|
the Church calls the day. That is the whole trick that lets one set of rules
|
|
serve the old and new calendars at once: the Nativity Fast begins on 15
|
|
November in both, and only the mornings differ.
|
|
"""
|
|
|
|
from .calendars import fixed_between
|
|
|
|
__all__ = ["GREAT_FAST", "GREAT_WEEK", "BRIGHT_WEEK", "CHEESEFARE_WEEK",
|
|
"APOSTLES", "DORMITION", "NATIVITY_FAST", "season_for", "FASTING_SEASONS"]
|
|
|
|
GREAT_FAST = "Great Fast"
|
|
GREAT_WEEK = "Great and Holy Week"
|
|
BRIGHT_WEEK = "Bright Week"
|
|
PRE_LENTEN = "Triodion"
|
|
CHEESEFARE_WEEK = "Cheesefare Week"
|
|
APOSTLES = "Apostles' Fast"
|
|
DORMITION = "Dormition Fast"
|
|
NATIVITY_FAST = "Nativity Fast"
|
|
PENTECOST_WEEK = "Week after Pentecost"
|
|
CHRISTMASTIDE = "Christmastide"
|
|
|
|
FASTING_SEASONS = (GREAT_FAST, GREAT_WEEK, CHEESEFARE_WEEK,
|
|
APOSTLES, DORMITION, NATIVITY_FAST)
|
|
|
|
|
|
def season_for(civil, fixed_md, mv, apostles_end):
|
|
"""The season a day belongs to, or None for ordinary time.
|
|
|
|
``fixed_md`` is the ecclesiastical (month, day). ``apostles_end`` is the
|
|
civil date of 28 June reckoned in this jurisdiction's menologion — the eve
|
|
of Ss Peter and Paul, where the Apostles' Fast stops.
|
|
"""
|
|
# Movable first: Great Week outranks the Great Fast it follows, and Bright
|
|
# Week outranks everything.
|
|
if mv["pascha"] <= civil <= mv["bright_week_end"]:
|
|
return BRIGHT_WEEK
|
|
if mv["great_week_start"] <= civil <= mv["holy_saturday"]:
|
|
return GREAT_WEEK
|
|
# Lazarus Saturday and Palm Sunday sit between the Forty Days, which end on
|
|
# the Friday before them, and Great Week, which begins after them. Leaving
|
|
# that gap unnamed left both days with no season at all, and any rule that
|
|
# keyed on the season fell through to "no fast" on Palm Sunday.
|
|
if mv["clean_monday"] <= civil <= mv["palm_sunday"]:
|
|
return GREAT_FAST
|
|
if mv["cheesefare_week_start"] <= civil <= mv["cheesefare"]:
|
|
return CHEESEFARE_WEEK
|
|
if mv["publican_pharisee"] <= civil < mv["cheesefare_week_start"]:
|
|
return PRE_LENTEN
|
|
if mv["pentecost"] <= civil <= mv["pentecost_week_end"]:
|
|
return PENTECOST_WEEK
|
|
|
|
# The Apostles' Fast can be empty in a year with a late Pascha, which the
|
|
# comparison handles without a special case.
|
|
if mv["apostles_start"] <= civil <= apostles_end:
|
|
return APOSTLES
|
|
|
|
# Fixed seasons, in ecclesiastical space.
|
|
if fixed_between(fixed_md, (8, 1), (8, 14)):
|
|
return DORMITION
|
|
if fixed_between(fixed_md, (11, 15), (12, 24)):
|
|
return NATIVITY_FAST
|
|
if fixed_between(fixed_md, (12, 25), (1, 4)):
|
|
return CHRISTMASTIDE
|
|
return None
|