You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The calendar profile's reader: onlyworlds.calendar, a port of the npm SDK's calendar kernel (src/calendar/), for any tool that shows a world's dates; the toolkit's draw skill imports it in place of its own port. read_calendar_value reads atlas_calendar (an object, or the same object as a JSON string) and refuses exactly what the profile refuses; world_calendars and resolve_calendar_lens find a world's calendars by the field; breakdown_step and format_step read an integer step as the calendar's date (months, days outside the months, weeks, eras, version 2's except and offset), and parse_date reads written words back. Every SDK function is here under its snake_case name, and the module's docstring maps each name to the SDK's. Where Python and JavaScript read the same value differently, it reads as the SDK does: numbers as doubles (past 2**53 the nearest double, past the double range infinity, a sum added left to right, Math.round's halves up), JavaScript's white space when trimming (U+FEFF trimmed, U+001C kept), ASCII digits only, string lengths in UTF-16 code units, JavaScript's truthiness, and a JSON string as JSON.parse reads it (no NaN, an integer of any length, any depth). Checked against the SDK's built package (4.84.0) on 175,705 calls, about a million answers, with no disagreement.
The LegendKeeper door's calendars now read back in the package. Its tests read the calendars the door writes through read_calendar_value (the tests' own copy of the profile's refusals is gone), and onlyworlds.legendkeeper's CALENDAR_FIELD and CALENDAR_SUPERTYPE are the calendar module's.
Tests: tests/test_calendar.py replays the profile's fixture whole (64 cases: 30 calendars with 198 steps, 34 refusals), ports the SDK's kernel, lens and version-2 tests the fixture does not cover, and holds one test for each place where Python's default reading differs from JavaScript's. tests/test_spine.py now checks the spine fixture's six calendar steps through the page's own calendar config.