Commit graph

646 commits

Author SHA1 Message Date
Edward Betts 88d10af3f5 New travel type: coach
Fixes #149
2025-07-25 18:16:34 +01:00
Edward Betts 51139a1a70 Fix single day events showing as two days on calendar 2025-07-24 23:35:01 +01:00
Edward Betts 8a9bad4bba Bug fix calendar next/prev buttons. 2025-07-24 23:28:30 +01:00
Edward Betts 0e769c3de6 Replace fullcalendar with TOAST UI Calendar
Fixes #146
2025-07-24 23:10:23 +01:00
Edward Betts 3dd322475f Show ferry detail on individual trip page
Closes: #154
2025-07-24 22:30:31 +01:00
Edward Betts 672ca4b849 Generalize and enhance yearly statistics
The accommodation page has been updated to provide a more comprehensive and dynamic view of travel statistics.

Previously, the page only displayed hard-coded statistics for total nights away and abroad for the year 2024. This required manual updates each year and didn't provide historical context.

This commit introduces the following changes:

*   **Dynamically Calculate Yearly Stats:** The `accommodation_list` view in `web_view.py` now calculates statistics for every year found in the accommodation data. It correctly handles stays that span across multiple years.
*   **Display All Years:** The `accommodation.html` template now iterates through a list of all calculated yearly stats, displaying a summary for each year automatically.
*   **Add Percentage of Year:** The template also calculates and displays what percentage of the year the "total nights" and "nights abroad" represent. This includes logic to correctly account for leap years (366 days) for an accurate calculation.

These changes make the statistics more informative and ensure the page remains relevant over time without needing further manual code adjustments.
2025-07-23 22:52:22 +01:00
Edward Betts c5e88727ae Command to get airport YAML
Fixes #199
2025-07-22 21:27:51 +01:00
Edward Betts 72940be3d2 Fix flightradar24 URL to use IATA code over ICAO
Fixes #165
2025-07-21 07:34:47 +02:00
Edward Betts e6327780aa Add comprehensive test coverage for 8 modules
Increases overall test coverage from 53% to 56% by adding tests for:
- accommodation.py (60% → 100%)
- birthday.py (24% → 100%)
- calendar.py (19% → 100%)
- carnival.py (33% → 100%)
- domains.py (75% → 100%)
- events_yaml.py (50% → 96%)
- fx.py (14% → 21% for tested functions)
- sun.py (55% → 100%)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-20 11:39:49 +02:00
Edward Betts 8db777ae8b Update development guidelines for type annotations
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-20 07:35:48 +02:00
Edward Betts 7e506de7b6 Add comprehensive tests for Schengen area functionality
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-20 07:34:06 +02:00
Edward Betts fac73962b2 Add comprehensive tests and fix geomob URL bug
- Add complete test suite for geomob module (19 tests)
- Add comprehensive Bristol waste collection tests
- Fix geomob_email() double slash assertion bug for HTTPS URLs
- Fix utils.py human_readable_delta days pluralization
- Update agenda tests with better coverage

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-20 01:31:19 +02:00
Edward Betts 88ccd79cb2 Add comprehensive tests for conference module.
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-20 01:14:24 +02:00
Edward Betts ea712b2063 Add tests for GWR. 2025-07-20 01:11:07 +02:00
Edward Betts 412d8c7ba7 Chronological order validation for YAML 2025-07-20 01:10:56 +02:00
Edward Betts 4b8c29a8d0 Update airbnb parse previous airbnb stays. 2025-07-18 11:08:34 +02:00
Edward Betts 86bea456b1 Generate trip name from accommodation locations. 2025-07-18 11:07:52 +02:00
Edward Betts 567f3b0208 Refactor Airbnb parsing into reusable library
- Move all parsing logic from parse_airbnb.py to agenda/airbnb.py
- Update parse_airbnb.py to use the new library module
- Add comprehensive tests in tests/test_airbnb.py covering all functions
- Maintain backward compatibility for the command-line interface

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18 10:35:26 +02:00
Edward Betts 6b3e8e31eb Add airbnb trip detail parser. 2025-07-18 09:55:35 +02:00
Edward Betts 155569419a Code formatting with black 2025-07-18 09:47:02 +02:00
Edward Betts fcc2cdd6d4 More instructions for CLAUDE 2025-07-18 09:46:35 +02:00
Edward Betts ac16bb9dab Update CLAUDE.md with comprehensive project overview
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 14:27:56 +02:00
Edward Betts d4b516d861 Add development guidelines in CLAUDE.md
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 14:25:29 +02:00
Edward Betts 13bb753a0b Add dynamic meteor shower calculations using PyEphem
- Replace hardcoded 2025 data with astronomically calculated dates
- Use solar longitude to determine precise meteor shower peak dates
- Calculate real-time moon phases for accurate viewing conditions
- Support for any year with automatic date calculations
- Include parent body information and meteor velocities
- Remove caching layer for real-time calculations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 13:44:40 +02:00
Edward Betts 37e74404d5 Add meteor info page
Fixes #164
2025-07-16 12:42:21 +02:00
Edward Betts bcb3329fdd Add birthday email reminder functionality
Implements birthday reminder emails that are sent daily at 9 AM for birthdays
occurring within the next 7 days. Integrates with existing birthday.py module
and mail system to send notifications with appropriate timing-based subjects.

Fixes #171

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 12:24:09 +02:00
Edward Betts 2203677146 Trip debug page needs user to be authenticated. 2025-07-16 12:12:47 +02:00
Edward Betts 46091779f0 Format code with black, remove unused import. 2025-07-16 12:12:27 +02:00
Edward Betts 29d5145b87 Refactor get_location_for_date to use trip data directly
Simplify the location tracking function by extracting travel data directly
from trip objects instead of requiring separate YAML file parameters.

Changes:
- Remove airport, train, and ferry location helper functions that required
  separate YAML data lookups
- Update get_location_for_date signature to only take target_date and trips
- Extract flight/train/ferry details directly from trip.travel items
- Use embedded airport/station/terminal objects from trip data
- Remove YAML file parsing from weekends function
- Update test calls to use new simplified signature

This eliminates duplicate data loading and simplifies the API while
maintaining all existing functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 12:08:19 +02:00
Edward Betts 0e2c95117c Add debug page for trip objects
Add /trip/<start>/debug endpoint that displays the complete trip object
data in pretty-printed JSON format with syntax highlighting. Includes
both raw data and computed properties for debugging purposes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 11:25:17 +02:00
Edward Betts f396d8a62f Simplify return home heuristics now that we have comprehensive travel data
Remove complex country-based return home assumptions since we now track actual train and ferry travel back to the UK. The system can rely on real travel data rather than heuristics.

- Remove NEARBY_BALKAN_COUNTRIES constant
- Remove geographic assumptions about returning home after trips
- Keep only UK trip ending logic (if trip ends in UK, you're home)

With complete train/ferry tracking, actual return travel is captured rather than inferred.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 11:16:33 +02:00
Edward Betts e370049bcb Add train and ferry support to location tracking
- Add helper functions for train and ferry location extraction
- Update get_location_for_date to consider trains and ferries alongside flights
- Parse stations.yaml and ferry_terminals.yaml for location data
- Handle UK vs international locations consistently for all transport modes
- Add comprehensive tests for new train and ferry location helpers
- Format code with black for consistent style

Now tracks complete travel history including flights, trains, ferries, and accommodation for accurate location determination.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 11:10:58 +02:00
Edward Betts f89d984623 Refactor tests: break down single test into focused, modular tests
- Add pytest fixtures for shared data to avoid reparsing YAML files
- Split large test into specific test functions for better modularity
- Add comprehensive test coverage for busy_event, location tracking, and helper functions
- Improve test performance with session-scoped fixtures
- Enable individual test execution with pytest -k

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 09:04:05 +02:00
Edward Betts bdc94f3ebc Refactor 2025-07-16 08:40:30 +02:00
Edward Betts 135476b59f More specific types. 2025-07-16 08:11:21 +02:00
Edward Betts 02350ef4db Use None in place of "Bristol" for home
Also fix some more location bugs.
2025-07-16 07:55:20 +02:00
Edward Betts eb65f720bf Run black to format code 2025-07-16 07:42:20 +02:00
Edward Betts 3ad11b070a More tests 2025-07-16 06:54:35 +02:00
Edward Betts 9dd033ba77 Fix location tracking for all remaining weekend test failures
Expand return-home heuristic to cover more countries and reorganize logic
to prioritize trip-based location detection over individual travel data.

Key changes:
1. Add Balkan countries (GR, AL, XK, HR, etc.) to European heuristic
2. Add major international countries (US, CA, IN, JP, etc.) to heuristic
3. Change condition from >1 day to >=1 day for faster return detection
4. Move trip heuristic check before individual flight/accommodation lookup

This fixes cases where stopovers or connections (like Kosovo→Albania on
July 1) were overriding the trip-based "return home" logic. Now correctly
detects return home from all types of trips including Balkan and
international destinations.

All weekend location tests now pass - ensures locations show "Bristol"
when free (no events) or show trip locations when traveling.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 06:54:35 +02:00
Edward Betts fcd0e9c1cd Fix European trip return heuristic for weekend location tracking
Adjust European short trip heuristic from >3 days to >1 day to correctly
detect when user has returned home from European trips. This fixes the
April 29-30, 2023 case where the location incorrectly showed "Sankt Georg, Hamburg"
instead of "Bristol" when the user was free (no events scheduled) after
the foss-north trip ended on April 27.

The previous logic required more than 3 days to pass before assuming
return home from European countries, but for short European trips by
rail/ferry, users typically return within 1-2 days.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 06:54:26 +02:00
Edward Betts 663dc479c2 Weekends: Don't both showing 'home' when home. 2025-07-16 04:30:13 +02:00
Edward Betts 80e12b77ce Handle short European trips with rail/ferry returns
When traveling to nearby European countries by rail or ferry,
return journeys often aren't recorded in flight/accommodation
data. Added logic to assume you've returned home after short
European trips that ended >3 days ago.

Covers common rail/ferry destinations: Belgium, Netherlands,
France, Germany, Switzerland, Austria, Italy, Spain.

Example: Feb 2-5 trip to Brussels (by rail), Feb 18 now
correctly shows "Bristol" instead of "Brussels".

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 04:28:58 +02:00
Edward Betts 6533165bef Fix location tracking for trips ending in UK
When a trip ended in the UK but had foreign accommodations during
the trip, location tracking would incorrectly show the foreign
location even after returning home.

Added logic to detect when the most recent travel occurred within
a completed trip that ended in the UK, and override foreign
accommodations to show "Bristol" (home) for dates after the trip.

Example: Trip Sep 8-17 with accommodation in Kochi, India on Sep 10,
but trip ended at Gatwick Airport, UK. Oct 7 now correctly shows
"Bristol" instead of "Kochi".

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 04:18:56 +02:00
Edward Betts a92debea5b Fix same-day flight location tracking
When multiple flights arrived on the same date, location tracking
only compared dates and missed later flights. Now compares both
date and time to handle same-day connecting flights correctly.

Example: Nov 21, 2023
- 06:15: Arrive Madrid (MVD → MAD)
- 09:15: Arrive London (MAD → LHR) ← Now properly detected as most recent

This ensures users show as "home" when they've returned to UK on
the same day as an international connection.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 04:10:25 +02:00
Edward Betts af492750cb Add location tracking to weekend page
Weekend page now shows specific location (city and country) for each
Saturday and Sunday based on travel history:

- Analyzes flight arrivals and accommodation check-ins to determine exact location
- Shows "home" when at Bristol, UK
- Shows "City, 🏴 Country" format when traveling
- Handles multi-location trips by finding most recent travel within trip period
- Optimized to parse YAML files once instead of per-date lookup

Closes #191

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 03:59:35 +02:00
Edward Betts f41930f811 Use get_country for Schengen report 2025-07-15 18:12:11 +02:00
Edward Betts f499015466 Adjust weekend page high pithing
Don't highlight a week number when showing weekends for different year.

Example: https://edwardbetts.com/agenda/weekends?year=2100&week=1

Closes: #198
2025-07-15 17:48:44 +02:00
Edward Betts 7f12282c42 Add week and year parameters to weekends page.
Fixes #190
2025-07-15 17:42:47 +02:00
Edward Betts 220256dd91 Better space launch mail after space launch
Fixes #176.
2025-07-15 17:33:08 +02:00
Edward Betts 1806785700 Improve space launch change email format for better readability
Replace technical YAML diff output with human-readable bullet points that clearly explain what changed. Added structured email format with mission details, rocket emoji, and formatted dates.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 17:06:12 +02:00