Commit graph

654 commits

Author SHA1 Message Date
Edward Betts 09eb44b55d Send alerts for all space launch test flights
In addition to the configured FOLLOW_LAUNCHES, also send emails for any
launch whose mission.type == "Test Flight" even if its slug is not in
FOLLOW_LAUNCHES.

Fixes .
2025-08-12 23:23:29 +01:00
Edward Betts 97c0531a22 Send at most one grouped birthday reminder email
Collects birthdays in the next 7 days, groups them into sections
(Today/Tomorrow/In N days), and sends a single email.

Fixes .
2025-08-12 22:33:52 +01:00
Edward Betts ebceb4cb51 Improve space launch email, add tests. 2025-08-12 12:13:27 +01:00
Edward Betts 808f5c1d22 Better email alerts for space launch updates
Fixes 
2025-08-12 11:36:15 +01:00
Edward Betts fd7488bd04 Move format_launch_changes to agenda.thespacedevs 2025-08-12 10:59:56 +01:00
Edward Betts bc4d956042 Types 2025-08-01 06:21:22 +01:00
Edward Betts 8901bc9bbb Bug fix 2025-08-01 06:21:22 +01:00
Edward Betts bc8391a5d5 Unicode arrows 2025-07-25 23:17:49 +01:00
Edward Betts 88d10af3f5 New travel type: coach
Fixes 
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 
2025-07-24 23:10:23 +01:00
Edward Betts 3dd322475f Show ferry detail on individual trip page
Closes: 
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 
2025-07-22 21:27:51 +01:00
Edward Betts 72940be3d2 Fix flightradar24 URL to use IATA code over ICAO
Fixes 
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 
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 

🤖 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