Skip to content

Commit

Permalink
Merge pull request #666 from olivroy/clean
Browse files Browse the repository at this point in the history
Upkeep
  • Loading branch information
edzer authored Feb 23, 2024
2 parents 20f55f8 + 3a94c17 commit e3bcdb6
Show file tree
Hide file tree
Showing 48 changed files with 123 additions and 121 deletions.
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
# * is a special character in YAML so you have to quote this string
- cron: "0 4 * * 0" # every week

name: rcmdcheck
name: R-CMD-check

jobs:
R-CMD-check:
Expand All @@ -25,13 +25,14 @@ jobs:
- {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'}

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 @@ -40,7 +41,7 @@ jobs:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
extra-repositories: "http://cran.uni-muenster.de/pebesma"
extra-repositories: "https://cran.uni-muenster.de/pebesma"

- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
extra-repositories: "http://cran.uni-muenster.de/pebesma"
extra-repositories: "https://cran.uni-muenster.de/pebesma"

- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand All @@ -42,7 +42,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
6 changes: 3 additions & 3 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

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

- uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -31,7 +31,7 @@ jobs:
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

Expand All @@ -44,7 +44,7 @@ jobs:

- 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
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Suggests:
OpenStreetMap,
PCICt,
RNetCDF (>= 1.8-2),
clue,
clue,
covr,
cubble (>= 0.3.0),
cubelyr,
cubble (>= 0.3.0),
cubelyr,
digest,
dplyr (>= 0.7-0),
exactextractr,
Expand All @@ -70,7 +70,7 @@ Suggests:
ncmeta (>= 0.0.3),
pbapply,
plm,
randomForest,
randomForest,
raster,
rmarkdown,
sp,
Expand Down
18 changes: 9 additions & 9 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@

* handle `normalize_path` for choosing to `proxy`; #391

* ignore units when there are different units accross bands of a subdataset
* ignore units when there are different units across bands of a subdataset

* speed up `st_rgb()` using faster `st_apply()` approach; #315, #390

Expand Down Expand Up @@ -264,13 +264,13 @@

* `st_apply()` and other methods for `stars_proxy` objects handle ... ; #374

* add `st_bbox()`, `st_crs()` methods for terra's `SpatVector` objects; https://github.com/mtennekes/tmap/issues/536
* add `st_bbox()`, `st_crs()` methods for terra's `SpatVector` objects; https://github.com/r-tmap/tmap/issues/536

* add `st_bbox()`, `st_crs()` and `st_as_stars()` methods for terra's `SpatRaster` objects; https://github.com/mtennekes/tmap/issues/536
* add `st_bbox()`, `st_crs()` and `st_as_stars()` methods for terra's `SpatRaster` objects; https://github.com/r-tmap/tmap/issues/536

* allow for multi-resolution attributes in `stars_proxy` objects (e.g., all gray scale sentinel-2 bands); see vignettes 2 and 7 for examples.

* `plot()` defaults to a categorical color scale when plotting a factor variable; https://github.com/mtennekes/tmap/issues/526
* `plot()` defaults to a categorical color scale when plotting a factor variable; https://github.com/r-tmap/tmap/issues/526

* `st_extract()` extracts space-time points if `time_column` is specified, and handles time intervals; #352

Expand Down Expand Up @@ -328,7 +328,7 @@

# version 0.4-3

* fix bug in `st_as_stars.Raster`; set crs to the one assigned by raster; https://github.com/mtennekes/tmap/issues/471
* fix bug in `st_as_stars.Raster`; set crs to the one assigned by raster; https://github.com/r-tmap/tmap/issues/471

* add `s2` to Suggests:

Expand Down Expand Up @@ -358,7 +358,7 @@

* x/y range subsetting of `stars_proxy` objects now only reads that range, similar to how crop already did this.

* `st_warp()` preserves levels and colors; https://github.com/mtennekes/tmap/issues/429
* `st_warp()` preserves levels and colors; https://github.com/r-tmap/tmap/issues/429

* `st_crop()` works with bounding boxes larger than the downsampled bounding box; #276

Expand Down Expand Up @@ -386,7 +386,7 @@

* handle full `crs` objects as `refsys` element in a spatial dimensions, rather than proj4string only

* `st_raster_type(x)` reveals the raster type of `x`; #248, https://github.com/mtennekes/tmap/issues/368
* `st_raster_type(x)` reveals the raster type of `x`; #248, https://github.com/r-tmap/tmap/issues/368

* add `st_as_stars.OpenStreetMap()` method; #241 by @mtennekes

Expand Down Expand Up @@ -474,7 +474,7 @@

* support for `PCICt` 360- and 365-day calendars; #29

* remove import of `ncdf4` in favour of `RNetCDF`, now in line with practice in `ncmeta` package. Thanks to David Blodgett for motivation and testing (see #87, #94).
* remove import of `ncdf4` in favor of `RNetCDF`, now in line with practice in `ncmeta` package. Thanks to David Blodgett for motivation and testing (see #87, #94).

* `st_as_sf` uses date/time column names when appropriate

Expand All @@ -486,7 +486,7 @@

* depend on sf 0.7-2

* add logz support for log-scale keys to `plot` and `image`
* add `logz` support for log-scale keys to `plot` and `image`

# version 0.2-0

Expand Down
16 changes: 8 additions & 8 deletions PROPOSAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ to finish computation within acceptable time? How can we quickly
and easily develop an analysis by testing it on a small portion of
the spatiotemporal datasets, before deploying it on the massive
data set? How can we use pipe-based workflows or dplyr-verbs on such
data sets? How can we visualy explore high-dimensional raster data?
data sets? How can we visually explore high-dimensional raster data?

Today, people use R for large spatiotemporal data, but hit
limits related to usability, user interface, and scalability. The
Expand Down Expand Up @@ -103,17 +103,17 @@ data is distributed.

Relevant work outside R includes

* [GDAL](http://www.gdal.org/), in particular gdal [virtual tiles](http://www.gdal.org/gdalbuildvrt.html) for building arbitrary large grid data sets from many individual files,
* [SciDB](http://www.paradigm4.com/), an open source array database which has no spatial or temporal capabilities, but a strongly scalable architecture, and extremely flexible array manipulation methods
* [GDAL](https://gdal.org/), in particular gdal [virtual tiles](https://gdal.org/programs/gdalbuildvrt.html) for building arbitrary large grid data sets from many individual files,
* [SciDB](https://paradigm4.com/), an open source array database which has no spatial or temporal capabilities, but a strongly scalable architecture, and extremely flexible array manipulation methods
* [SciDB4geo](https://github.com/appelmar/scidb4geo), a SciDB Plugin
for Managing Spatial and Temporal Reference Information of Arrays, and
[SciDB4gdal](https://github.com/appelmar/scidb4geo), a GDAL driver for SciDB arrays, two activities to make SciDB databases aware of space and time
* [PostGIS Raster](http://postgis.net/docs/RT_reference.html), a raster data extension of [PostGIS](http://www.postgis.net/)
* [Rasdaman](http://www.rasdaman.com/), an array database dedicate to images, which is partially open source.
[SciDB4gdal](https://github.com/appelmar/scidb4gdal), a GDAL driver for SciDB arrays, two activities to make SciDB databases aware of space and time
* [PostGIS Raster](https://postgis.net/docs/RT_reference.html), a raster data extension of [PostGIS](https://www.postgis.net/)
* [Rasdaman](https://www.rasdaman.com/), an array database dedicate to images, which is partially open source.

Since there is a definite trend that
[downloading Earth observation data is no longer
feasible](http://r-spatial.org/2016/11/29/openeo.html), we will
feasible](https://r-spatial.org/2016/11/29/openeo.html), we will
have to work towards solutions where the data are accessed over
a web service interface. Cloud services such as AWS are starting
to give access to the large remote sensing imagery archives of e.g.
Expand Down Expand Up @@ -174,4 +174,4 @@ We will use most funding to develop the R package and web service API. Total cos

## Dissemination:

We will regularly post blogs about the project on [r-spatial.org](http://r-spatial.org/), use twitter, post to [r-sig-geo](https://stat.ethz.ch/mailman/listinfo/r-sig-geo), stackoverflow, and communicate through github issues or gitter discussion. The project will live on GitHub, in the [r-spatial](https://github.com/r-spatial/) organisation. We will work under a permissive open source license, probably LGPL-2.1. Pull requests will be encouraged. R consortium blogs will be provided at start and end. Publications in _the R Journal_ and other scientific outlets are foreseen.
We will regularly post blogs about the project on [r-spatial.org](https://r-spatial.org/), use twitter, post to [r-sig-geo](https://stat.ethz.ch/mailman/listinfo/r-sig-geo), stackoverflow, and communicate through github issues or gitter discussion. The project will live on GitHub, in the [r-spatial](https://github.com/r-spatial/) organisation. We will work under a permissive open source license, probably LGPL-2.1. Pull requests will be encouraged. R consortium blogs will be provided at start and end. Publications in _the R Journal_ and other scientific outlets are foreseen.
4 changes: 2 additions & 2 deletions R/datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

#' Monthly Gridded Meteorological Observations
#'
#' These are the monthly observational data used for BCSD downscaling. See: http://gdo-dcp.ucllnl.org/downscaled_cmip_projections/dcpInterface.html#About for more information." ;
#' These are the monthly observational data used for BCSD downscaling. See: <https://gdo-dcp.ucllnl.org/downscaled_cmip_projections/dcpInterface.html#About> for more information." ;
#' "Atmospheric Temperature, Air Temperature Atmosphere, Precipitation, Rain, Maximum Daily Temperature, Minimum Daily Temperature" ;
#'
"bcsd_obs"

#' Sentinel-2 sample tile
#'
#' Sentinel-2 sample tile, downloaded from https://scihub.copernicus.eu/
#' Sentinel-2 sample tile, downloaded from <https://scihub.copernicus.eu/>
#' reads the four 10-m bands: B2 (490 nm), B3 (560 nm), B4 (665 nm) and B8 (842 nm)
"stars_sentinel2"
2 changes: 1 addition & 1 deletion R/mdim.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ mdim_use_bounds = function(dims, x, bnds, center = TRUE) {
#' @param raster names of the raster variables (default: first two dimensions)
#' @param offset integer; offset for each dimension (pixels) of sub-array to read, defaults to 0 for each dimension(requires sf >= 1.0-9)
#' @param count integer; size for each dimension (pixels) of sub-array to read (default: read all); a value of NA will read the corresponding dimension entirely; counts are relative to the step size (requires sf >= 1.0-9)
#' @param step integer; step size for each dimension (pixels) of sub-aray to read; defaults to 1 for each dimension (requires sf >= 1.0-9)
#' @param step integer; step size for each dimension (pixels) of sub-array to read; defaults to 1 for each dimension (requires sf >= 1.0-9)
#' @param proxy logical; return proxy object? (not functional yet)
#' @param debug logical; print debug info?
#' @param bounds logical or character: if \code{TRUE} tries to infer from "bounds" attribute; if character,
Expand Down
2 changes: 1 addition & 1 deletion R/mosaic.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param options character; options to the gdalbuildvrt command
#' @param file_ext character; file extension, determining the format used to write to (".tif" implies GeoTIFF)
#' @return the stars method returns a stars object with the composite of the input; the \code{character} method returns the file name of the file with the mosaic; see also the GDAL documentation of \code{gdalbuildvrt}
#' @details the gdal function buildvrt builds a mosaic of input images; these imput images can be multi-band, but not higher-dimensional data cubes or stars objects with multiple attributes
#' @details the gdal function buildvrt builds a mosaic of input images; these input images can be multi-band, but not higher-dimensional data cubes or stars objects with multiple attributes
#'
#' uses \link[sf]{gdal_utils} to internally call \code{buildvrt}; no executables external to R are called.
#' @export
Expand Down
4 changes: 2 additions & 2 deletions R/ncdf.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' curvilinear coordinates if they are not supplied.
#' @param eps numeric; dimension value increases are considered identical when they differ less than \code{eps}
#' @param ignore_bounds logical; should bounds values for dimensions, if present, be ignored?
#' @param make_time if \code{TRUE} (the default), an atttempt is made to provide a date-time class from the "time" variable
#' @param make_time if \code{TRUE} (the default), an attempt is made to provide a date-time class from the "time" variable
#' @param make_units if \code{TRUE} (the default), an attempt is made to set the units property of each variable
#' @param proxy logical; if \code{TRUE}, an object of class \code{stars_proxy} is read which contains array
#' metadata only; if \code{FALSE} the full array data is read in memory. If not set, defaults to \code{TRUE}
Expand All @@ -45,7 +45,7 @@
#' @details
#' If \code{var} is not set the first set of variables on a shared grid is used.
#'
#' \code{start} and \code{count} columns of ncsub must correspond to the variable dimemsion (nrows)
#' \code{start} and \code{count} columns of ncsub must correspond to the variable dimension (nrows)
#' and be valid index using \code{\link[RNetCDF]{var.get.nc}} convention (start is 1-based). If the count value
#' is \code{NA} then all steps are included. Axis order must match that of the variable/s being read.
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ kw_dflt = function(x, key.pos) {
#' @param breaks numeric vector with actual color breaks, or a \code{style} name used in \link[classInt]{classIntervals}.
#' @param col colors to use for grid cells, or color palette function
#' @param ... further arguments: for \code{plot}, passed on to \code{image.stars}; for \code{image}, passed on to \code{image.default} or \code{rasterImage}.
#' @param key.pos numeric; side to plot a color key: 1 bottom, 2 left, 3 top, 4 right; set to \code{NULL} to omit key. Ignored if multiple columns are plotted in a single function call. Default depends on plot size, map aspect, and, if set, parameter \code{asp}. If it has lenght 2, the second value, ranging from 0 to 1, determines where the key is placed in the available space (default: 0.5, center).
#' @param key.pos numeric; side to plot a color key: 1 bottom, 2 left, 3 top, 4 right; set to \code{NULL} to omit key. Ignored if multiple columns are plotted in a single function call. Default depends on plot size, map aspect, and, if set, parameter \code{asp}. If it has length 2, the second value, ranging from 0 to 1, determines where the key is placed in the available space (default: 0.5, center).
#' @param key.width amount of space reserved for width of the key (labels); relative or absolute (using lcm)
#' @param key.length amount of space reserved for length of the key (labels); relative or absolute (using lcm)
#' @param key.lab character; label for color key in case of multiple subplots, use \code{""} to suppress
Expand Down
2 changes: 1 addition & 1 deletion R/proxy.R
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ st_as_stars.stars_proxy = function(.x, ..., downsample = 0, url = attr(.x, "url"
ret # nocov end
} else {
cl = attr(.x, "call_list")
# FIXME: this means we ALLWAYS process after (possibly partial) reading;
# FIXME: this means we ALWAYS process after (possibly partial) reading;
# there are cases where this is not right. Hence:
# TODO: only warn when there is a reason to warn.
if (!all(downsample == 0))
Expand Down
2 changes: 1 addition & 1 deletion R/stars.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pretty_cut = function(lim, n, inside = FALSE, ...) {
#' @param values value(s) to populate the raster values with
#' @param n the (approximate) target number of grid cells
#' @param pretty logical; should cell coordinates have \link{pretty} values?
#' @param inside logical; should all cells entirely fall inside the bbox, potentially not covering it completely (\code{TRUE}), or allways cover the bbox (\code{FALSE}), or find a good approximation (\code{NA}, default)?
#' @param inside logical; should all cells entirely fall inside the bbox, potentially not covering it completely (\code{TRUE}), or always cover the bbox (\code{FALSE}), or find a good approximation (\code{NA}, default)?
#' @param proxy logical; should a \code{stars_proxy} object be created? (requires gdal_create binary when sf < 1.0-6)
#' @details For the \code{bbox} method: if \code{pretty} is \code{TRUE}, raster cells may extend the coordinate range of \code{.x} on all sides. If in addition to \code{nx} and \code{ny}, \code{dx} and \code{dy} are also missing, these are set to a single value computed as \code{sqrt(diff(xlim)*diff(ylim)/n)}.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/warp.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ default_target_grid = function(x, crs, cellsize = NA_real_, segments = NA) {
envelope = if (!is.na(segments) && !has_global_longitude(x)) # FIXME: should this branch be retained?
st_segmentize(envelope, st_length(st_cast(envelope, "LINESTRING"))/segments)
else {
# https://github.com/mtennekes/tmap/issues/526 :
# https://github.com/r-tmap/tmap/issues/526 :
old_crs = st_crs(envelope)
st_crs(envelope) = NA_crs_
st_set_crs(st_segmentize(envelope, st_length(st_cast(envelope, "LINESTRING"))/segments), old_crs)
Expand Down
Loading

0 comments on commit e3bcdb6

Please sign in to comment.