Repository navigation
Weekly[start] partitions (ISO weeks) - #512
Merged
Merged
Conversation
A week is ISO 8601, Monday to Sunday, written YYYY-Www (2026-W46) with the ISO week-numbering year, so it sorts as text and 2024-12-30 is 2025-W01. Schedules fill the week a fire falls in or the one before; fills, fill_lag, coverage, sensors' key mapping (a week as the months it spans, a month as the weeks it touches), backfills and the UI's calendar (an ISO year of weeks) know weekly keys. Existing pipelines' registry hashes are unchanged. Closes #140 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017TycszSbyw92Efu4ZeCYL6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017TycszSbyw92Efu4ZeCYL6
… are Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017TycszSbyw92Efu4ZeCYL6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #140
Adds
Weekly[first]partitions over a newWeekkey (morca.week), besideMonthly,DailyandHourly.Key format. ISO 8601 weeks, Monday to Sunday, written
YYYY-Www(2026-W46= 2026-11-09..2026-11-15).YYYYis the ISO week-numbering year (the year of the week's Thursday), so 2024-12-30 is2025-W01, 2021-01-03 is2020-W53, and a year has 52 or 53 weeks. Year and week are zero-padded, so weeks order as text, which coverage, fills and sensors rely on. Ranges work as for the other time keys:morca backfill p 2026-W50..2027-W02.What knows weekly keys
Weekly[first]/Weekexported frommorca;weeks_in(year)._internal/timekeys.mojo(is_time_kind,unit_of→week, example, parse, containing, prev): so fill ranges,fill_lag,lag_wait, coverage, follow and backfill parsing work unchanged.fill_keyfills the week a fire falls in (Current) or the one before (Previous), on the schedule's wall clock, so a Monday 06:00 cron withfills=Previousfills the week that just ended; a week ends Monday 00:00 local.map_keys: a day/hour maps to its week, a week to its 7 days / 168 hours, a week to the one or two months it spans, a month to every week with a day in it.?cal=YYYY/?month=YYYY), cells labelledW46. The Start form has no picker for weekly (as for hourly); the text field works.fill_lag, the range).No migration (kind is free text). The registry hash includes the partitions kind, so only pipelines that use
Weeklyget a new kind; existing hashes are unchanged.Tests
tests/test_steps.mojo: parse/write, ISO year boundaries (52/53-week years, 2020-W53, 2026-W53, 2025-W01 starting 2024-12-30), a 2000–2040 sweep that each week's Monday and successor agree with day arithmetic, ranges across New Year, start refusal, fills, an in-memory weekly pipeline and itsdescribe.tests/test_fill.mojo:last_ended/range_keysover a 53-week year, the time zone at the Monday boundary,fill_lag.tests/test_warehouse.mojo: sensor key mapping to and from weeks.tests/weekly.sh(pixi run test-weekly, intest-scheduler-ui): Monday 06:00 fires withfills=Previousagainst Postgres, a week backfill that skips done weeks and refuses ones before the start, and the UI calendar of 53 weeks.🤖 Generated with Claude Code
https://claude.ai/code/session_017TycszSbyw92Efu4ZeCYL6