diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d278236..75e449a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,23 @@ accepts both, but the store flags the old spelling as deprecated ## Unreleased +## 3.8.5 + +Fewer ESPN requests on the hourly schedule refresh (#754), and sports +consolidation family 8: `src.common.sports_rankings`, which the scoreboards +adopt by flooring on 3.8.5 (#789). + +### ESPN: settled days are not fetched again + +- A scoreboard's hourly Recent/Upcoming refresh asks ESPN for its window one + day at a time, and most of those days can no longer change. A chunk whose + last day is three or more days back is now kept in memory for 24 hours + (compressed, at most 512 entries / 8 MB) and answered from there, for + `fetch_espn_scoreboard` and the background service alike. Failed and + capped chunks are never kept, and each hit is parsed afresh. Against live + ESPN, a second refresh of five scoreboard windows went from 111 requests + and 10.2 MB to 50 requests and 3.2 MB with identical events. (#754) + ### New modules - `src/common/sports_rankings.py` -- sports consolidation family 8, once the @@ -31,8 +48,7 @@ accepts both, but the store flags the old spelling as deprecated a poll from a season that has ended (its `endDate` has passed) loads nothing, so no rank badge shows between seasons; the college football division rosters are asked for the season year. A plugin may inherit the - mixin once it floors on the release that ships it, and deletes its copies - then. + mixin once it floors on 3.8.5, and deletes its copies then. (#789) ## 3.8.4 diff --git a/docs/SPORTS_UNIFICATION.md b/docs/SPORTS_UNIFICATION.md index 9809f3a0..4ad2ba0e 100644 --- a/docs/SPORTS_UNIFICATION.md +++ b/docs/SPORTS_UNIFICATION.md @@ -94,6 +94,7 @@ more. Shared sports code lives in `src/common`: | `sports_game_over.py` | 3.8.1 | `SportsGameOverMixin` — `_is_game_really_over`, with the `FINAL_PERIOD` seam (family 5) | | `sports_favorites.py` | 3.8.2 | `SportsFavoritesMixin`, `SportsUpcomingFavoritesMixin`, `SportsRecentFavoritesMixin` — `_is_favorite_game` and the favourites-only picks, on the `_favorite_key` seam (family 6) | | `sports_rotation.py` | 3.8.4 | `SportsRotationMixin` — the other-games rotation (importance order, the window, odds on rotated-in games), on the `_rankings_loaded` seam (family 7) | +| `sports_rankings.py` | 3.8.5 | `SportsRankingsMixin` — which teams are ranked (by id and abbreviation), the poll choice, stale polls hidden, the "ranked" filter; `choose_top_division_poll()` (family 8) | Each is described in [src/common/README.md](../src/common/README.md). @@ -382,7 +383,7 @@ ufc's MMA managers override `update()` and never build the pools, so the rotation is dormant there. `_best_rank`, `_is_ranked_game` and `_passes_other_filters` were family 8. -### Family 8: rankings (reconciled; promoted, awaiting release) +### Family 8: rankings (reconciled; promoted, core 3.8.5) ledmatrix-plugins `scripts/test_rankings.py` (#644) pinned 79 rows across the nine plugins first, every ESPN request answered offline from recorded-shape @@ -501,7 +502,7 @@ release. | 5 | Game-over check | `SportsLive._is_game_really_over` (5) | Pure logic, no pixels; one seam, `FINAL_PERIOD`. The pilot for the procedure. Reconciled to one body and promoted as `sports_game_over`; shipped in 3.8.1 and adopted. See [Family 5](#family-5-the-game-over-check-done-core-381-adopted) | | 6 | Favourite matching | `_is_favorite_game` (7 across three classes), `_select_games_for_display` (2: nrl), `_select_recent_games_for_display` (3) | Everything that asks "is this a favourite" goes through the 3.5.0 `_favorite_key` seam. Reconciled to one body each and promoted as `sports_favorites`; shipped in 3.8.2 and adopted. See [Family 6](#family-6-favourite-matching-done-core-382-adopted) | | 7 | Other-games rotation | `_by_importance`, `_other_games_window`, `_advance_other_games_if_due` (2 each: football), `_rotate_other_games_on_display` (2: ufc), with `_attach_odds_to_rotated_games` (3; ufc had none) | One outlier each; football carried two fixes the other eight lacked. Reconciled to one body each, on a `_rankings_loaded` seam, and promoted as `sports_rotation`; done: core 3.8.4, adopted (ledmatrix-plugins #643). See [Family 7](#family-7-the-other-games-rotation-done-core-384-adopted) | -| 8 | Rankings | `_fetch_team_rankings` (3), `_choose_poll` (3), `_load_division_team_ids`, `_passes_other_filters`, `_best_rank`, `_is_ranked_game` (2 each: football) | Needs 7; the rank badge and the "ranked only" filter read it. Reconciled to one body each and promoted as `sports_rankings` (next release). See [Family 8](#family-8-rankings-reconciled-promoted-awaiting-release) | +| 8 | Rankings | `_fetch_team_rankings` (3), `_choose_poll` (3), `_load_division_team_ids`, `_passes_other_filters`, `_best_rank`, `_is_ranked_game` (2 each: football) | Needs 7; the rank badge and the "ranked only" filter read it. Reconciled to one body each and promoted as `sports_rankings` (core 3.8.5). See [Family 8](#family-8-rankings-reconciled-promoted-core-385) | | 9 | Live fetch and odds | `_fetch_todays_games` (5), `_fetch_odds` (3), `_attach_odds_to_rotated_games` (3) | The prerequisite for one shared ESPN poller across plugins | | 10 | View model | `_extract_game_details_common` (9 of 9) | Every renderer reads it; its keys are additive-only, so reconcile to the superset and leave sport extras in `_extract_game_details` | | 11 | Switch scorebug | `_load_fonts` (4), `_load_custom_font_from_element_config` (6), `_get_layout_offset` (5), `_fit_score_font` (2: football), `_load_and_resize_logo` (9), `_draw_dynamic_odds` (9), then `_draw_scorebug_layout` (20: Upcoming 9, Recent 8, Live 2, ufc's Core 1) | Needs 10 and the twin decisions below. Several releases: fonts and offsets, logos, odds, then one mode's layout per release | diff --git a/src/__init__.py b/src/__init__.py index 46ef081c..d4f3d587 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -4,5 +4,5 @@ LEDMatrix Display System Core source package for the LED Matrix Display project. """ -__version__ = "3.8.4" +__version__ = "3.8.5" diff --git a/src/common/README.md b/src/common/README.md index 53beddd2..6e8e5882 100644 --- a/src/common/README.md +++ b/src/common/README.md @@ -53,7 +53,7 @@ Rules for the package: | [`sports_helpers`](#sports_helpers) | Small helpers every scoreboard `sports.py` copies | Yes (scoreboards) | 3.5.0 | | [`sports_live_scroll`](#sports_live_scroll) | Rebuild a live scroll strip mid-cycle without moving it | Yes (scoreboards) | 3.8.0 | | [`sports_plugin_host`](#sports_plugin_host) | Helpers of a scoreboard's plugin class (`manager.py`) | Yes (scoreboards) | 3.8.0 | -| [`sports_rankings`](#sports_rankings) | Which teams are ranked, in which poll, and the "ranked" filter | Yes (scoreboards) | next release | +| [`sports_rankings`](#sports_rankings) | Which teams are ranked, in which poll, and the "ranked" filter | Yes (scoreboards) | 3.8.5 | | [`sports_rotation`](#sports_rotation) | Which non-favourite games a scoreboard shows, and when the slice moves | Yes (scoreboards) | 3.8.4 | | [`sports_scroll`](#sports_scroll) | Scoreboard scroll-display orchestration | Yes (scoreboards) | 3.2.0 | | [`sports_shared`](#sports_shared) | Sport-independent `sports.py` methods | Yes (scoreboards) | 3.3.0 |