Skip to content

Commit

Permalink
Upkeep 2024-10 (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 authored Oct 25, 2024
1 parent fda519e commit d9c22b6
Show file tree
Hide file tree
Showing 40 changed files with 1,601 additions and 120 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ on:
pull_request:
branches: [main, master]

name: R-CMD-check
name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
Expand All @@ -25,24 +27,22 @@ jobs:
- {os: macos-latest, r: 'release'}

- {os: windows-latest, r: 'release'}
# Use 3.6 to trigger usage of RTools35
- {os: windows-latest, r: '3.6'}
# use 4.1 to check with rtools40's older compiler
- {os: windows-latest, r: '4.1'}

- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}
- {os: ubuntu-latest, r: 'oldrel-4'}
# use 4.0 or 4.1 to check with rtools40's older compiler
- {os: windows-latest, r: 'oldrel-4'}

- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}
- {os: ubuntu-latest, r: 'oldrel-4'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -60,3 +60,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
8 changes: 5 additions & 3 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ on:
types: [published]
workflow_dispatch:

name: pkgdown
name: pkgdown.yaml

permissions: read-all

jobs:
pkgdown:
Expand All @@ -22,7 +24,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -41,7 +43,7 @@ jobs:

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
issue_comment:
types: [created]

name: Commands
name: pr-commands.yaml

permissions: read-all

jobs:
document:
Expand All @@ -13,8 +15,10 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
Expand Down Expand Up @@ -50,8 +54,10 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
Expand Down
23 changes: 17 additions & 6 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ on:
pull_request:
branches: [main, master]

name: test-coverage
name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
Expand All @@ -15,36 +17,45 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
covr::codecov(
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: scales
Title: Scale Functions for Visualization
Version: 1.3.0.9000
Authors@R: c(
person("Hadley", "Wickham", , "[email protected]", role = c("aut")),
person("Hadley", "Wickham", , "[email protected]", role = "aut"),
person("Thomas Lin", "Pedersen", , "[email protected]", role = c("cre", "aut"),
comment = c(ORCID = "0000-0002-5147-4711")),
person("Dana", "Seidel", role = "aut"),
Expand All @@ -14,7 +14,7 @@ License: MIT + file LICENSE
URL: https://scales.r-lib.org, https://github.com/r-lib/scales
BugReports: https://github.com/r-lib/scales/issues
Depends:
R (>= 3.6)
R (>= 4.0)
Imports:
cli,
farver (>= 2.0.3),
Expand All @@ -35,6 +35,7 @@ Suggests:
testthat (>= 3.0.0)
Config/Needs/website: tidyverse/tidytemplate
Config/testthat/edition: 3
Config/usethis/last-upkeep: 2024-10-24
Encoding: UTF-8
LazyLoad: yes
Roxygen: list(markdown = TRUE, r6 = FALSE)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2023
YEAR: 2024
COPYRIGHT HOLDER: scales authors
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2023 scales authors
Copyright (c) 2024 scales authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ S3method(rescale_mid,logical)
S3method(rescale_mid,numeric)
S3method(round_any,POSIXct)
S3method(round_any,numeric)
S3method(toPaletteFunc,"function")
S3method(toPaletteFunc,character)
S3method(toPaletteFunc,matrix)
export(ContinuousRange)
export(DiscreteRange)
export(Range)
Expand Down
3 changes: 3 additions & 0 deletions R/colour-mapping.R
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ toPaletteFunc <- function(pal, alpha, nlevels) {

# Strings are interpreted as color names, unless length is 1 and it's the name
# of an RColorBrewer palette that is marked as qualitative
#' @export
toPaletteFunc.character <- function(pal, alpha, nlevels) {
if (length(pal) == 1 && pal %in% row.names(RColorBrewer::brewer.pal.info)) {
paletteInfo <- RColorBrewer::brewer.pal.info[pal, ]
Expand All @@ -338,11 +339,13 @@ toPaletteFunc.character <- function(pal, alpha, nlevels) {
}

# Accept colorRamp style matrix
#' @export
toPaletteFunc.matrix <- function(pal, alpha, nlevels) {
toPaletteFunc(farver::decode_colour(pal), alpha = alpha)
}

# If a function, just assume it's already a function over [0-1]
#' @export
toPaletteFunc.function <- function(pal, alpha, nlevels) {
pal
}
Expand Down
5 changes: 4 additions & 1 deletion R/label-number.R
Original file line number Diff line number Diff line change
Expand Up @@ -469,14 +469,17 @@ cut_time_scale <- function(space = FALSE) {
out <- c(
0,
"ns" = 1e-9,
"\u03BCs" = 1e-6,
"us" = 1e-6,
"ms" = 1e-3,
"s" = 1,
"m" = 60,
"h" = 3600,
"d" = 24 * 3600,
"w" = 7 * 24 * 3600
)
if (l10n_info()[["UTF-8"]]) {
names(out)[3] <- "\u03BCs"
}
if (space) {
names(out) <- paste0(" ", names(out))
}
Expand Down
Loading

0 comments on commit d9c22b6

Please sign in to comment.