Skip to content

Fix weekday-dependent sleep test, timeline NULL-duration 500, binary streak cells - #80

Merged
dandwhelan merged 1 commit into
mainfrom
claude/nifty-hawking-lsd0ph
Oct 3, 2026
Merged

dandwhelan merged 1 commit into
mainfrom
claude/nifty-hawking-lsd0ph

Conversation

@dandwhelan

Copy link
Copy Markdown
Owner
  • Flaky test fix (tests/conftest.py): the fixture's weekend bedtime (23.2 + 1.2 h) could tip past midnight, so test_sleep_lands_on_the_wake_date_not_the_night_it_started passed or failed depending on the run date. This is what turned Scale scan: muscle rate, ideal weight, Low/Standard/High ratings #79's CI red. Bedtime is now capped before midnight.
  • sleep_timeline: a row with bed/wake timestamps but a NULL sleep_time_seconds made int(NaN) crash /api/visualizations. Duration now falls back to the bed→wake span.
  • behavior_streak_calendar: yes/no behaviours logged with no value had a NaN mean and showed as not logged. They now show as 1.0.

Both fixes are carried over from the closed #70 (the rest of #70 is already on main or was superseded). There are two new regression tests: they fail without the fixes and pass with them. Full suite: 706 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LW7scFTkVq5qopfyQydo4L


Generated by Claude Code

…streak cells

- conftest: cap fixture bedtime before midnight; weekend drift past 24h made
  test_sleep_lands_on_the_wake_date_not_the_night_it_started fail by run date.
- sleep_timeline: NULL sleep_time_seconds no longer crashes int(NaN); duration
  falls back to the bed->wake span.
- behavior_streak_calendar: logged yes/no behaviours (no value) render as 1.0
  instead of unlogged.

Carried over from the closed #70.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LW7scFTkVq5qopfyQydo4L
@dandwhelan
dandwhelan marked this pull request as ready for review October 3, 2026 07:24
@dandwhelan
dandwhelan merged commit 0bd2c8b into main Oct 3, 2026
4 checks passed
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.

2 participants