diff --git a/.github/workflows/check-standard.yaml b/.github/workflows/check-standard.yaml index 868c972..6bb2fea 100644 --- a/.github/workflows/check-standard.yaml +++ b/.github/workflows/check-standard.yaml @@ -25,11 +25,12 @@ jobs: - {os: windows-latest, r: "release", py: "3.x" } - {os: ubuntu-latest, r: "devel", py: "3.x", http-user-agent: "release"} - {os: ubuntu-latest, r: "oldrel-1", py: "3.x" } - - {os: ubuntu-latest, r: "release", py: "3.9" } - {os: ubuntu-latest, r: "release", py: "3.10"} - {os: ubuntu-latest, r: "release", py: "3.11"} - {os: ubuntu-latest, r: "release", py: "3.12"} - {os: ubuntu-latest, r: "release", py: "3.13"} + - {os: ubuntu-latest, r: "release", py: "3.14"} + env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} diff --git a/NEWS.md b/NEWS.md index da30da0..e9862e6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,23 +1,25 @@ # f1dataR (development version) * Updated code to match new `reticulate` interface for package and environment management. -* Updated tests to use `vcr` package to reduce hits on the Jolpica API +* Updated tests to use `vcr` package to reduce hits on the Jolpica API. * Removed support for FastF1 v < 3.0 (now causes errors instead of warnings). * Test suite and automated testing changes to reflect the above changes. -* Fixed a data conversion issue in `time_to_sec()` (#290) -* Updated testing to comply with changes in ggplot2 (#292) +* Refactored out `case_match` which was deprecated from `dplyr`. +* Fixed a data conversion issue in `time_to_sec()` (#290). +* Updated testing to comply with changes in `ggplot2` (#292). +* Updated data conversions to avoid bugs after changes in Jolpica database. (#281, #284, #298, #299) # f1dataR 2.0.1 * Forced fail-over from Ergast to Jolpica (still deprecated at 'warn' level). -* Fixed a pre-season bug where Jolpica API was missing a column in load_season(). -* Fixed a bug resulting from a change in API for 2025 season - Thanks to @appiehappie999 (#277) +* Fixed a pre-season bug where Jolpica API was missing a column in `load_season()`. +* Fixed a bug resulting from a change in API for 2025 season - Thanks to @appiehappie999. (#277) # f1dataR 2.0.0 * Deprecated Ergast and moved to Jolpica API for Ergast Functions. While this is not a breaking change in the code syntax, the documentation changes significantly to reflect this and a new major version is appropriate. (#268) -* Bugfix in plot_fastest(). -* Bugfix in load_results() with pagination - Thanks to @awanderingspirit. (#272) +* Bugfix in `plot_fastest()`. +* Bugfix in `load_results()` with pagination - Thanks to @awanderingspirit. (#272) * Bugfix in README. (#267) # f1dataR 1.6.0 diff --git a/R/plot_fastest.R b/R/plot_fastest.R index 0909d12..0c614a8 100644 --- a/R/plot_fastest.R +++ b/R/plot_fastest.R @@ -87,7 +87,7 @@ plot_fastest <- function(season = get_current_season(), round = 1, session = "R" race_name <- s$event$EventName if (!(session %in% c("r", "R"))) { - race_name <- dplyr::case_match( + race_name <- dplyr::recode_values( session, c("q", "Q") ~ paste0(race_name, " Qualifying"), c("s", "S") ~ paste0(race_name, " Sprint"), diff --git a/R/plotting_style.R b/R/plotting_style.R index bbd2abf..5bf0dd0 100644 --- a/R/plotting_style.R +++ b/R/plotting_style.R @@ -80,10 +80,10 @@ get_driver_style <- function(driver, season = get_current_season(), round = 1) { driverstyle$driver <- driver driverstyle$abbreviation <- py_env$abbreviation - driverstyle$marker <- dplyr::case_match(driverstyle$marker, + driverstyle$marker <- dplyr::recode_values(driverstyle$marker, "o" ~ 16, "x" ~ 4, - .default = 2 + default = 2 ) return(driverstyle) diff --git a/tests/testthat/test-clear_f1_cache.R b/tests/testthat/test-clear_f1_cache.R index 6af4fff..bea7325 100644 --- a/tests/testthat/test-clear_f1_cache.R +++ b/tests/testthat/test-clear_f1_cache.R @@ -17,10 +17,10 @@ test_that("Cache Clearing works for memoised functions to file", { expect_false(memoise::has_cache(load_schedule)()) vcr::local_cassette("clear_cache") - tmp <- load_schedule() - expect_true(memoise::has_cache(load_schedule)()) + tmp <- load_schedule(season = 2025) + expect_true(memoise::has_cache(load_schedule)(season = 2025)) clear_f1_cache() - expect_false(memoise::has_cache(load_schedule)()) + expect_false(memoise::has_cache(load_schedule)(season = 2025)) }) diff --git a/vignettes/alonso-penalty-2024.Rmd b/vignettes/alonso-penalty-2024.Rmd index 2fa306f..976135e 100644 --- a/vignettes/alonso-penalty-2024.Rmd +++ b/vignettes/alonso-penalty-2024.Rmd @@ -73,7 +73,7 @@ long_telem_alo <- alo_telem %>% names_to = "param", values_to = "value" ) %>% - dplyr::mutate(param = dplyr::case_match( + dplyr::mutate(param = dplyr::recode_values( param, "speed" ~ "Speed (kph)", "n_gear" ~ "Gear", @@ -117,7 +117,7 @@ long_telem_rus <- rus_telem %>% values_to = "value" ) %>% dplyr::filter(!(param == "distance_to_driver_ahead" & value > 50)) %>% - dplyr::mutate(param = dplyr::case_match( + dplyr::mutate(param = dplyr::recode_values( param, "speed" ~ "Speed (kph)", "n_gear" ~ "Gear", diff --git a/vignettes/alonso-penalty-2024.Rmd.orig b/vignettes/alonso-penalty-2024.Rmd.orig index feb34ad..d6f1f41 100644 --- a/vignettes/alonso-penalty-2024.Rmd.orig +++ b/vignettes/alonso-penalty-2024.Rmd.orig @@ -85,7 +85,7 @@ long_telem_alo <- alo_telem %>% names_to = "param", values_to = "value" ) %>% - dplyr::mutate(param = dplyr::case_match( + dplyr::mutate(param = dplyr::recode_values( param, "speed" ~ "Speed (kph)", "n_gear" ~ "Gear", @@ -121,7 +121,7 @@ long_telem_rus <- rus_telem %>% values_to = "value" ) %>% dplyr::filter(!(param == "distance_to_driver_ahead" & value > 50)) %>% - dplyr::mutate(param = dplyr::case_match( + dplyr::mutate(param = dplyr::recode_values( param, "speed" ~ "Speed (kph)", "n_gear" ~ "Gear",