feat(calendar): ephemeris solar-geometry features + day-type refinement (#1, #2)#347
Merged
Merged
Conversation
Two opt-in, deterministic, leakage-free calendar feature blocks (default off → byte-identical baseline), implementing chapter-16 "adopt next" #1 ephemeris and #2 day-type. - get_ephemeris_features (calendar/features.py): continuous solar geometry the hour-of-day RBFs only encode implicitly — per-hour solar_elevation, exact daylight_duration_h, and signed hours_since_sunrise / hours_to_sunset. Pure astral (already a dep), no network, no leakage. Refs xieh18a, lope20a. - create_day_type_df / get_day_type_features (calendar/holiday.py): is_workday plus an integer day_type class (workday/Saturday/Sunday/public-holiday, with holiday precedence) from pure calendar arithmetic. Ref ziel18a. - ConfigMulti: include_ephemeris_features, include_day_type_features; wired in BaseTask.build_exogenous_features (steps 4c-bis / 4e), getattr-guarded. Note: school-holiday-per-Bundesland (also in #2) deferred — needs a bundled static dataset; tracked as a further step in the KB. Tests: 13 new (correctness, determinism, seasonal/holiday edge cases). Suite 2412 passed, coverage 72.0%; calendar/features 100%, calendar/holiday 96%. Docs reference regenerated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Implements chapter-16 "adopt next" #1 ephemeris and #2 day-type, both opt-in and default off (byte-identical baseline).
#1 Ephemeris —
get_ephemeris_features(calendar/features.py)Continuous solar geometry the hour-of-day RBFs only encode implicitly:
solar_elevation(deg, per hour),daylight_duration_h(exact),hours_since_sunrise,hours_to_sunset(signed).astral(already a dependency), deterministic, no network, zero leakage. Refsxieh18a,lope20a.#2 Day-type —
create_day_type_df/get_day_type_features(calendar/holiday.py)is_workday+ integerday_typeclass (workday / Saturday / Sunday / public-holiday, holiday precedence), pure calendar arithmetic. Refziel18a.Wiring
ConfigMulti.include_ephemeris_features,include_day_type_features; appended inBaseTask.build_exogenous_features(getattr-guarded).Deferred (documented in KB)
School-holiday-per-Bundesland (the third strand of #2) needs a bundled static dataset → tracked as a further step, not in this PR.
Tests & QC
13 new tests (correctness, determinism, seasonal & holiday edges). Suite 2412 passed, coverage 72.0% (calendar/features 100%, calendar/holiday 96%). ruff/black/isort clean, REUSE compliant, docs reference regenerated (3 new pages).
🤖 Generated with Claude Code