Closed jhanarato closed 10 months ago
elements.py has a lookup now. It remains empty when calendar is created.
Our benchmark at this point:
------------------------------------------------ benchmark: 1 tests -----------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
-------------------------------------------------------------------------------------------------------------------
test_initialise_calendar 1.4247 7.0630 1.5689 0.7217 1.4445 0.0370 13;26 637.3931 559 1
-------------------------------------------------------------------------------------------------------------------
Lookup implemented and looks shmick.
New benchmark:
------------------------------------------------ benchmark: 1 tests -----------------------------------------------
Name (time in ms) Min Max Mean StdDev Median IQR Outliers OPS Rounds Iterations
-------------------------------------------------------------------------------------------------------------------
test_initialise_calendar 1.5062 7.7579 1.6518 0.7142 1.5246 0.0414 13;23 605.4142 543 1
-------------------------------------------------------------------------------------------------------------------
An extra 0.75ms creation time, or 10% increase, not bad.
At the moment we have a bunch of frozen dataclasses.
Season
hasUposatha
instances andHoliday
instances that have anUposatha
. Given anUposatha
, we'd like to access theHoliday
that falls on it.Plan is: after creating the above data classes, pass the list of
Season
s and make a mapping ofUposatha
toSeason
.Uposatha
will have propertyseason
that is optional,None
if there is no holiday on this uposatha.