Skip to content

feat(calendar): ephemeris solar-geometry features + day-type refinement (#1, #2)#347

Merged
bartzbeielstein merged 1 commit into
developfrom
feat/ephemeris-day-type-features
Jun 8, 2026
Merged

feat(calendar): ephemeris solar-geometry features + day-type refinement (#1, #2)#347
bartzbeielstein merged 1 commit into
developfrom
feat/ephemeris-day-type-features

Conversation

@bartzbeielstein
Copy link
Copy Markdown
Collaborator

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).
  • Pure astral (already a dependency), deterministic, no network, zero leakage. Refs xieh18a, lope20a.

#2 Day-type — create_day_type_df / get_day_type_features (calendar/holiday.py)

  • is_workday + integer day_type class (workday / Saturday / Sunday / public-holiday, holiday precedence), pure calendar arithmetic. Ref ziel18a.

Wiring

ConfigMulti.include_ephemeris_features, include_day_type_features; appended in BaseTask.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

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>
@bartzbeielstein bartzbeielstein merged commit 4685979 into develop Jun 8, 2026
10 checks passed
@bartzbeielstein bartzbeielstein deleted the feat/ephemeris-day-type-features branch June 8, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant