Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ its **beginning**, so `Reminisc.`, `Reminisc:` and `Reminiscere` all mean the sa
Monday and 3 is Tuesday. A feria outside 1 to 7 is refused.
* `Whit Monday`, `Easter Tuesday`, `Ostermontag` and `Pfingstdienstag` are also understood,
with the weekday written as part of the word or as a separate word.
* `Feria secunda`, `Fer. tertia` spell the number out; `prima` to `quarta` are understood.
* `Feria secunda`, `Fer. tertia` spell the number out; `prima` to `septima` are understood.
* With a feast that is not a Sunday, the feria names that feast's own weekday, where 1 is
Sunday: `Feria 6 in Parasceve` is Good Friday and `Feria V in Coena Domini` is Maundy
Thursday. Nothing is added to the date. The number is checked instead, so
`Fer. 2. Ascens.` is refused, because Ascension is a Thursday.

**Days of a German feast:** Easter, Whitsun and Christmas were kept over several days, and
German registers count them:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "feastdate"
version = "1.0.5"
version = "1.0.6"
description = "Convert church-year feast names from old parish registers (Dom. Palm. 1656) into calendar dates, Julian or Gregorian."
readme = "README.md"
license = { file = "LICENSE" }
Expand Down
2 changes: 1 addition & 1 deletion src/feastdate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
g2o, greg_easter, j2o, julian_easter, o2g, o2j, resolve, show, to_ord,
)

__version__ = '1.0.5'
__version__ = '1.0.6'

__all__ = [
'feast_date', 'resolve', 'show', 'FeastError',
Expand Down
12 changes: 10 additions & 2 deletions src/feastdate/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def show(o, cal):
ADV = ('advent', 'adv')
EPIPH = ('epiph',)
FERIA = ('feria', 'fer')
FERIA_DAY = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
# Weekday words English transcriptions use after a feast name: `Whit Monday`.
WEEKDAY_WORDS = {'monday': 1, 'tuesday': 2, 'montag': 1, 'dienstag': 2}
# Weekday words that only say which day the feast fell on. The answer must agree.
Expand Down Expand Up @@ -265,7 +266,8 @@ def show(o, cal):
FEAST_DAYS = 3 # the most days any feast was kept; 'letzter' is the third
# Ordinals written out. The register writes `der dritte Ostertag`, `Feria secunda`.
ORD_WORDS = [(r'(?:erst|zweit|dritt|viert)(?:e|er|en|es|em)?', ('erst', 'zweit', 'dritt', 'viert')),
(r'(?:prim|secund|terti|quart)(?:a|o|ae|am|us|um|i)?', ('prim', 'secund', 'terti', 'quart')),
(r'(?:prim|secund|terti|quart|quint|sext|septim)(?:a|o|ae|am|us|um|i)?',
('prim', 'secund', 'terti', 'quart', 'quint', 'sext', 'septim')),
(r'(?:first|second|third|fourth)', ('first', 'second', 'third', 'fourth'))]
LAST_RE = r'letzt(?:e|er|en|es|em)?'
# Words that connect a feast name to the rest of the entry and add nothing to the date.
Expand Down Expand Up @@ -500,7 +502,13 @@ def refuse_unless(ok, why):
extra = 0
if feria:
refuse_unless(kind == 'easter', 'feria counts from a movable feast')
extra = n - 1 # feria 2 = Monday, 3 = Tuesday
if off % 7:
# A weekday feast: `Feria 6 in Parasceve` is Good Friday itself. The number
# names the feast's own weekday (feria 1 = Sunday), so it is a check.
refuse_unless((n - 2) % 7 == o % 7, 'feria %d does not fall on %s, a %s'
% (n, hit, FERIA_DAY[o % 7]))
else:
extra = n - 1 # feria 2 = Monday, 3 = Tuesday
elif tag and n is not None:
refuse_unless((kind, key) in DAY_FEASTS,
'only Ostertag, Pfingsttag and Weihnachtstag count their days')
Expand Down
10 changes: 10 additions & 0 deletions tests/test_feastdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ def test_the_1700_switch():
('Fer. 9. Pasch. 1680', '^feria counts the days of the week, 1 to 7, not 9'),
('Fer. 0. Pent. 1680', '^feria counts the days of the week, 1 to 7, not 0'),
('Fer. 8. Trin. 1680', '^feria counts the days of the week, 1 to 7, not 8'),
# With a weekday feast the feria names the feast's own weekday, not an offset (#3).
('Fer. 2. Ascens. 1680', '^feria 2 does not fall on ascens, a Thursday'),
('Feria 2 in Parasceve 1680', '^feria 2 does not fall on parasceve, a Friday'),
('Feria 6 in Coena Domini 1680', '^feria 6 does not fall on coena, a Thursday'),
])
def test_refused(bad, why):
# Anchored on each branch's own wording: the catch-all quotes the input back, so a
Expand Down Expand Up @@ -283,6 +287,12 @@ def test_cal_of_year_answers_for_the_day():
('2. Christtag 1740', 'Mon 26 Dec 1740 (Gregorian)'),
('Feria secunda Paschatos 1740', 'Mon 18 Apr 1740 (Gregorian)'),
('Fer. tertia Pent. 1740', 'Tue 7 Jun 1740 (Gregorian)'),
# A weekday feast: the feria is the feast's own weekday and adds nothing (#3).
('Feria 6 in Parasceve 1680', 'Fri 9 Apr 1680 (Julian)'),
('Feria sexta in Parasceve 1680', 'Fri 9 Apr 1680 (Julian)'),
('Feria V in Coena Domini 1680', 'Thu 8 Apr 1680 (Julian)'),
('Feria quinta in Coena Domini 1680', 'Thu 8 Apr 1680 (Julian)'),
('Fer. 5. Ascens. 1680', 'Thu 20 May 1680 (Julian)'),
])
def test_day_of_the_feast(text, want):
assert feast_date(text) == want
Expand Down
Loading