From 58b8093f271f5eba79a36f9c8254979c75207177 Mon Sep 17 00:00:00 2001 From: jimcreel Date: Thu, 20 Jul 2023 13:27:18 -0700 Subject: [PATCH 1/6] Added play result documentation to readme and config/readme --- README.md | 3 +++ coordinates/README.md | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 4d77072d..d98638d2 100755 --- a/README.md +++ b/README.md @@ -261,6 +261,9 @@ A default `config.json.example` file is included for reference. Copy this file t * Pitch Data - Pitch data can be shown on the game screen, See the [coordinates readme file](/coordinates/README.md) for details. In addition, the `short` and `long` pitch description can be changed in data/pitches.py +* Previous Play Data - Data for the previous play can be shown on the game screen. See the [coordinates readme file](/coordinates/README.md) for details. Long and short play descriptions can be changed in data/plays.py **NOTE** Because play result data is ephemeral, not every play result will be displayed. Situations like a mound visit, injury, or other timeout immediately following a play often cause the play result to be immediately replaced on the MLB API. + + ### Flags You can configure your LED matrix with the same flags used in the [rpi-rgb-led-matrix](https://github.com/hzeller/rpi-rgb-led-matrix) library. More information on these arguments can be found in the library documentation. diff --git a/coordinates/README.md b/coordinates/README.md index 301bd590..0aa630e8 100644 --- a/coordinates/README.md +++ b/coordinates/README.md @@ -23,6 +23,10 @@ The layout can have a couple of different states where things are rendered diffe * `mph` (true/false) When rendering pitch speed add mph after (99 mph) * `desc_length` (short/long) The short or long pitch type description, you can change both the short and long description to your liking in data/pitches as long as you do not change the index value. +## Play Result +* `enabled` (true/false) turn feature on/off +* `desc_length` (short/long) The short or long play result description. You can change both the short and long description to your liking in data/plays. + ## Updates The software develops and releases features with full support for the default layouts, so custom layouts may look unsatisfactory if you update to later versions of the scoreboard. If you as a user decide to create a custom layout file, you are responsible for tweaking the coordinates to your liking with each update. From 1b99d526a47076f874293b0694ddc6f54ca3090b Mon Sep 17 00:00:00 2001 From: Tyler Porter Date: Thu, 20 Jul 2023 17:19:22 -0400 Subject: [PATCH 2/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d98638d2..198bc75e 100755 --- a/README.md +++ b/README.md @@ -261,8 +261,8 @@ A default `config.json.example` file is included for reference. Copy this file t * Pitch Data - Pitch data can be shown on the game screen, See the [coordinates readme file](/coordinates/README.md) for details. In addition, the `short` and `long` pitch description can be changed in data/pitches.py -* Previous Play Data - Data for the previous play can be shown on the game screen. See the [coordinates readme file](/coordinates/README.md) for details. Long and short play descriptions can be changed in data/plays.py **NOTE** Because play result data is ephemeral, not every play result will be displayed. Situations like a mound visit, injury, or other timeout immediately following a play often cause the play result to be immediately replaced on the MLB API. - +* Previous Play Data - Data for the previous play can be shown on the game screen. See the [coordinates readme file](/coordinates/README.md) for details. Long and short play descriptions can be changed in data/plays.py + * **NOTE:** Because play result data is ephemeral, not every play result will be displayed. Situations like a mound visit, injury, or other timeout immediately following a play often cause the play result to be immediately replaced on the MLB API. ### Flags From 32106698a3020a8044e80681179133a59fdb11f0 Mon Sep 17 00:00:00 2001 From: Tyler Porter Date: Tue, 15 Aug 2023 19:35:03 -0400 Subject: [PATCH 3/6] Run tests against Python 3.11 in CI --- .github/workflows/run_unittest_on_pr_open.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_unittest_on_pr_open.yml b/.github/workflows/run_unittest_on_pr_open.yml index 1697b03c..c50fde17 100644 --- a/.github/workflows/run_unittest_on_pr_open.yml +++ b/.github/workflows/run_unittest_on_pr_open.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -25,4 +25,4 @@ jobs: pip install -r ./requirements.txt - name: Test with unittest run: | - python -m unittest discover -s ./tests -p 'test_*.py' \ No newline at end of file + python -m unittest discover -s ./tests -p 'test_*.py' From 5af31858bafed814f1588eb4b8c37c8930bfbcaa Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Sun, 1 Oct 2023 20:56:16 -0400 Subject: [PATCH 4/6] Fix is_postseason logic --- renderers/main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/renderers/main.py b/renderers/main.py index bf7eb5ac..54fc0e64 100644 --- a/renderers/main.py +++ b/renderers/main.py @@ -232,11 +232,12 @@ def __draw_standings(self, cond: Callable[[], bool]): self.canvas = self.matrix.SwapOnVSync(self.canvas) - if self.data.standings.is_postseason() and update % 20 == 0: - if self.standings_league == "NL": - self.standings_league = "AL" - else: - self.standings_league = "NL" + if self.data.standings.is_postseason(): + if update % 20 == 0: + if self.standings_league == "NL": + self.standings_league = "AL" + else: + self.standings_league = "NL" elif self.canvas.width == 32 and update % 5 == 0: if self.standings_stat == "w": self.standings_stat = "l" From 4a87a1d6ec7960d84a2fa70b455837b220471c57 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Sun, 1 Oct 2023 21:08:51 -0400 Subject: [PATCH 5/6] Update data --- data/status.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/data/status.py b/data/status.py index e68e19cb..aadc9d34 100644 --- a/data/status.py +++ b/data/status.py @@ -84,6 +84,7 @@ INSTANT_REPLAY = "Instant Replay" # Live MANAGER_CHALLENGE = "Manager challenge" # Live MANAGER_CHALLENGE_CATCHDROP_IN_OUTFIELD = "Manager challenge: Catch/drop in outfield" # Live +MANAGER_CHALLENGE_CATCHERS_INTERFERENCE = "Manager challenge: Catchers Interference" # Live MANAGER_CHALLENGE_CLOSE_PLAY_AT_1ST = "Manager challenge: Close play at 1st" # Live MANAGER_CHALLENGE_FAIRFOUL_IN_OUTFIELD = "Manager challenge: Fair/foul in outfield" # Live MANAGER_CHALLENGE_FAN_INTERFERENCE = "Manager challenge: Fan interference" # Live @@ -157,6 +158,8 @@ UMPIRE_REVIEW_TOUCHING_A_BASE = "Umpire review: Touching a base" # Live UMPIRE_REVIEW_TRAP_PLAY_IN_OUTFIELD = "Umpire review: Trap play in outfield" # Live UMPIRE_REVIEW_SHIFT_VIOLATION = "Umpire review: Def Shift Violation" # Live +UMPIRE_CHALLENGE_PITCH_RESULT = "Umpire Challenge: Pitch Result" # Live +PLAYER_CHALLENGE_PITCH_RESULT = "Player challenge: Pitch Result" # Live UNKNOWN = "Unknown" # Other WARMUP = "Warmup" # Live WRITING = "Writing" # Other @@ -170,6 +173,7 @@ INSTANT_REPLAY, MANAGER_CHALLENGE, MANAGER_CHALLENGE_CATCHDROP_IN_OUTFIELD, + MANAGER_CHALLENGE_CATCHERS_INTERFERENCE, MANAGER_CHALLENGE_CLOSE_PLAY_AT_1ST, MANAGER_CHALLENGE_FAIRFOUL_IN_OUTFIELD, MANAGER_CHALLENGE_FAN_INTERFERENCE, @@ -211,6 +215,8 @@ UMPIRE_REVIEW_TOUCHING_A_BASE, UMPIRE_REVIEW_TRAP_PLAY_IN_OUTFIELD, UMPIRE_REVIEW_SHIFT_VIOLATION, + UMPIRE_CHALLENGE_PITCH_RESULT, + PLAYER_CHALLENGE_PITCH_RESULT, ] GAME_STATE_PREGAME = [SCHEDULED, PREGAME, WARMUP] @@ -300,6 +306,7 @@ FORFEIT_WILLFUL_RULE_VIOLATION, MANAGER_CHALLENGE, MANAGER_CHALLENGE_CATCHDROP_IN_OUTFIELD, + MANAGER_CHALLENGE_CATCHERS_INTERFERENCE, MANAGER_CHALLENGE_CLOSE_PLAY_AT_1ST, MANAGER_CHALLENGE_FAIRFOUL_IN_OUTFIELD, MANAGER_CHALLENGE_FAN_INTERFERENCE, @@ -371,6 +378,8 @@ UMPIRE_REVIEW_TOUCHING_A_BASE, UMPIRE_REVIEW_TRAP_PLAY_IN_OUTFIELD, UMPIRE_REVIEW_SHIFT_VIOLATION, + UMPIRE_CHALLENGE_PITCH_RESULT, + PLAYER_CHALLENGE_PITCH_RESULT, WRITING, UNKNOWN, ] From 0a86733322b5d0a387565ecda496948ba29c84a9 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Sun, 1 Oct 2023 21:32:08 -0400 Subject: [PATCH 6/6] Formatting --- renderers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renderers/main.py b/renderers/main.py index 54fc0e64..4bb72b53 100644 --- a/renderers/main.py +++ b/renderers/main.py @@ -233,7 +233,7 @@ def __draw_standings(self, cond: Callable[[], bool]): self.canvas = self.matrix.SwapOnVSync(self.canvas) if self.data.standings.is_postseason(): - if update % 20 == 0: + if update % 20 == 0: if self.standings_league == "NL": self.standings_league = "AL" else: