Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRAN v1.3.1 #60

Merged
merged 9 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
_R_CHECK_EXAMPLE_TIMING_CPU_TO_ELAPSED_THRESHOLD_: "2.5"
_R_CHECK_TEST_TIMING_CPU_TO_ELAPSED_THRESHOLD_: "NA"

steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 1.3.1
Date: 2024-03-25 12:31:30 UTC
SHA: 7dd173bbc44f36fe18c7f76a877684469a5a98b0
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: nflplotR
Title: NFL Logo Plots in 'ggplot2' and 'gt'
Version: 1.3.0
Version: 1.3.1
Authors@R:
person("Sebastian", "Carl", , "[email protected]", role = c("aut", "cre"))
Description: A set of functions to visualize National Football League
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# nflplotR 1.3.1

* Adjusted internals by CRAN request. No visible changes for the user. (#60)

# nflplotR 1.3.0

## New Features
Expand Down
4 changes: 1 addition & 3 deletions R/theme-elements.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
#' - `element_nfl_headshot()`: draws NFL player headshots instead of their GSIS IDs.
#' - `element_path()`: draws images from valid image URLs instead of the URL.
#'
#' @inheritParams ggpath::element_path
#' @inheritDotParams ggpath::element_path
#'
#' @details The elements translate NFL team abbreviations or NFL player GSIS IDs
#' into logo images or player headshots, respectively.
#' @param alpha The alpha channel, i.e. transparency level, as a numerical value
Expand All @@ -23,6 +20,7 @@
#' @param hjust,vjust The horizontal and vertical adjustment respectively.
#' Must be a numerical value between 0 and 1.
#' @param size The output grob size in `cm` (!).
#' @param ... Arguments passed on to [ggpath::element_path]
#' @seealso [geom_nfl_logos()], [geom_nfl_headshots()], [geom_nfl_wordmarks()],
#' and [geom_from_path()] for more information on valid team abbreviations,
#' player IDs, and other parameters.
Expand Down
14 changes: 7 additions & 7 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@
# (EDIT: They probably use different ones in R DEVEL)
# which means "more than two cores are running".
# We check for these environment variables and if we find them
# we set data.table to two threads and the OMP library
# we set data.table to two threads
# nflplotR depends on magick which also uses OMP but doesn't respect
# OMP_THREAD_LIMIT. I have to skip the related tests unfortunately.
cpu_check <- as.numeric(
c(
cpu_check <- suppressWarnings(stats::na.omit(as.numeric(c(
Sys.getenv("_R_CHECK_EXAMPLE_TIMING_CPU_TO_ELAPSED_THRESHOLD_", unset = 0),
Sys.getenv("_R_CHECK_TEST_TIMING_CPU_TO_ELAPSED_THRESHOLD_", unset = 0)
)
)
))))

if (any(cpu_check != 0)) {
cores <- min(
cores <- suppressWarnings(min(
floor(as.integer(Sys.getenv("_R_CHECK_EXAMPLE_TIMING_CPU_TO_ELAPSED_THRESHOLD_"))),
floor(as.integer(Sys.getenv("_R_CHECK_TEST_TIMING_CPU_TO_ELAPSED_THRESHOLD_"))),
2L,
na.rm = TRUE
)
))
Sys.setenv("OMP_THREAD_LIMIT" = cores)
# see https://stat.ethz.ch/pipermail/r-package-devel/2023q4/009969.html
Sys.setenv("OMP_NUM_THREADS" = cores)
data.table::setDTthreads(cores)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Submission

This is a minor release that updates internal files and improves some functions.
This is a minor release that updates internal functionality requested by CRAN.

## R CMD check results

Expand Down
12 changes: 1 addition & 11 deletions man/element.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions tests/testthat/_snaps/geom_nfl_logos/p1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions tests/testthat/_snaps/geom_nfl_logos/p2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions tests/testthat/_snaps/geom_nfl_logos/p3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions tests/testthat/_snaps/geom_nfl_wordmarks/p1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions tests/testthat/_snaps/geom_nfl_wordmarks/p2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 0 additions & 28 deletions tests/testthat/setup.R

This file was deleted.

3 changes: 3 additions & 0 deletions tests/testthat/test-nfl_team_tiers.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
test_that("team tiers work", {
# skip because of data.table multithreading
skip_on_cran()

library(ggplot2)
teams <- nflplotR::valid_team_names()
# remove conference logos from this example
Expand Down
6 changes: 6 additions & 0 deletions vignettes/articles/nflplotR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ ggplot(df, aes(x = mpg, y = disp)) +
)
```

```{r, echo=FALSE, message=FALSE}
# the pkgdown workflow ran in cache size problems
# so we clear the cache here hoping to resolve the issue
nflplotR::.nflplotR_clear_cache()
```

Or maybe facet by player and use headshots...

```{r}
Expand Down
Loading