Skip to content

Commit

Permalink
remove-defaults-for-server
Browse files Browse the repository at this point in the history
  • Loading branch information
kauedesousa committed Jan 13, 2022
1 parent f07121e commit aa094c5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ chirps 0.1.4 (2022-01-13)

### CHANGES IN BEHAVIOUR

* New argument `server = ` is added to indicate from which server the function should send the request, either 'CHC' or 'ClimateSERV'. Please use the argument `server = "ClimateSERV"` for backward compatibility with previous versions of the package.
* API requests to ClimateSERV use package httr instead of curl
* A new argument `server = ` is added to `get_chirps()` to indicate from which server the data will be requested. Options are 'CHC' the default and 'ClimateSERV'
* Argument `operation = ` in `get_chirps()` is removed from the main Usage and is only required when `server = "ClimateSERV"`
* Argument `operation = ` in `get_chirps()` is only required when `server = "ClimateSERV"`
* Updates function `as.geojson()` to matches with the new requirements for ClimateSERV

chirps 0.1.3 (2021-07-10)
Expand Down
10 changes: 5 additions & 5 deletions R/get_chirps.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' \code{\link[terra]{SpatRaster}}, \code{\link[sf]{sf}} or \code{geojson}
#' @param dates a character of start and end dates in that order in the format
#' "YYYY-MM-DD"
#' @param server a character that represent the server source "CHC" (default) or
#' @param server a character that represent the server source "CHC" or
#' "ClimateSERV"
#' @param as.sf logical, returns an object of class \code{\link[sf]{sf}}
#' @param as.geojson logical, returns an object of class \code{geojson}
Expand Down Expand Up @@ -90,7 +90,7 @@
#' @importFrom sf st_centroid read_sf st_geometry_type
#' @importFrom terra crop extract rast
#' @export
get_chirps <- function(object, dates, server = "CHC", ...) {
get_chirps <- function(object, dates, server, ...) {

if (isFALSE(any(server %in% c("CHC", "ClimateSERV")))) {
stop("Unknown server, please choose 'CHC' or 'ClimateSERV' \n")
Expand All @@ -102,7 +102,7 @@ get_chirps <- function(object, dates, server = "CHC", ...) {

#' @rdname get_chirps
#' @export
get_chirps.default <- function(object, dates, server = "CHC",
get_chirps.default <- function(object, dates, server,
as.matrix = FALSE, ...) {


Expand Down Expand Up @@ -273,7 +273,7 @@ get_chirps.SpatRaster <- function(object, dates, server = "CHC",
#' @rdname get_chirps
#' @method get_chirps sf
#' @export
get_chirps.sf <- function(object, dates, server = "CHC",
get_chirps.sf <- function(object, dates, server,
as.sf = FALSE,
...) {

Expand Down Expand Up @@ -411,7 +411,7 @@ get_chirps.sf <- function(object, dates, server = "CHC",
#' @rdname get_chirps
#' @method get_chirps geojson
#' @export
get_chirps.geojson <- function(object, dates, server = "CHC",
get_chirps.geojson <- function(object, dates, server,
as.geojson = FALSE,
...) {

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ lonlat <- data.frame(lon = c(-55.0281,-54.9857, -55.0714),

dates <- c("2017-01-01", "2017-12-31")

dat <- get_chirps(lonlat, dates)
dat <- get_chirps(lonlat, dates, server = "CHC")

```

Expand Down
10 changes: 5 additions & 5 deletions man/get_chirps.Rd

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

0 comments on commit aa094c5

Please sign in to comment.