From d56e43ee155f26e4c9e850c471ebab9bcfdc8ea2 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 17:58:43 +0000 Subject: [PATCH 1/4] Require ggplot2 >= 3.5.2 ggh4x, which deeptime imports, already requires ggplot2 >= 3.5.2, so deeptime could not be used with ggplot2 3.5.0 or 3.5.1 anyway. Make the requirement explicit in DESCRIPTION. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01A7zDoJJQSEuNmyB6xR3njB --- DESCRIPTION | 2 +- NEWS.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9d0a39b..86c04e9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,7 +20,7 @@ LazyData: true biocViews: Imports: deeptimedata, - ggplot2 (>= 3.5.0), + ggplot2 (>= 3.5.2), utils, ggforce, grid, diff --git a/NEWS.md b/NEWS.md index e56a7c3..eaf2c8f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # deeptime (development version) +__deeptime now requires ggplot2 version 3.5.2 or higher__, matching the requirement of its ggh4x dependency. + # deeptime 2.4.0 __deeptime now requires R version 4.1 or higher__. From e0758e89b7a20ed98167ec74afee56029e906cc5 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 18:06:20 +0000 Subject: [PATCH 2/4] Test the minimum supported ggplot2 version in CI The ">= 3.5.2" matrix entry installed the latest ggplot2, so ggplot2 3.5.x was never tested. Rename it to "release" and add a job pinned to ggplot2 3.5.2 on ubuntu-latest with R release. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01A7zDoJJQSEuNmyB6xR3njB --- .github/workflows/R-CMD-check.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 87da019..59ae3e5 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -26,13 +26,17 @@ jobs: fail-fast: false matrix: # devel only on schedule + manual dispatch; push/PR get stable only - ggplot2: ${{ fromJSON((github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && '[">= 3.5.2", "devel"]' || '[">= 3.5.2"]') }} + ggplot2: ${{ fromJSON((github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && '["release", "devel"]' || '["release"]') }} config: - {os: macos-latest, r: 'release'} - {os: windows-latest, r: 'release'} - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: 'release'} - {os: ubuntu-latest, r: 'oldrel-1'} + # minimum supported ggplot2 version (see DESCRIPTION) + include: + - ggplot2: '3.5.2' + config: {os: ubuntu-latest, r: 'release'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -59,12 +63,13 @@ jobs: extra-packages: any::rcmdcheck needs: check + # the release version is already installed by setup-r-dependencies - name: Install ggplot2 ${{ matrix.ggplot2 }} run: | install.packages("remotes") remotes::install_version("ggplot2", version = "${{ matrix.ggplot2 }}") shell: Rscript {0} - if: matrix.ggplot2 != 'devel' + if: matrix.ggplot2 != 'devel' && matrix.ggplot2 != 'release' - name: Install development ggplot2 run: | From 2868b971a38e320d6452fdea9e5f9fa33df4187a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 18:17:21 +0000 Subject: [PATCH 3/4] Skip vignettes in the minimum ggplot2 version CI job Current versions of ggtree and ggpattern, used in the vignettes, require ggplot2 >= 4.0.0, so the vignettes cannot be built with ggplot2 3.5.2. Build and check without vignettes in that job, and only fail on errors, since docs inherited from newer ggplot2 versions give Rd xref warnings. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01A7zDoJJQSEuNmyB6xR3njB --- .github/workflows/R-CMD-check.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 59ae3e5..b3f013d 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -37,6 +37,9 @@ jobs: include: - ggplot2: '3.5.2' config: {os: ubuntu-latest, r: 'release'} + # current versions of some suggested packages used in the + # vignettes (e.g., ggtree, ggpattern) require ggplot2 >= 4.0.0 + skip_vignettes: true env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -84,4 +87,8 @@ jobs: _R_CHECK_FORCE_SUGGESTS_: 0 with: upload-snapshots: true - build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' + build_args: ${{ matrix.skip_vignettes && 'c("--no-manual","--no-build-vignettes")' || 'c("--no-manual","--compact-vignettes=gs+qpdf")' }} + args: ${{ matrix.skip_vignettes && 'c("--no-manual","--as-cran","--ignore-vignettes")' || 'c("--no-manual","--as-cran")' }} + # without vignettes, and with docs inherited from newer ggplot2 + # versions, only errors are meaningful for the minimum version job + error-on: ${{ matrix.skip_vignettes && '"error"' || '"warning"' }} From e660d07577b1b5e592ba2506c9036d6fb446a09b Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 18:27:20 +0000 Subject: [PATCH 4/4] Fix tests for the minimum ggplot2 version CI job Skip the two guide tests that use ggtree when it is not available, and add/update the pre-4.0 coord_geo stacked scale snapshots. The updated snapshot only gains empty clip-path groups; its text and shapes are unchanged, and the new ones match their ggplot4 counterparts. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01A7zDoJJQSEuNmyB6xR3njB --- .../stacked-scales-on-left-right-new.svg | 542 ++++++++++++++++++ .../stacked-scales-on-top-bottom-new.svg | 476 +++++++++++++++ .../stacked-scales-with-single-pos-new.svg | 12 + tests/testthat/test-guides.R | 2 + 4 files changed, 1032 insertions(+) create mode 100644 tests/testthat/_snaps/coord_geo/stacked-scales-on-left-right-new.svg create mode 100644 tests/testthat/_snaps/coord_geo/stacked-scales-on-top-bottom-new.svg diff --git a/tests/testthat/_snaps/coord_geo/stacked-scales-on-left-right-new.svg b/tests/testthat/_snaps/coord_geo/stacked-scales-on-left-right-new.svg new file mode 100644 index 0000000..764c94d --- /dev/null +++ b/tests/testthat/_snaps/coord_geo/stacked-scales-on-left-right-new.svg @@ -0,0 +1,542 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +0 +1 +2 +3 +4 +5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PT1 +PL6 +PL5 +PL3 +PL2 +PL1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +C1 +C2 +C2A +C3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +C1 +C2 +C2A +C3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PT1 +PL6 +PL5 +PL3 +PL2 +PL1 + + + + + + + + + + + + + +0 +1 +2 +3 +4 +5 + + + + + + +2 +3 +4 +5 +6 +d18O +Time (Ma) +stacked scales on left-right new + + diff --git a/tests/testthat/_snaps/coord_geo/stacked-scales-on-top-bottom-new.svg b/tests/testthat/_snaps/coord_geo/stacked-scales-on-top-bottom-new.svg new file mode 100644 index 0000000..f92a27f --- /dev/null +++ b/tests/testthat/_snaps/coord_geo/stacked-scales-on-top-bottom-new.svg @@ -0,0 +1,476 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 +1 +2 +3 +4 +5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PT1 +PL6 +PL5 +PL3 +PL2 +PL1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +C1 +C2 +C2A +C3 + + + + + + + +2 +3 +4 +5 +6 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +C1 +C2 +C2A +C3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PT1 +PL6 +PL5 +PL3 +PL2 +PL1 + + + + + + + + + + + + + +0 +1 +2 +3 +4 +5 +Time (Ma) +d18O +stacked scales on top-bottom new + + diff --git a/tests/testthat/_snaps/coord_geo/stacked-scales-with-single-pos-new.svg b/tests/testthat/_snaps/coord_geo/stacked-scales-with-single-pos-new.svg index bd2fd01..510e376 100644 --- a/tests/testthat/_snaps/coord_geo/stacked-scales-with-single-pos-new.svg +++ b/tests/testthat/_snaps/coord_geo/stacked-scales-with-single-pos-new.svg @@ -48,6 +48,10 @@ + + + + @@ -177,6 +181,10 @@ + + + + @@ -245,6 +253,10 @@ + + + + diff --git a/tests/testthat/test-guides.R b/tests/testthat/test-guides.R index 55a358b..a825058 100644 --- a/tests/testthat/test-guides.R +++ b/tests/testthat/test-guides.R @@ -180,6 +180,7 @@ test_that("ggtree scale works with only fossil taxa", { }) test_that("guide_geo works with coord_geo_radial", { + skip_if_not_installed("ggtree") skip_if_not_installed("ape") gg <- revts(ggtree(tree)) + coord_geo_radial(dat = "epochs", end = 1.49 * pi, @@ -196,6 +197,7 @@ test_that("guide_geo works with coord_geo_radial", { }) test_that("ggtree scale works with only fossil taxa", { + skip_if_not_installed("ggtree") skip_if_not_installed("paleotree") gg <- ggtree(ceratopsianTreeRaia, position = position_nudge(x = -ceratopsianTreeRaia$root.time)) +