Skip to content

Commit

Permalink
Merge pull request #50 from EvolEcolGroup/master
Browse files Browse the repository at this point in the history
Update to v2.1.0
  • Loading branch information
dramanica authored Jun 19, 2024
2 parents 36b0a06 + 923e509 commit 8ae609e
Show file tree
Hide file tree
Showing 24 changed files with 174 additions and 62 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ ci_dependencies
^CRAN-SUBMISSION$
^codecov.yml
^data-raw$
.covrignore
1 change: 1 addition & 0 deletions .covrignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ R/download_worldclim_future.R
R/download_etopo.R
R/load_etopo.R
R/download_chelsa.R
R/download_chelsa_trace21k.R
18 changes: 18 additions & 0 deletions .github/workflows/recheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
workflow_dispatch:
inputs:
which:
type: choice
description: Which dependents to check
options:
- strong
- most

name: Reverse dependency check

jobs:
revdep_check:
name: Reverse check ${{ inputs.which }} dependents
uses: r-devel/recheck/.github/workflows/recheck.yml@v1
with:
which: ${{ inputs.which }}
95 changes: 95 additions & 0 deletions .github/workflows/rhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
# You can update this file to a newer version using the rhub2 package:
#
# rhub::rhub_setup()
#
# It is unlikely that you need to modify this file manually.

name: R-hub
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"

on:
workflow_dispatch:
inputs:
config:
description: 'A comma separated list of R-hub platforms to use.'
type: string
default: 'linux,windows,macos'
name:
description: 'Run name. You can leave this empty now.'
type: string
id:
description: 'Unique ID. You can leave this empty now.'
type: string

jobs:

setup:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.rhub-setup.outputs.containers }}
platforms: ${{ steps.rhub-setup.outputs.platforms }}

steps:
# NO NEED TO CHECKOUT HERE
- uses: r-hub/actions/setup@v1
with:
config: ${{ github.event.inputs.config }}
id: rhub-setup

linux-containers:
needs: setup
if: ${{ needs.setup.outputs.containers != '[]' }}
runs-on: ubuntu-latest
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.containers) }}
container:
image: ${{ matrix.config.container }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/run-check@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}

other-platforms:
needs: setup
if: ${{ needs.setup.outputs.platforms != '[]' }}
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.platforms) }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/setup-r@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 2.0.0
Date: 2023-11-01 17:32:06 UTC
SHA: dc93c5c9f92f52ac7b178eac2b7095536868867d
Version: 2.1.0
Date: 2024-06-19 15:11:32 UTC
SHA: 632c24b70ad487380186aaad24532545b4ffda56
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Package: pastclim
Type: Package
Title: Manipulate Time Series of Palaeoclimate Reconstructions
Version: 2.0.0.9003
Version: 2.1.0
Authors@R: c(
person("Michela", "Leonardi", role = "aut"),
person(c("Emily","Y."), "Hallet", role = "ctb"),
person("Robert", "Beyer", role = "ctb"),
person("Mario", "Krapp", role = "ctb"),
person(c("Andrea", "V."), "Pozzi", role = "ctb"),
person("Andrea", "Manica", role = c("aut","cre"),
email = "[email protected]")
)
Expand All @@ -22,7 +23,7 @@ BugReports: https://github.com/EvolEcolGroup/pastclim/issues
Encoding: UTF-8
LazyData: true
LazyDataCompression: xz
RoxygenNote: 7.3.0
RoxygenNote: 7.3.1
Roxygen: list(markdown = TRUE)
Depends:
R (>= 4.0.0),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# development version
# pastclim 2.1.0
* Add all CHELSA present and future datasets (including the use of virtual rasters to avoid downloading all data)
* Add paleoclim at multiple resolutions
* Add CHELSA-TraCE21k (including the use of virtual rasters to avoid downloading all data)
Expand Down
6 changes: 3 additions & 3 deletions R/datasets_docs.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ NULL
#' in `pastclim`
#'
#' More details on the dataset are available on its
#' dedicated \href{https://hyde-portal.geo.uu.nl/}{website}.
#' dedicated \href{https://landuse.sites.uu.nl/hyde-project/}{website}.
#'
#' IMPORTANT: If you use this dataset, make sure to cite the original publication
#' for the HYDE 3.2 (there is no current publication for 3.3):
#'
#' Klein Goldewijk, K., Beusen, A., Doelman, J., and Stehfest, E.:
#' Anthropogenic land-use estimates for the Holocene; HYDE 3.2,
#' Earth Syst. Sci. Data, 9, 927-953, 2017. \doi{10.5194/essd-9-1-2017}
#' Earth Syst. Sci. Data, 9, 927-953, 2017. \doi{10.5194/essd-9-927-2017}
#'
#' @name HYDE_3.3_baseline
NULL
Expand Down Expand Up @@ -319,7 +319,7 @@ NULL
#' using the CHELSA V1.2 algorithm.
#'
#' More details on the dataset are available on its dedicated
#' \href{https://chelsa-climate.org/chelsa-trace21k//}{website}.
#' \href{https://chelsa-climate.org/chelsa-trace21k/}{website}.
#'
#' An alternative to
#' downloading very large files is to use virtual rasters. Simply append
Expand Down
3 changes: 2 additions & 1 deletion R/get_data_path.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ get_data_path <- function(silent = FALSE) {
"pastclim_data.txt"
))[1, 1]
if (!dir.exists(path_to_nc)) {
stop(
warning(
"The path ", path_to_nc, " from the config file does not exist!\n",
"You can reset the path with `set_data_path`."
)
return(NULL)
}
return(path_to_nc)
}
Expand Down
2 changes: 1 addition & 1 deletion R/location_slice_from_region_series.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' coordinates, as found in `data`. If left to NULL, the function will
#' try to guess the columns based on standard names `c("x", "y")`, `c("X","Y")`,
#' `c("longitude", "latitude")`, or `c("lon", "lat")`
#' @param region_series a [`SpatRasterDataset`] obtained with [region_series()]
#' @param region_series a [`terra::SpatRasterDataset`] obtained with [region_series()]
#' @param nn_interpol boolean determining whether nearest neighbour
#' interpolation is used to estimate climate for cells that lack such
#' information (i.e. they are under water or ice). By default, interpolation is only
Expand Down
2 changes: 1 addition & 1 deletion R/slice_region_series.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' can use `time_bp(x)`.
#' @param time_ce time slice in years CE. Only one of `time_bp` or `time_ce` should
#' be used.
#' @returns a [SpatRaster] of the relevant slice.
#' @returns a [`terra::SpatRaster`] of the relevant slice.
#'
#' @export

Expand Down
2 changes: 1 addition & 1 deletion R/url_is_valid.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ url_is_valid <- function(url, verbose = FALSE) {
if (requireNamespace("httr", quietly = TRUE)) {
HTTP_STATUS_OK <- 200
HTTP_STATUS_REDIRECT_SUCCESS <- 302
hd <- httr::HEAD(url)
hd <- httr::HEAD(url, httr::timeout(30))
status <- hd$all_headers[[1]]$status
if (verbose){
message("status is ",status)
Expand Down
34 changes: 11 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@ install.packages("pastclim")
The version on CRAN is recommended for every day use. New features and
bug fixes appear first on the `dev` branch on GitHub, before they make
their way to CRAN. If you need to have early access to these new
features, you can install `pastclim` directly from GitHub. To install
from GitHub, you will need to use `devtools`; if you haven't done so
already, get it from CRAN with `install.packages("devtools")`. Also,
features, you can install the development version of `pastclim` directly
from GitHub, using `devtools`, or more simply get a compiled version
from r-universe. Also,
note that the `dev` version of `pastclim` tracks changes in the `dev`
version of `terra`, so you will need to upgrade both libraries with:

```
install.packages('terra', repos='https://rspatial.r-universe.dev')
devtools::install_github("EvolEcolGroup/pastclim", ref="dev")
install.packages("pastclim", repos = c("https://evolecolgroup.r-universe.dev")
```

## Overview of functionality
Expand All @@ -55,32 +54,21 @@ updated for the `dev` branch of `pastclim` (on the top left of the dev
website, the version number is in red and in the format x.x.x.9xxx,
indicating it is a development version).

Pastclim currently includes data from Beyer et al 2020 (a reconstruction
`pastclim` currently includes data from Beyer et al 2020 (a reconstruction
of climate based on the HadCM3 model for the last 120k years), Krapp
et al 2021 (which covers the last 800k years with a statistical emulator of HadCM3),
Barreto et al 2023 (covering the last 5M years using the PALEO-PGEM emulator),
and the WorldClim data (present, and future projections with a number of models and
Barreto et al 2023 (covering the last 5M years using the PALEO-PGEM emulator), PaleoClim
(providing a few time steps from different palaeoclimate models downscaled to higher
resolution), CHELSA-Trace21K (a transient
reconstruction of the last 21k years, downscaled to 1km resolution), the HYDE3.3
database of land use reconstructions for the last 10k years,
and the WorldClim and CHELSA data (present, and future projections with a number of models and
emission scenarios). More details on each of these
datasets can be found
[here](https://evolecolgroup.github.io/pastclim/articles/a1_available_datasets.html).
There are also instructions on how to build and use [custom
datasets](https://evolecolgroup.github.io/pastclim/articles/a2_custom_datasets.html).

You can also build the vignettes when installing `pastclim` (note that
you will need to have the necessary tools to build vignettes already
installed; requirements depend on your OS):

```
devtools::install_github("EvolEcolGroup/pastclim", build_vignette = TRUE)
```

If you built the vignettes, you can read them directly in R. For
example, the overview can be obtained with:

```
vignette("pastclim_overview", package = "pastclim")
```

------------------------------------------------------------------------

## When something does not work
Expand Down
30 changes: 16 additions & 14 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
## This is a re-submission
DOI incorrectly started with doi.org/; they have all now been fixed and raised
no issues with any check.
## This is a resubmission
The previous submission raised:
Check: Rd cross-references, Result: NOTE
Found the following Rd file(s) with Rd \link{} targets missing package
anchors:
location_slice_from_region_series.Rd: SpatRasterDataset
slice_region_series.Rd: SpatRaster
Please provide package anchors for all Rd \link{} targets not in the
package itself and the base packages.

Those links have now been fixed with the appropriate package anchors.

## Test environments
- R-hub windows-x86_64-devel (r-devel)
- R-hub ubuntu-gcc-release (r-release)
- R-hub fedora-clang-devel (r-devel)
- R-hub linux (r-devel)
- R-hub macos (r-devel)
- R-hub macos-arm64 (r-devel)
- devtools::check_mac_release
- devtools::check_win_devel

No NOTES on any environment.

## Checks on CRAN for previous version of pastclim
As detailed in:
https://cloud.r-project.org/web/checks/check_results_pastclim.html

there are failures with r-oldrel-macos-arm64 and r-oldrel-macos-x86-64. Old
versions on mac of `terra`, on which `pastclim` relies, were problematic. This
affected other packages as well: https://github.com/r-spatial/stars/issues/566
Pastclim works on r-oldrel-windows-x86-64, as well as on all other release and
devel versions.

There were notes on a r-devel, which picked up a man page where a parameter
was named incorrectly. That has been fixed in the current version.
there are no failures on the previous version (2.0.0)
2 changes: 1 addition & 1 deletion data-raw/helper_functions/submitting_to_cran.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source("./data-raw/helper_functions/check_returns_in_documentation.R")
# update version number
# update news

# first check with rhub
# first check with rhub (TO UPDATE, it now runs on github actions)
pastclim_checks <- rhub::check_for_cran()

# check on macos and windows via devtools
Expand Down
2 changes: 1 addition & 1 deletion man/CHELSA_trace21k_1.0.Rd

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

4 changes: 2 additions & 2 deletions man/HYDE_3.3_baseline.Rd

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

3 changes: 3 additions & 0 deletions man/get_ice_mask.Rd

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

2 changes: 1 addition & 1 deletion man/location_slice_from_region_series.Rd

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

1 change: 1 addition & 0 deletions man/pastclim-package.Rd

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

2 changes: 1 addition & 1 deletion man/slice_region_series.Rd

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

Loading

0 comments on commit 8ae609e

Please sign in to comment.