From 749fe35f71b9a9f6c07214a8384fbc1a0581c5a9 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 29 Aug 2021 21:17:14 +0800 Subject: [PATCH 01/93] Should fix NOTE when running pkg checks --- R/get_chirts.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/get_chirts.R b/R/get_chirts.R index 94b67cb..36daa1c 100644 --- a/R/get_chirts.R +++ b/R/get_chirts.R @@ -71,7 +71,7 @@ get_chirts.default <- function(object, dates, var, as.matrix = FALSE, ...){ .validate_lonlat(object, xlim = c(-180, 180), ylim = c(-60, 70)) # get CHIRTS GeoTiff files - rr <- chirps:::.get_CHIRTS_tiles_CHC(dates, var, ...) + rr <- .get_CHIRTS_tiles_CHC(dates, var, ...) if (isTRUE(as.raster)) { result <- terra::crop(rr, y = object) From e4aace444a7370248db6bc2ae334c64fdc9a411d Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 29 Aug 2021 21:35:43 +0800 Subject: [PATCH 02/93] Don't deploy pkgdown --- .github/workflows/tic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml index 69043e6..9bd8787 100644 --- a/.github/workflows/tic.yml +++ b/.github/workflows/tic.yml @@ -23,7 +23,7 @@ jobs: config: # use a different tic template type if you do not want to build on all listed platforms - { os: windows-latest, r: "release" } - - { os: macOS-latest, r: "release", pkgdown: "true", latex: "true" } + - { os: macOS-latest, r: "release", pkgdown: "false", latex: "true" } - { os: ubuntu-latest, r: "devel" } - { os: ubuntu-latest, r: "release" } From 1cf77297e221a35580118f9ed433c251eacffb2c Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 29 Aug 2021 21:52:50 +0800 Subject: [PATCH 03/93] Remove deprecated `context()` from tests --- tests/testthat/test-get_chirps.R | 2 -- tests/testthat/test-get_esi.R | 2 -- tests/testthat/test-precip_indices.R | 2 -- 3 files changed, 6 deletions(-) diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index 4caf4eb..bfc3a66 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -1,5 +1,3 @@ -context("test-get_chirps") - # load("tests/test_data.rda") load("../test_data.rda") diff --git a/tests/testthat/test-get_esi.R b/tests/testthat/test-get_esi.R index 9abbb12..3523ac6 100644 --- a/tests/testthat/test-get_esi.R +++ b/tests/testthat/test-get_esi.R @@ -1,5 +1,3 @@ -context("test-get_esi") - # load("tests/test_data.rda") load("../test_data.rda") diff --git a/tests/testthat/test-precip_indices.R b/tests/testthat/test-precip_indices.R index f3fa5a7..db16166 100644 --- a/tests/testthat/test-precip_indices.R +++ b/tests/testthat/test-precip_indices.R @@ -1,5 +1,3 @@ -context("test-precip_indices") - # load("tests/test_data.rda") load("../test_data.rda") From 800ba7075c1e6212019d11658f0481e19713c364 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Wed, 15 Sep 2021 14:13:04 +0800 Subject: [PATCH 04/93] Fixes bug where only data of >3 days can be requested --- R/internal_functions.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/internal_functions.R b/R/internal_functions.R index 1c942e8..7ba91f5 100644 --- a/R/internal_functions.R +++ b/R/internal_functions.R @@ -300,7 +300,7 @@ } # last given date should be higher than first - cond1 <- as.integer(xmax - xmin) > 1 + cond1 <- as.integer(xmax - xmin) >= 0 # no older than past date cond2 <- xmin > past From a638ad076638fb6c3761b82f85eafeef6d12c3be Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 09:25:36 +0800 Subject: [PATCH 05/93] Use vcr >= 0.6.0 and update RoxygenNote --- DESCRIPTION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c99dcc3..35e9d42 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -45,7 +45,7 @@ Suggests: markdown, rmarkdown, testthat (>= 2.1.0), - vcr (>= 0.5) + vcr (>= 0.6.0) Language: en-GB -RoxygenNote: 7.1.1.9001 +RoxygenNote: 7.1.2 VignetteBuilder: knitr From f421dab51e2632d074fb0f29660cebbf267761ea Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 09:56:01 +0800 Subject: [PATCH 06/93] Remove full stop from function title --- R/precip_indices.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/precip_indices.R b/R/precip_indices.R index a428aae..74015f5 100644 --- a/R/precip_indices.R +++ b/R/precip_indices.R @@ -1,4 +1,4 @@ -#' Compute precipitation indices over a time series. +#' Compute precipitation indices over a time series #' #' @param object an object of class \code{chirps} as provided by #' \code{\link{get_chirps}} From c948108d033c95095adedfcb6e54f9e4abcc6a4c Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 09:56:18 +0800 Subject: [PATCH 07/93] Formatting code and documentation --- R/precip_indices.R | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/R/precip_indices.R b/R/precip_indices.R index 74015f5..b2ecb8c 100644 --- a/R/precip_indices.R +++ b/R/precip_indices.R @@ -6,7 +6,7 @@ #' observation or \code{TRUE} for a time series based on \var{intervals} #' @param intervals integer no lower than 5, for the days intervals when #' \var{timeseries} = \code{TRUE} -#' @return A dataframe with precipitation indices: +#' @return A data frame with precipitation indices: #' \item{MLDS}{maximum length of consecutive dry day, rain < 1 mm (days)} #' \item{MLWS}{maximum length of consecutive wet days, rain >= 1 mm (days)} #' \item{R10mm}{number of heavy precipitation days 10 >= rain < 20 mm (days)} @@ -310,8 +310,7 @@ precip_indices <- function(object, timeseries = FALSE, intervals = NULL) { r5day <- NULL - for (i in 1:(l-4)){ - + for (i in 1:(l - 4)) { r5day <- cbind(r5day, sum(object[i:(i + 4)], na.rm = TRUE)) } From d76d80f3e5da03adc158fba32152399a43479c0f Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 09:56:58 +0800 Subject: [PATCH 08/93] Removes vcr --- DESCRIPTION | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 35e9d42..f179d97 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -44,8 +44,7 @@ Suggests: knitr, markdown, rmarkdown, - testthat (>= 2.1.0), - vcr (>= 0.6.0) + testthat (>= 2.1.0) Language: en-GB RoxygenNote: 7.1.2 VignetteBuilder: knitr From 9bbbde69516b7f46f5920cbc3899598d9603c64a Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 09:57:16 +0800 Subject: [PATCH 09/93] Formatting in documentation --- R/get_esi.R | 18 +++++++++--------- man/get_esi.Rd | 14 +++++++------- man/precip_indices.Rd | 6 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/R/get_esi.R b/R/get_esi.R index 118fa0e..62da950 100644 --- a/R/get_esi.R +++ b/R/get_esi.R @@ -4,16 +4,16 @@ #' via ClimateSERV \acronym{API} Client. \acronym{ESI} is available every four #' (or twelve) weeks from 2001 to present. #' The dataset may contain cloudy data which is returned as \code{NA}s. -#' ClimateSERV works with geojson of type 'Polygon'. The input \code{object} is -#' then transformed into polygons with a small buffer area around the point. +#' ClimateSERV works with 'geojson' of type 'Polygon'. The input \code{object} +#' is then transformed into polygons with a small buffer area around the point. #' #' @inheritParams get_chirps -#' @param period an integer value for the period of ESI data, -#' four weeks period = 1, twelve weeks = 2 +#' @param period an integer value for the period of ESI data, four weeks +#' period = 1, twelve weeks = 2 #' @param operation optional, an integer that represents which type of #' statistical operation to perform on the dataset #' @details -#' \bold{operation}: supported operations are: +#' \bold{operation}: supported operations are: #' \tabular{rll}{ #' \bold{operation} \tab \tab \bold{value}\cr #' max \tab = \tab 0\cr @@ -34,8 +34,8 @@ #' \item{lat}{the latitude as provided in \code{object}} #' \item{esi}{the ESI value} #' -#' @note get_esi may return some warning messages given by -#' \code{\link[sf]{sf}}, please look sf documentation for +#' @note \code{get_esi()} may return some warning messages given by +#' \code{\link[sf]{sf}}, please check the \CRANpkg{sf} documentation for #' possible issues. #' #' @examplesIf interactive() @@ -259,7 +259,7 @@ get_esi.geojson <- function(object, dates, operation = 5, period = 1, if (all(grepl(type[[1]], object))) { # get matrix with lonlat to validate later - lonlat <- lapply(object, function (x) { + lonlat <- lapply(object, function(x) { # read as sf x <- sf::read_sf(x) @@ -287,7 +287,7 @@ get_esi.geojson <- function(object, dates, operation = 5, period = 1, # take the centroid from geojson Polygons # to validate lonlat coordinates - lonlat <- lapply(object, function (x) { + lonlat <- lapply(object, function(x) { x <- sf::read_sf(x) diff --git a/man/get_esi.Rd b/man/get_esi.Rd index c99e0b6..f9c15cc 100644 --- a/man/get_esi.Rd +++ b/man/get_esi.Rd @@ -26,8 +26,8 @@ any other object that can be coerced to data.frame), \code{\link[terra]{SpatVect \item{operation}{optional, an integer that represents which type of statistical operation to perform on the dataset} -\item{period}{an integer value for the period of ESI data, -four weeks period = 1, twelve weeks = 2} +\item{period}{an integer value for the period of ESI data, four weeks +period = 1, twelve weeks = 2} \item{...}{further arguments passed to \code{\link[terra]{terra}} or \code{\link[sf]{sf}} methods @@ -50,11 +50,11 @@ Get evaporative stress index (\acronym{ESI}) from \acronym{SERVIR} Global via ClimateSERV \acronym{API} Client. \acronym{ESI} is available every four (or twelve) weeks from 2001 to present. The dataset may contain cloudy data which is returned as \code{NA}s. -ClimateSERV works with geojson of type 'Polygon'. The input \code{object} is - then transformed into polygons with a small buffer area around the point. +ClimateSERV works with 'geojson' of type 'Polygon'. The input \code{object} + is then transformed into polygons with a small buffer area around the point. } \details{ -\bold{operation}: supported operations are: +\bold{operation}: supported operations are: \tabular{rll}{ \bold{operation} \tab \tab \bold{value}\cr max \tab = \tab 0\cr @@ -69,8 +69,8 @@ ClimateSERV works with geojson of type 'Polygon'. The input \code{object} is \bold{nQuadSegs}: integer, number of segments per buffer quadrant } \note{ -get_esi may return some warning messages given by -\code{\link[sf]{sf}}, please look sf documentation for +\code{get_esi()} may return some warning messages given by +\code{\link[sf]{sf}}, please check the \CRANpkg{sf} documentation for possible issues. } \examples{ diff --git a/man/precip_indices.Rd b/man/precip_indices.Rd index 4511ba0..bbb087e 100644 --- a/man/precip_indices.Rd +++ b/man/precip_indices.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/precip_indices.R \name{precip_indices} \alias{precip_indices} -\title{Compute precipitation indices over a time series.} +\title{Compute precipitation indices over a time series} \usage{ precip_indices(object, timeseries = FALSE, intervals = NULL) } @@ -17,7 +17,7 @@ observation or \code{TRUE} for a time series based on \var{intervals}} \var{timeseries} = \code{TRUE}} } \value{ -A dataframe with precipitation indices: +A data frame with precipitation indices: \item{MLDS}{maximum length of consecutive dry day, rain < 1 mm (days)} \item{MLWS}{maximum length of consecutive wet days, rain >= 1 mm (days)} \item{R10mm}{number of heavy precipitation days 10 >= rain < 20 mm (days)} @@ -31,7 +31,7 @@ A dataframe with precipitation indices: number of wet days (mm/days)} } \description{ -Compute precipitation indices over a time series. +Compute precipitation indices over a time series } \examples{ \dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} From 016c346a117280e84bd457fd7c1bda989c54cad5 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 09:58:07 +0800 Subject: [PATCH 10/93] Remove vcr capabilities --- .../fixtures/vcr_cassettes/default_method.yml | 2275 ----------------- .../fixtures/vcr_cassettes/geojson_method.yml | 2275 ----------------- tests/fixtures/vcr_cassettes/get_esi.yml | 2257 ---------------- tests/fixtures/vcr_cassettes/sf_method.yml | 2275 ----------------- tests/testthat/helper-chirps.R | 2 - tests/testthat/test-get_chirps.R | 61 +- tests/testthat/test-get_esi.R | 23 +- 7 files changed, 23 insertions(+), 9145 deletions(-) delete mode 100644 tests/fixtures/vcr_cassettes/default_method.yml delete mode 100644 tests/fixtures/vcr_cassettes/geojson_method.yml delete mode 100644 tests/fixtures/vcr_cassettes/get_esi.yml delete mode 100644 tests/fixtures/vcr_cassettes/sf_method.yml delete mode 100644 tests/testthat/helper-chirps.R diff --git a/tests/fixtures/vcr_cassettes/default_method.yml b/tests/fixtures/vcr_cassettes/default_method.yml deleted file mode 100644 index cff2083..0000000 --- a/tests/fixtures/vcr_cassettes/default_method.yml +++ /dev/null @@ -1,2275 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:11 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=0&begintime=01%2F01%2F2000&endtime=01%2F05%2F2000&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:12 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["d0dc6842-5d86-4c3a-97f0-d7ff51de34a8"]) - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:13 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=0&begintime=01%2F01%2F2000&endtime=01%2F05%2F2000&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:14 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["aa15ca8d-8ec7-4498-b9bf-f9febcfd9e94"]) - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Fri, 28 Feb 2020 22:15:14 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '72338' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string: "\n\n\n\n \n \n - \ AttributeError at /getDataRequestProgress/\n \n \n \n - \ \n\n\n
\n

AttributeError at /getDataRequestProgress/

\n - \
'MultiValueDictKeyError' object has
-        no attribute 'errno'
\n \n\n \n - \ \n \n \n \n - \ \n \n - \ \n\n \n \n \n - \ \n\n \n \n \n - \ \n\n\n \n \n \n \n\n\n \n - \ \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n - \ \n \n \n \n \n
Request Method:GET
Request URL:https://climateserv.servirglobal.net/chirps/getDataRequestProgress/
Django Version:1.11
Exception Type:AttributeError
Exception Value:
'MultiValueDictKeyError'
-        object has no attribute 'errno'
Exception Location:/data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress, line 765
Python - Executable:/usr/bin/python
Python - Version:2.7.12
Python - Path:
['/data/data/cserv/pythonCode/servirchirpsdjango',\n
-        '/usr/lib/python2.7',\n '/usr/lib/python2.7/plat-x86_64-linux-gnu',\n
-        '/usr/lib/python2.7/lib-tk',\n '/usr/lib/python2.7/lib-old',\n
-        '/usr/lib/python2.7/lib-dynload',\n '/usr/local/lib/python2.7/dist-packages',\n
-        '/usr/lib/python2.7/dist-packages',\n '/data/data/cserv/pythonCode/serviringest']
Server time:Fri, 28 Feb 2020 - 16:15:14 -0600
\n
\n\n\n\n\n
\n - \

Traceback \n - \ Switch to copy-and-paste view\n

\n \n
\n - \
    \n \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py - in inner\n\n \n
    \n - \ \n
      \n - \ \n
    1.     This decorator is automatically applied
      -        to all middleware to ensure that
    2. \n \n
    3.     no
      -        middleware leaks an exception and that the next middleware in the stack
    4. \n - \ \n
    5.     can rely on getting a response instead of
      -        an exception.
    6. \n \n
    7.     """
    8. \n \n - \
    9. -        \   @wraps(get_response, assigned=available_attrs(get_response))
    10. \n - \ \n
    11.     def inner(request):
    12. \n \n - \
    13. -        \       try:
    14. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         except Exception as exc:
    2. \n - \ \n
    3.             response = response_for_exception(request,
      -        exc)
    4. \n \n
    5.         return response
    6. \n \n - \
    7. -        \   return inner
    8. \n \n
    9. \n \n
    10. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    exc
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    get_response
    <bound method WSGIHandler._legacy_get_response
    -        of <django.core.handlers.wsgi.WSGIHandler object at 0x7ff4283b19d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _legacy_get_response\n\n \n
    \n \n
      \n \n
    1.         #
      -        Apply request middleware
    2. \n \n
    3.         for
      -        middleware_method in self._request_middleware:
    4. \n \n - \
    5. -        \           response = middleware_method(request)
    6. \n \n - \
    7. -        \           if response:
    8. \n \n
    9.                 break
    10. \n - \ \n
    11. \n \n
    12.         if
      -        response is None:
    13. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = self._get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         return response
    2. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    middleware_method
    <bound method MessageMiddleware.process_request
    -        of <django.contrib.messages.middleware.MessageMiddleware object at 0x7ff427a933d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    \n \n
  • \n - \ \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.                 break
    2. \n - \ \n
    3. \n \n
    4.         if
      -        response is None:
    5. \n \n
    6.             wrapped_callback = self.make_view_atomic(callback)
    7. \n - \ \n
    8.             try:
    9. \n \n - \
    10. -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
    11. \n - \ \n
    12.             except Exception as e:
    13. \n - \ \n
    \n \n
      \n
    1. \n                response = self.process_exception_by_middleware(e,
      -        request)
      ...
    \n \n
      \n \n - \
    1. \n - \ \n
    2.         # Complain if the view returned None
      -        (a common error).
    3. \n \n
    4.         if response is None:
    5. \n \n - \
    6. -        \           if isinstance(callback, types.FunctionType):    # FBV
    7. \n - \ \n
    8.                 view_name = callback.__name__
    9. \n - \ \n
    10.             else:                                           #
      -        CBV
    11. \n \n
    \n \n - \
    \n \n\n \n
    \n - \ \n Local vars\n \n - \
    \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7ff411a82050>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7ff427a8de10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7ff411a82050>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.             response
      -        = middleware_method(request, callback, callback_args, callback_kwargs)
    2. \n - \ \n
    3.             if response:
    4. \n \n - \
    5. -        \               break
    6. \n \n
    7. \n - \ \n
    8.         if response is None:
    9. \n \n - \
    10. -        \           wrapped_callback = self.make_view_atomic(callback)
    11. \n - \ \n
    12.             try:
    13. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
      - ...
    \n \n
      \n \n
    1.             except
      -        Exception as e:
    2. \n \n
    3.                 response = self.process_exception_by_middleware(e,
      -        request)
    4. \n \n
    5. \n \n
    6.         #
      -        Complain if the view returned None (a common error).
    7. \n \n - \
    8. -        \       if response is None:
    9. \n \n
    10.             if
      -        isinstance(callback, types.FunctionType):    # FBV
    11. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7ff411a82050>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7ff427a8de10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7ff411a82050>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py - in wrapped_view\n\n \n
    \n \n
      \n \n
    1.     """
    2. \n - \ \n
    3.     Marks a view function as being exempt from
      -        the CSRF view protection.
    4. \n \n
    5.     """
    6. \n - \ \n
    7.     # We could just do view_func.csrf_exempt
      -        = True, but decorators
    8. \n \n
    9.     #
      -        are nicer if they don't have side-effects, so we return a new
    10. \n - \ \n
    11.     # function.
    12. \n \n - \
    13. -        \   def wrapped_view(*args, **kwargs):
    14. \n \n
    \n - \ \n
      \n
    1. \n        return
      -        view_func(*args, **kwargs)
      ...
    \n \n - \
      \n - \ \n
    1.     wrapped_view.csrf_exempt = True
    2. \n - \ \n
    3.     return wraps(view_func, assigned=available_attrs(view_func))(wrapped_view)
    4. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    args
    (<WSGIRequest: GET '/chirps/getDataRequestProgress/'>,)
    kwargs
    {}
    view_func
    <function getDataRequestProgress
    -        at 0x7ff411a7df50>
    \n \n
  • \n - \ \n \n
  • \n /data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress\n\n \n
    \n \n
      \n \n
    1.         if
      -        (progress == -1.0):
    2. \n \n
    3.             logger.warn("Problem with getDataRequestProgress:
      -        " + str(request))
    4. \n \n
    5.             return
      -        processCallBack(request, json.dumps([-1]), "application/json")
    6. \n - \ \n
    7.         else:
    8. \n \n - \
    9. -        \           return processCallBack(request, json.dumps([progress]), "application/json")
    10. \n - \ \n
    11.         ## return processCallBack(request,json.dumps([jsonresults['progress']]),"application/json")
    12. \n - \ \n
    13.     except Exception as e:
    14. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \       logger.warn("Problem with getDataRequestProgress: " + str(request)
      -        + " " + str(e.errno) + " " + str(e.strerror))
      ...
    \n - \ \n
      \n - \ \n
    1.         return processCallBack(request, json.dumps([-1]),
      -        "application/json")
    2. \n \n
    3. \n - \ \n
    4. \n \n
    5. @csrf_exempt
    6. \n - \ \n
    7. def getDataFromRequest(request):
    8. \n - \ \n
    9.     '''
    10. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    e
    MultiValueDictKeyError("'id'",)
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n
\n
\n \n
\n\n
\n \n - \ \n \n \n - \ \n

\n \n
\n
\n
\n\n\n\n
\n

Request information

\n\n\n \n

USER

\n - \

AnonymousUser

\n \n\n

GET

\n \n

No - GET data

\n \n\n

POST

\n \n

No POST data

\n - \ \n

FILES

\n \n

No FILES data

\n \n\n\n - \

COOKIES

\n \n

No cookie data

\n \n\n - \

META

\n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n
VariableValue
CONTEXT_DOCUMENT_ROOT
'/data/data/cserv/www/html'
CONTEXT_PREFIX
''
DOCUMENT_ROOT
'/data/data/cserv/www/html'
GATEWAY_INTERFACE
'CGI/1.1'
HTTP_ACCEPT
'application/json,
-        text/xml, application/xml, */*'
HTTP_ACCEPT_ENCODING
'gzip,
-        deflate'
HTTP_HOST
'climateserv.servirglobal.net'
HTTP_USER_AGENT
'libcurl/7.64.1 r-curl/4.3 crul/0.9.0'
PATH_INFO
u'/getDataRequestProgress/'
PATH_TRANSLATED
'/data/data/cserv/www/html/getDataRequestProgress/'
QUERY_STRING
''
REMOTE_ADDR
'122.199.27.9'
REMOTE_PORT
'34979'
REQUEST_METHOD
'GET'
REQUEST_SCHEME
'https'
REQUEST_URI
'/chirps/getDataRequestProgress/'
SCRIPT_FILENAME
'/data/data/cserv/pythonCode/servirchirpsdjango/servirchirpsdjango/wsgi.py'
SCRIPT_NAME
u'/chirps'
SERVER_ADDR
'10.5.5.21'
SERVER_ADMIN
'root@localhost'
SERVER_NAME
'climateserv.servirglobal.net'
SERVER_PORT
'443'
SERVER_PROTOCOL
'HTTP/1.1'
SERVER_SIGNATURE
'<address>Apache/2.4.18 (Ubuntu)
-        Server at climateserv.servirglobal.net Port 443</address>\\n'
SERVER_SOFTWARE
'Apache/2.4.18 (Ubuntu)'
SSL_TLS_SNI
'climateserv.servirglobal.net'
apache.version
(2,
-        4, 18)
mod_wsgi.application_group
'climateserv.servirglobal.net|/chirps'
mod_wsgi.callable_object
'application'
mod_wsgi.enable_sendfile
'0'
mod_wsgi.handler_script
''
mod_wsgi.input_chunked
'0'
mod_wsgi.listener_host
''
mod_wsgi.listener_port
'443'
mod_wsgi.process_group
''
mod_wsgi.request_handler
'wsgi-script'
mod_wsgi.request_start
'1582928114782779'
mod_wsgi.script_reloading
'1'
mod_wsgi.script_start
'1582928114783015'
mod_wsgi.version
(4,
-        3, 0)
wsgi.errors
<mod_wsgi.Log object at 0x7ff40db859c0>
wsgi.file_wrapper
''
wsgi.input
<mod_wsgi.Input
-        object at 0x7ff40ec44bb0>
wsgi.multiprocess
True
wsgi.multithread
False
wsgi.run_once
False
wsgi.url_scheme
'https'
wsgi.version
(1,
-        0)
\n\n\n

Settings

\n

Using settings module servirchirpsdjango.settings

\n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \
SettingValue
ABSOLUTE_URL_OVERRIDES
{}
ADMINS
()
ALLOWED_HOSTS
['*']
APPEND_SLASH
True
AUTHENTICATION_BACKENDS
[u'django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS
u'********************'
AUTH_USER_MODEL
u'auth.User'
BASE_DIR
'/data/data/cserv/pythonCode/servirchirpsdjango'
CACHES
{u'default': {u'BACKEND': u'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS
u'default'
CACHE_MIDDLEWARE_KEY_PREFIX
u'********************'
CACHE_MIDDLEWARE_SECONDS
600
CORS_ORIGIN_ALLOW_ALL
True
CORS_ORIGIN_WHITELIST
('54.172.93.198',)
CSRF_COOKIE_AGE
31449600
CSRF_COOKIE_DOMAIN
None
CSRF_COOKIE_HTTPONLY
False
CSRF_COOKIE_NAME
u'csrftoken'
CSRF_COOKIE_PATH
u'/'
CSRF_COOKIE_SECURE
False
CSRF_FAILURE_VIEW
u'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME
u'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS
[]
CSRF_USE_SESSIONS
False
DATABASES
{'default': {'ATOMIC_REQUESTS': False,\n
-        \            'AUTOCOMMIT': True,\n             'CONN_MAX_AGE':
-        0,\n             'ENGINE': 'django.db.backends.sqlite3',\n
-        \            'HOST': '',\n             'NAME': '/data/data/cserv/pythonCode/servirchirpsdjango/sqlite.db',\n
-        \            'OPTIONS': {},\n             'PASSWORD': u'********************',\n
-        \            'PORT': '',\n             'TEST': {'CHARSET':
-        None,\n                      'COLLATION': None,\n                      'MIRROR':
-        None,\n                      'NAME': None},\n             'TIME_ZONE':
-        None,\n             'USER': ''}}
DATABASE_ROUTERS
[]
DATA_UPLOAD_MAX_MEMORY_SIZE
2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS
1000
DATETIME_FORMAT
u'N
-        j, Y, P'
DATETIME_INPUT_FORMATS
[u'%Y-%m-%d %H:%M:%S',\n u'%Y-%m-%d
-        %H:%M:%S.%f',\n u'%Y-%m-%d %H:%M',\n u'%Y-%m-%d',\n u'%m/%d/%Y
-        %H:%M:%S',\n u'%m/%d/%Y %H:%M:%S.%f',\n u'%m/%d/%Y %H:%M',\n
-        u'%m/%d/%Y',\n u'%m/%d/%y %H:%M:%S',\n u'%m/%d/%y %H:%M:%S.%f',\n
-        u'%m/%d/%y %H:%M',\n u'%m/%d/%y']
DATE_FORMAT
u'N
-        j, Y'
DATE_INPUT_FORMATS
[u'%Y-%m-%d',\n u'%m/%d/%Y',\n
-        u'%m/%d/%y',\n u'%b %d %Y',\n u'%b %d, %Y',\n u'%d
-        %b %Y',\n u'%d %b, %Y',\n u'%B %d %Y',\n u'%B %d,
-        %Y',\n u'%d %B %Y',\n u'%d %B, %Y']
DEBUG
True
DEBUG_PROPAGATE_EXCEPTIONS
False
DECIMAL_SEPARATOR
u'.'
DEFAULT_CHARSET
u'utf-8'
DEFAULT_CONTENT_TYPE
u'text/html'
DEFAULT_EXCEPTION_REPORTER_FILTER
u'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE
u'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL
u'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE
u''
DEFAULT_TABLESPACE
u''
DISALLOWED_USER_AGENTS
[]
EMAIL_BACKEND
u'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST
u'localhost'
EMAIL_HOST_PASSWORD
u'********************'
EMAIL_HOST_USER
u''
EMAIL_PORT
25
EMAIL_SSL_CERTFILE
None
EMAIL_SSL_KEYFILE
u'********************'
EMAIL_SUBJECT_PREFIX
u'[Django] '
EMAIL_TIMEOUT
None
EMAIL_USE_LOCALTIME
False
EMAIL_USE_SSL
False
EMAIL_USE_TLS
False
FILE_CHARSET
u'utf-8'
FILE_UPLOAD_DIRECTORY_PERMISSIONS
None
FILE_UPLOAD_HANDLERS
[u'django.core.files.uploadhandler.MemoryFileUploadHandler',\n
-        u'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
FILE_UPLOAD_PERMISSIONS
None
FILE_UPLOAD_TEMP_DIR
None
FIRST_DAY_OF_WEEK
0
FIXTURE_DIRS
[]
FORCE_SCRIPT_NAME
None
FORMAT_MODULE_PATH
None
FORM_RENDERER
u'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS
[]
INSTALLED_APPS
['polls',\n
-        'django.contrib.auth',\n 'django.contrib.contenttypes',\n
-        'django.contrib.sessions',\n 'django.contrib.sites',\n 'django.contrib.messages',\n
-        'django.contrib.staticfiles',\n 'servirchirps',\n 'corsheaders',\n
-        'django.contrib.admin',\n 'django.contrib.admindocs',\n 'pydash',\n
-        'servirmetrics']
INTERNAL_IPS
[]
LANGUAGES
[(u'af', u'Afrikaans'),\n (u'ar',
-        u'Arabic'),\n (u'ast', u'Asturian'),\n (u'az',
-        u'Azerbaijani'),\n (u'bg', u'Bulgarian'),\n (u'be',
-        u'Belarusian'),\n (u'bn', u'Bengali'),\n (u'br',
-        u'Breton'),\n (u'bs', u'Bosnian'),\n (u'ca',
-        u'Catalan'),\n (u'cs', u'Czech'),\n (u'cy',
-        u'Welsh'),\n (u'da', u'Danish'),\n (u'de',
-        u'German'),\n (u'dsb', u'Lower Sorbian'),\n (u'el',
-        u'Greek'),\n (u'en', u'English'),\n (u'en-au',
-        u'Australian English'),\n (u'en-gb', u'British English'),\n
-        (u'eo', u'Esperanto'),\n (u'es', u'Spanish'),\n
-        (u'es-ar', u'Argentinian Spanish'),\n (u'es-co', u'Colombian
-        Spanish'),\n (u'es-mx', u'Mexican Spanish'),\n (u'es-ni',
-        u'Nicaraguan Spanish'),\n (u'es-ve', u'Venezuelan Spanish'),\n
-        (u'et', u'Estonian'),\n (u'eu', u'Basque'),\n
-        (u'fa', u'Persian'),\n (u'fi', u'Finnish'),\n
-        (u'fr', u'French'),\n (u'fy', u'Frisian'),\n
-        (u'ga', u'Irish'),\n (u'gd', u'Scottish Gaelic'),\n
-        (u'gl', u'Galician'),\n (u'he', u'Hebrew'),\n
-        (u'hi', u'Hindi'),\n (u'hr', u'Croatian'),\n
-        (u'hsb', u'Upper Sorbian'),\n (u'hu', u'Hungarian'),\n
-        (u'ia', u'Interlingua'),\n (u'id', u'Indonesian'),\n
-        (u'io', u'Ido'),\n (u'is', u'Icelandic'),\n
-        (u'it', u'Italian'),\n (u'ja', u'Japanese'),\n
-        (u'ka', u'Georgian'),\n (u'kk', u'Kazakh'),\n
-        (u'km', u'Khmer'),\n (u'kn', u'Kannada'),\n
-        (u'ko', u'Korean'),\n (u'lb', u'Luxembourgish'),\n
-        (u'lt', u'Lithuanian'),\n (u'lv', u'Latvian'),\n
-        (u'mk', u'Macedonian'),\n (u'ml', u'Malayalam'),\n
-        (u'mn', u'Mongolian'),\n (u'mr', u'Marathi'),\n
-        (u'my', u'Burmese'),\n (u'nb', u'Norwegian Bokm\\xe5l'),\n
-        (u'ne', u'Nepali'),\n (u'nl', u'Dutch'),\n
-        (u'nn', u'Norwegian Nynorsk'),\n (u'os', u'Ossetic'),\n
-        (u'pa', u'Punjabi'),\n (u'pl', u'Polish'),\n
-        (u'pt', u'Portuguese'),\n (u'pt-br', u'Brazilian
-        Portuguese'),\n (u'ro', u'Romanian'),\n (u'ru',
-        u'Russian'),\n (u'sk', u'Slovak'),\n (u'sl',
-        u'Slovenian'),\n (u'sq', u'Albanian'),\n (u'sr',
-        u'Serbian'),\n (u'sr-latn', u'Serbian Latin'),\n (u'sv',
-        u'Swedish'),\n (u'sw', u'Swahili'),\n (u'ta',
-        u'Tamil'),\n (u'te', u'Telugu'),\n (u'th',
-        u'Thai'),\n (u'tr', u'Turkish'),\n (u'tt',
-        u'Tatar'),\n (u'udm', u'Udmurt'),\n (u'uk',
-        u'Ukrainian'),\n (u'ur', u'Urdu'),\n (u'vi',
-        u'Vietnamese'),\n (u'zh-hans', u'Simplified Chinese'),\n
-        (u'zh-hant', u'Traditional Chinese')]
LANGUAGES_BIDI
[u'he',
-        u'ar', u'fa', u'ur']
LANGUAGE_CODE
'en-us'
LANGUAGE_COOKIE_AGE
None
LANGUAGE_COOKIE_DOMAIN
None
LANGUAGE_COOKIE_NAME
u'django_language'
LANGUAGE_COOKIE_PATH
u'/'
LOCALE_PATHS
[]
LOGGING
{'disable_existing_loggers': True,\n 'filters':
-        {},\n 'formatters': {'simple': {'format': '%(levelname)s,
-        %(message)s'},\n                'verbose': {'format':
-        '%(levelname)s, %(asctime)s, %(module)s, %(process)d, %(thread)d, %(message)s'}},\n
-        'handlers': {'console': {'class': 'logging.StreamHandler',\n
-        \                         'formatter': 'simple',\n                          'level':
-        'DEBUG'},\n              'log_file_chirps': {'class':
-        'logging.handlers.RotatingFileHandler',\n                                  'filename':
-        '/data/data/cserv/chirps.log',\n                                  'formatter':
-        'verbose',\n                                  'level': 'DEBUG',\n
-        \                                 'maxBytes': '16777216'},\n
-        \             'log_file_metrics': {'backupCount': '10',\n
-        \                                  'class': 'logging.handlers.RotatingFileHandler',\n
-        \                                  'filename': '/data/data/logs/metrics/metrics.log',\n
-        \                                  'formatter': 'verbose',\n
-        \                                  'level': 'INFO',\n                                   'maxBytes':
-        '100000000'}},\n 'loggers': {'CHIRPS': {'handlers':
-        ['log_file_chirps'],\n                        'level': 'INFO',\n
-        \                       'propagate': False},\n             'metrics_logger':
-        {'handlers': ['log_file_metrics'],\n                                'level':
-        'INFO'},\n             'servirchirps': {'handlers':
-        ['log_file_chirps'],\n                              'level':
-        'INFO',\n                              'propagate': False}},\n
-        'version': 1}
LOGGING_CONFIG
u'logging.config.dictConfig'
LOGIN_REDIRECT_URL
u'/accounts/profile/'
LOGIN_URL
u'/accounts/login/'
LOGOUT_REDIRECT_URL
None
MANAGERS
()
MEDIA_ROOT
''
MEDIA_URL
''
MESSAGE_STORAGE
u'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE
None
MIDDLEWARE_CLASSES
('corsheaders.middleware.CorsMiddleware',\n
-        'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n
-        'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n
-        'django.contrib.messages.middleware.MessageMiddleware',\n 'servirchirpsdjango.middleware.MetricsTracking')
MIGRATION_MODULES
{}
MONTH_DAY_FORMAT
u'F
-        j'
NUMBER_GROUPING
0
PASSWORD_HASHERS
u'********************'
PASSWORD_RESET_TIMEOUT_DAYS
u'********************'
PREPEND_WWW
False
ROOT_URLCONF
'servirchirpsdjango.urls'
SECRET_KEY
u'********************'
SECURE_BROWSER_XSS_FILTER
False
SECURE_CONTENT_TYPE_NOSNIFF
False
SECURE_HSTS_INCLUDE_SUBDOMAINS
False
SECURE_HSTS_PRELOAD
False
SECURE_HSTS_SECONDS
0
SECURE_PROXY_SSL_HEADER
None
SECURE_REDIRECT_EXEMPT
[]
SECURE_SSL_HOST
None
SECURE_SSL_REDIRECT
False
SERVER_EMAIL
u'root@localhost'
SESSION_CACHE_ALIAS
u'default'
SESSION_COOKIE_AGE
1209600
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_HTTPONLY
True
SESSION_COOKIE_NAME
u'sessionid'
SESSION_COOKIE_PATH
u'/'
SESSION_COOKIE_SECURE
False
SESSION_ENGINE
u'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
SESSION_FILE_PATH
None
SESSION_SAVE_EVERY_REQUEST
False
SESSION_SERIALIZER
u'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE
'servirchirpsdjango.settings'
SHORT_DATETIME_FORMAT
u'm/d/Y P'
SHORT_DATE_FORMAT
u'm/d/Y'
SIGNING_BACKEND
u'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS
[]
SITE_ID
1
STATICFILES_DIRS
()
STATICFILES_FINDERS
('django.contrib.staticfiles.finders.FileSystemFinder',\n
-        'django.contrib.staticfiles.finders.AppDirectoriesFinder')
STATICFILES_STORAGE
u'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT
'/data/data/cserv/static/'
STATIC_URL
'/static/'
TEMPLATES
[{'APP_DIRS': True,\n  'BACKEND': 'django.template.backends.django.DjangoTemplates',\n
-        \ 'DIRS': ['/data/data/cserv/pythonCode/servirchirpsdjango/templates'],\n
-        \ 'OPTIONS': {'context_processors': ['django.template.context_processors.debug',\n
-        \                                    'django.template.context_processors.request',\n
-        \                                    'django.contrib.auth.context_processors.auth',\n
-        \                                    'django.contrib.messages.context_processors.messages'],\n
-        \             'debug': False}}]
TEST_NON_SERIALIZED_APPS
[]
TEST_RUNNER
u'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR
u','
TIME_FORMAT
u'P'
TIME_INPUT_FORMATS
[u'%H:%M:%S', u'%H:%M:%S.%f',
-        u'%H:%M']
TIME_ZONE
'America/Chicago'
USE_ETAGS
False
USE_I18N
True
USE_L10N
True
USE_THOUSAND_SEPARATOR
False
USE_TZ
True
USE_X_FORWARDED_HOST
False
USE_X_FORWARDED_PORT
False
WSGI_APPLICATION
'servirchirpsdjango.wsgi.application'
X_FRAME_OPTIONS
u'SAMEORIGIN'
YEAR_MONTH_FORMAT
u'F Y'
\n\n
\n\n
\n

\n You're - seeing this error because you have DEBUG = True in your\n Django - settings file. Change that to False, and Django will\n display - a standard page generated by the handler for this status code.\n

\n - \
\n\n\n\n" - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=d0dc6842-5d86-4c3a-97f0-d7ff51de34a8 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:15 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=d0dc6842-5d86-4c3a-97f0-d7ff51de34a8 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:16 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Fri, 28 Feb 2020 22:15:17 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '72338' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string: "\n\n\n\n \n \n - \ AttributeError at /getDataRequestProgress/\n \n \n \n - \ \n\n\n
\n

AttributeError at /getDataRequestProgress/

\n - \
'MultiValueDictKeyError' object has
-        no attribute 'errno'
\n \n\n \n - \ \n \n \n \n - \ \n \n - \ \n\n \n \n \n - \ \n\n \n \n \n - \ \n\n\n \n \n \n \n\n\n \n - \ \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n - \ \n \n \n \n \n
Request Method:GET
Request URL:https://climateserv.servirglobal.net/chirps/getDataRequestProgress/
Django Version:1.11
Exception Type:AttributeError
Exception Value:
'MultiValueDictKeyError'
-        object has no attribute 'errno'
Exception Location:/data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress, line 765
Python - Executable:/usr/bin/python
Python - Version:2.7.12
Python - Path:
['/data/data/cserv/pythonCode/servirchirpsdjango',\n
-        '/usr/lib/python2.7',\n '/usr/lib/python2.7/plat-x86_64-linux-gnu',\n
-        '/usr/lib/python2.7/lib-tk',\n '/usr/lib/python2.7/lib-old',\n
-        '/usr/lib/python2.7/lib-dynload',\n '/usr/local/lib/python2.7/dist-packages',\n
-        '/usr/lib/python2.7/dist-packages',\n '/data/data/cserv/pythonCode/serviringest']
Server time:Fri, 28 Feb 2020 - 16:15:17 -0600
\n
\n\n\n\n\n
\n - \

Traceback \n - \ Switch to copy-and-paste view\n

\n \n
\n - \
    \n \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py - in inner\n\n \n
    \n - \ \n
      \n - \ \n
    1.     This decorator is automatically applied
      -        to all middleware to ensure that
    2. \n \n
    3.     no
      -        middleware leaks an exception and that the next middleware in the stack
    4. \n - \ \n
    5.     can rely on getting a response instead of
      -        an exception.
    6. \n \n
    7.     """
    8. \n \n - \
    9. -        \   @wraps(get_response, assigned=available_attrs(get_response))
    10. \n - \ \n
    11.     def inner(request):
    12. \n \n - \
    13. -        \       try:
    14. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         except Exception as exc:
    2. \n - \ \n
    3.             response = response_for_exception(request,
      -        exc)
    4. \n \n
    5.         return response
    6. \n \n - \
    7. -        \   return inner
    8. \n \n
    9. \n \n
    10. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    exc
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    get_response
    <bound method WSGIHandler._legacy_get_response
    -        of <django.core.handlers.wsgi.WSGIHandler object at 0x7faa464459d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _legacy_get_response\n\n \n
    \n \n
      \n \n
    1.         #
      -        Apply request middleware
    2. \n \n
    3.         for
      -        middleware_method in self._request_middleware:
    4. \n \n - \
    5. -        \           response = middleware_method(request)
    6. \n \n - \
    7. -        \           if response:
    8. \n \n
    9.                 break
    10. \n - \ \n
    11. \n \n
    12.         if
      -        response is None:
    13. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = self._get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         return response
    2. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    middleware_method
    <bound method MessageMiddleware.process_request
    -        of <django.contrib.messages.middleware.MessageMiddleware object at 0x7faa45b273d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7faa464459d0>
    \n \n
  • \n - \ \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.                 break
    2. \n - \ \n
    3. \n \n
    4.         if
      -        response is None:
    5. \n \n
    6.             wrapped_callback = self.make_view_atomic(callback)
    7. \n - \ \n
    8.             try:
    9. \n \n - \
    10. -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
    11. \n - \ \n
    12.             except Exception as e:
    13. \n - \ \n
    \n \n
      \n
    1. \n                response = self.process_exception_by_middleware(e,
      -        request)
      ...
    \n \n
      \n \n - \
    1. \n - \ \n
    2.         # Complain if the view returned None
      -        (a common error).
    3. \n \n
    4.         if response is None:
    5. \n \n - \
    6. -        \           if isinstance(callback, types.FunctionType):    # FBV
    7. \n - \ \n
    8.                 view_name = callback.__name__
    9. \n - \ \n
    10.             else:                                           #
      -        CBV
    11. \n \n
    \n \n - \
    \n \n\n \n
    \n - \ \n Local vars\n \n - \
    \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7faa2fb11ed8>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7faa45b21e10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7faa464459d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7faa2fb11ed8>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.             response
      -        = middleware_method(request, callback, callback_args, callback_kwargs)
    2. \n - \ \n
    3.             if response:
    4. \n \n - \
    5. -        \               break
    6. \n \n
    7. \n - \ \n
    8.         if response is None:
    9. \n \n - \
    10. -        \           wrapped_callback = self.make_view_atomic(callback)
    11. \n - \ \n
    12.             try:
    13. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
      - ...
    \n \n
      \n \n
    1.             except
      -        Exception as e:
    2. \n \n
    3.                 response = self.process_exception_by_middleware(e,
      -        request)
    4. \n \n
    5. \n \n
    6.         #
      -        Complain if the view returned None (a common error).
    7. \n \n - \
    8. -        \       if response is None:
    9. \n \n
    10.             if
      -        isinstance(callback, types.FunctionType):    # FBV
    11. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7faa2fb11ed8>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7faa45b21e10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7faa464459d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7faa2fb11ed8>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py - in wrapped_view\n\n \n
    \n \n
      \n \n
    1.     """
    2. \n - \ \n
    3.     Marks a view function as being exempt from
      -        the CSRF view protection.
    4. \n \n
    5.     """
    6. \n - \ \n
    7.     # We could just do view_func.csrf_exempt
      -        = True, but decorators
    8. \n \n
    9.     #
      -        are nicer if they don't have side-effects, so we return a new
    10. \n - \ \n
    11.     # function.
    12. \n \n - \
    13. -        \   def wrapped_view(*args, **kwargs):
    14. \n \n
    \n - \ \n
      \n
    1. \n        return
      -        view_func(*args, **kwargs)
      ...
    \n \n - \
      \n - \ \n
    1.     wrapped_view.csrf_exempt = True
    2. \n - \ \n
    3.     return wraps(view_func, assigned=available_attrs(view_func))(wrapped_view)
    4. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    args
    (<WSGIRequest: GET '/chirps/getDataRequestProgress/'>,)
    kwargs
    {}
    view_func
    <function getDataRequestProgress
    -        at 0x7faa2fb11e60>
    \n \n
  • \n - \ \n \n
  • \n /data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress\n\n \n
    \n \n
      \n \n
    1.         if
      -        (progress == -1.0):
    2. \n \n
    3.             logger.warn("Problem with getDataRequestProgress:
      -        " + str(request))
    4. \n \n
    5.             return
      -        processCallBack(request, json.dumps([-1]), "application/json")
    6. \n - \ \n
    7.         else:
    8. \n \n - \
    9. -        \           return processCallBack(request, json.dumps([progress]), "application/json")
    10. \n - \ \n
    11.         ## return processCallBack(request,json.dumps([jsonresults['progress']]),"application/json")
    12. \n - \ \n
    13.     except Exception as e:
    14. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \       logger.warn("Problem with getDataRequestProgress: " + str(request)
      -        + " " + str(e.errno) + " " + str(e.strerror))
      ...
    \n - \ \n
      \n - \ \n
    1.         return processCallBack(request, json.dumps([-1]),
      -        "application/json")
    2. \n \n
    3. \n - \ \n
    4. \n \n
    5. @csrf_exempt
    6. \n - \ \n
    7. def getDataFromRequest(request):
    8. \n - \ \n
    9.     '''
    10. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    e
    MultiValueDictKeyError("'id'",)
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n
\n
\n \n
\n\n
\n \n - \ \n \n \n - \ \n

\n \n
\n
\n
\n\n\n\n
\n

Request information

\n\n\n \n

USER

\n - \

AnonymousUser

\n \n\n

GET

\n \n

No - GET data

\n \n\n

POST

\n \n

No POST data

\n - \ \n

FILES

\n \n

No FILES data

\n \n\n\n - \

COOKIES

\n \n

No cookie data

\n \n\n - \

META

\n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n
VariableValue
CONTEXT_DOCUMENT_ROOT
'/data/data/cserv/www/html'
CONTEXT_PREFIX
''
DOCUMENT_ROOT
'/data/data/cserv/www/html'
GATEWAY_INTERFACE
'CGI/1.1'
HTTP_ACCEPT
'application/json,
-        text/xml, application/xml, */*'
HTTP_ACCEPT_ENCODING
'gzip,
-        deflate'
HTTP_HOST
'climateserv.servirglobal.net'
HTTP_USER_AGENT
'libcurl/7.64.1 r-curl/4.3 crul/0.9.0'
PATH_INFO
u'/getDataRequestProgress/'
PATH_TRANSLATED
'/data/data/cserv/www/html/getDataRequestProgress/'
QUERY_STRING
''
REMOTE_ADDR
'122.199.27.9'
REMOTE_PORT
'41860'
REQUEST_METHOD
'GET'
REQUEST_SCHEME
'https'
REQUEST_URI
'/chirps/getDataRequestProgress/'
SCRIPT_FILENAME
'/data/data/cserv/pythonCode/servirchirpsdjango/servirchirpsdjango/wsgi.py'
SCRIPT_NAME
u'/chirps'
SERVER_ADDR
'10.5.5.21'
SERVER_ADMIN
'root@localhost'
SERVER_NAME
'climateserv.servirglobal.net'
SERVER_PORT
'443'
SERVER_PROTOCOL
'HTTP/1.1'
SERVER_SIGNATURE
'<address>Apache/2.4.18 (Ubuntu)
-        Server at climateserv.servirglobal.net Port 443</address>\\n'
SERVER_SOFTWARE
'Apache/2.4.18 (Ubuntu)'
SSL_TLS_SNI
'climateserv.servirglobal.net'
apache.version
(2,
-        4, 18)
mod_wsgi.application_group
'climateserv.servirglobal.net|/chirps'
mod_wsgi.callable_object
'application'
mod_wsgi.enable_sendfile
'0'
mod_wsgi.handler_script
''
mod_wsgi.input_chunked
'0'
mod_wsgi.listener_host
''
mod_wsgi.listener_port
'443'
mod_wsgi.process_group
''
mod_wsgi.request_handler
'wsgi-script'
mod_wsgi.request_start
'1582928117203854'
mod_wsgi.script_reloading
'1'
mod_wsgi.script_start
'1582928117204081'
mod_wsgi.version
(4,
-        3, 0)
wsgi.errors
<mod_wsgi.Log object at 0x7faa2e14a8e8>
wsgi.file_wrapper
''
wsgi.input
<mod_wsgi.Input
-        object at 0x7faa2c9dd5f0>
wsgi.multiprocess
True
wsgi.multithread
False
wsgi.run_once
False
wsgi.url_scheme
'https'
wsgi.version
(1,
-        0)
\n\n\n

Settings

\n

Using settings module servirchirpsdjango.settings

\n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \
SettingValue
ABSOLUTE_URL_OVERRIDES
{}
ADMINS
()
ALLOWED_HOSTS
['*']
APPEND_SLASH
True
AUTHENTICATION_BACKENDS
[u'django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS
u'********************'
AUTH_USER_MODEL
u'auth.User'
BASE_DIR
'/data/data/cserv/pythonCode/servirchirpsdjango'
CACHES
{u'default': {u'BACKEND': u'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS
u'default'
CACHE_MIDDLEWARE_KEY_PREFIX
u'********************'
CACHE_MIDDLEWARE_SECONDS
600
CORS_ORIGIN_ALLOW_ALL
True
CORS_ORIGIN_WHITELIST
('54.172.93.198',)
CSRF_COOKIE_AGE
31449600
CSRF_COOKIE_DOMAIN
None
CSRF_COOKIE_HTTPONLY
False
CSRF_COOKIE_NAME
u'csrftoken'
CSRF_COOKIE_PATH
u'/'
CSRF_COOKIE_SECURE
False
CSRF_FAILURE_VIEW
u'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME
u'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS
[]
CSRF_USE_SESSIONS
False
DATABASES
{'default': {'ATOMIC_REQUESTS': False,\n
-        \            'AUTOCOMMIT': True,\n             'CONN_MAX_AGE':
-        0,\n             'ENGINE': 'django.db.backends.sqlite3',\n
-        \            'HOST': '',\n             'NAME': '/data/data/cserv/pythonCode/servirchirpsdjango/sqlite.db',\n
-        \            'OPTIONS': {},\n             'PASSWORD': u'********************',\n
-        \            'PORT': '',\n             'TEST': {'CHARSET':
-        None,\n                      'COLLATION': None,\n                      'MIRROR':
-        None,\n                      'NAME': None},\n             'TIME_ZONE':
-        None,\n             'USER': ''}}
DATABASE_ROUTERS
[]
DATA_UPLOAD_MAX_MEMORY_SIZE
2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS
1000
DATETIME_FORMAT
u'N
-        j, Y, P'
DATETIME_INPUT_FORMATS
[u'%Y-%m-%d %H:%M:%S',\n u'%Y-%m-%d
-        %H:%M:%S.%f',\n u'%Y-%m-%d %H:%M',\n u'%Y-%m-%d',\n u'%m/%d/%Y
-        %H:%M:%S',\n u'%m/%d/%Y %H:%M:%S.%f',\n u'%m/%d/%Y %H:%M',\n
-        u'%m/%d/%Y',\n u'%m/%d/%y %H:%M:%S',\n u'%m/%d/%y %H:%M:%S.%f',\n
-        u'%m/%d/%y %H:%M',\n u'%m/%d/%y']
DATE_FORMAT
u'N
-        j, Y'
DATE_INPUT_FORMATS
[u'%Y-%m-%d',\n u'%m/%d/%Y',\n
-        u'%m/%d/%y',\n u'%b %d %Y',\n u'%b %d, %Y',\n u'%d
-        %b %Y',\n u'%d %b, %Y',\n u'%B %d %Y',\n u'%B %d,
-        %Y',\n u'%d %B %Y',\n u'%d %B, %Y']
DEBUG
True
DEBUG_PROPAGATE_EXCEPTIONS
False
DECIMAL_SEPARATOR
u'.'
DEFAULT_CHARSET
u'utf-8'
DEFAULT_CONTENT_TYPE
u'text/html'
DEFAULT_EXCEPTION_REPORTER_FILTER
u'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE
u'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL
u'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE
u''
DEFAULT_TABLESPACE
u''
DISALLOWED_USER_AGENTS
[]
EMAIL_BACKEND
u'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST
u'localhost'
EMAIL_HOST_PASSWORD
u'********************'
EMAIL_HOST_USER
u''
EMAIL_PORT
25
EMAIL_SSL_CERTFILE
None
EMAIL_SSL_KEYFILE
u'********************'
EMAIL_SUBJECT_PREFIX
u'[Django] '
EMAIL_TIMEOUT
None
EMAIL_USE_LOCALTIME
False
EMAIL_USE_SSL
False
EMAIL_USE_TLS
False
FILE_CHARSET
u'utf-8'
FILE_UPLOAD_DIRECTORY_PERMISSIONS
None
FILE_UPLOAD_HANDLERS
[u'django.core.files.uploadhandler.MemoryFileUploadHandler',\n
-        u'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
FILE_UPLOAD_PERMISSIONS
None
FILE_UPLOAD_TEMP_DIR
None
FIRST_DAY_OF_WEEK
0
FIXTURE_DIRS
[]
FORCE_SCRIPT_NAME
None
FORMAT_MODULE_PATH
None
FORM_RENDERER
u'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS
[]
INSTALLED_APPS
['polls',\n
-        'django.contrib.auth',\n 'django.contrib.contenttypes',\n
-        'django.contrib.sessions',\n 'django.contrib.sites',\n 'django.contrib.messages',\n
-        'django.contrib.staticfiles',\n 'servirchirps',\n 'corsheaders',\n
-        'django.contrib.admin',\n 'django.contrib.admindocs',\n 'pydash',\n
-        'servirmetrics']
INTERNAL_IPS
[]
LANGUAGES
[(u'af', u'Afrikaans'),\n (u'ar',
-        u'Arabic'),\n (u'ast', u'Asturian'),\n (u'az',
-        u'Azerbaijani'),\n (u'bg', u'Bulgarian'),\n (u'be',
-        u'Belarusian'),\n (u'bn', u'Bengali'),\n (u'br',
-        u'Breton'),\n (u'bs', u'Bosnian'),\n (u'ca',
-        u'Catalan'),\n (u'cs', u'Czech'),\n (u'cy',
-        u'Welsh'),\n (u'da', u'Danish'),\n (u'de',
-        u'German'),\n (u'dsb', u'Lower Sorbian'),\n (u'el',
-        u'Greek'),\n (u'en', u'English'),\n (u'en-au',
-        u'Australian English'),\n (u'en-gb', u'British English'),\n
-        (u'eo', u'Esperanto'),\n (u'es', u'Spanish'),\n
-        (u'es-ar', u'Argentinian Spanish'),\n (u'es-co', u'Colombian
-        Spanish'),\n (u'es-mx', u'Mexican Spanish'),\n (u'es-ni',
-        u'Nicaraguan Spanish'),\n (u'es-ve', u'Venezuelan Spanish'),\n
-        (u'et', u'Estonian'),\n (u'eu', u'Basque'),\n
-        (u'fa', u'Persian'),\n (u'fi', u'Finnish'),\n
-        (u'fr', u'French'),\n (u'fy', u'Frisian'),\n
-        (u'ga', u'Irish'),\n (u'gd', u'Scottish Gaelic'),\n
-        (u'gl', u'Galician'),\n (u'he', u'Hebrew'),\n
-        (u'hi', u'Hindi'),\n (u'hr', u'Croatian'),\n
-        (u'hsb', u'Upper Sorbian'),\n (u'hu', u'Hungarian'),\n
-        (u'ia', u'Interlingua'),\n (u'id', u'Indonesian'),\n
-        (u'io', u'Ido'),\n (u'is', u'Icelandic'),\n
-        (u'it', u'Italian'),\n (u'ja', u'Japanese'),\n
-        (u'ka', u'Georgian'),\n (u'kk', u'Kazakh'),\n
-        (u'km', u'Khmer'),\n (u'kn', u'Kannada'),\n
-        (u'ko', u'Korean'),\n (u'lb', u'Luxembourgish'),\n
-        (u'lt', u'Lithuanian'),\n (u'lv', u'Latvian'),\n
-        (u'mk', u'Macedonian'),\n (u'ml', u'Malayalam'),\n
-        (u'mn', u'Mongolian'),\n (u'mr', u'Marathi'),\n
-        (u'my', u'Burmese'),\n (u'nb', u'Norwegian Bokm\\xe5l'),\n
-        (u'ne', u'Nepali'),\n (u'nl', u'Dutch'),\n
-        (u'nn', u'Norwegian Nynorsk'),\n (u'os', u'Ossetic'),\n
-        (u'pa', u'Punjabi'),\n (u'pl', u'Polish'),\n
-        (u'pt', u'Portuguese'),\n (u'pt-br', u'Brazilian
-        Portuguese'),\n (u'ro', u'Romanian'),\n (u'ru',
-        u'Russian'),\n (u'sk', u'Slovak'),\n (u'sl',
-        u'Slovenian'),\n (u'sq', u'Albanian'),\n (u'sr',
-        u'Serbian'),\n (u'sr-latn', u'Serbian Latin'),\n (u'sv',
-        u'Swedish'),\n (u'sw', u'Swahili'),\n (u'ta',
-        u'Tamil'),\n (u'te', u'Telugu'),\n (u'th',
-        u'Thai'),\n (u'tr', u'Turkish'),\n (u'tt',
-        u'Tatar'),\n (u'udm', u'Udmurt'),\n (u'uk',
-        u'Ukrainian'),\n (u'ur', u'Urdu'),\n (u'vi',
-        u'Vietnamese'),\n (u'zh-hans', u'Simplified Chinese'),\n
-        (u'zh-hant', u'Traditional Chinese')]
LANGUAGES_BIDI
[u'he',
-        u'ar', u'fa', u'ur']
LANGUAGE_CODE
'en-us'
LANGUAGE_COOKIE_AGE
None
LANGUAGE_COOKIE_DOMAIN
None
LANGUAGE_COOKIE_NAME
u'django_language'
LANGUAGE_COOKIE_PATH
u'/'
LOCALE_PATHS
[]
LOGGING
{'disable_existing_loggers': True,\n 'filters':
-        {},\n 'formatters': {'simple': {'format': '%(levelname)s,
-        %(message)s'},\n                'verbose': {'format':
-        '%(levelname)s, %(asctime)s, %(module)s, %(process)d, %(thread)d, %(message)s'}},\n
-        'handlers': {'console': {'class': 'logging.StreamHandler',\n
-        \                         'formatter': 'simple',\n                          'level':
-        'DEBUG'},\n              'log_file_chirps': {'class':
-        'logging.handlers.RotatingFileHandler',\n                                  'filename':
-        '/data/data/cserv/chirps.log',\n                                  'formatter':
-        'verbose',\n                                  'level': 'DEBUG',\n
-        \                                 'maxBytes': '16777216'},\n
-        \             'log_file_metrics': {'backupCount': '10',\n
-        \                                  'class': 'logging.handlers.RotatingFileHandler',\n
-        \                                  'filename': '/data/data/logs/metrics/metrics.log',\n
-        \                                  'formatter': 'verbose',\n
-        \                                  'level': 'INFO',\n                                   'maxBytes':
-        '100000000'}},\n 'loggers': {'CHIRPS': {'handlers':
-        ['log_file_chirps'],\n                        'level': 'INFO',\n
-        \                       'propagate': False},\n             'metrics_logger':
-        {'handlers': ['log_file_metrics'],\n                                'level':
-        'INFO'},\n             'servirchirps': {'handlers':
-        ['log_file_chirps'],\n                              'level':
-        'INFO',\n                              'propagate': False}},\n
-        'version': 1}
LOGGING_CONFIG
u'logging.config.dictConfig'
LOGIN_REDIRECT_URL
u'/accounts/profile/'
LOGIN_URL
u'/accounts/login/'
LOGOUT_REDIRECT_URL
None
MANAGERS
()
MEDIA_ROOT
''
MEDIA_URL
''
MESSAGE_STORAGE
u'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE
None
MIDDLEWARE_CLASSES
('corsheaders.middleware.CorsMiddleware',\n
-        'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n
-        'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n
-        'django.contrib.messages.middleware.MessageMiddleware',\n 'servirchirpsdjango.middleware.MetricsTracking')
MIGRATION_MODULES
{}
MONTH_DAY_FORMAT
u'F
-        j'
NUMBER_GROUPING
0
PASSWORD_HASHERS
u'********************'
PASSWORD_RESET_TIMEOUT_DAYS
u'********************'
PREPEND_WWW
False
ROOT_URLCONF
'servirchirpsdjango.urls'
SECRET_KEY
u'********************'
SECURE_BROWSER_XSS_FILTER
False
SECURE_CONTENT_TYPE_NOSNIFF
False
SECURE_HSTS_INCLUDE_SUBDOMAINS
False
SECURE_HSTS_PRELOAD
False
SECURE_HSTS_SECONDS
0
SECURE_PROXY_SSL_HEADER
None
SECURE_REDIRECT_EXEMPT
[]
SECURE_SSL_HOST
None
SECURE_SSL_REDIRECT
False
SERVER_EMAIL
u'root@localhost'
SESSION_CACHE_ALIAS
u'default'
SESSION_COOKIE_AGE
1209600
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_HTTPONLY
True
SESSION_COOKIE_NAME
u'sessionid'
SESSION_COOKIE_PATH
u'/'
SESSION_COOKIE_SECURE
False
SESSION_ENGINE
u'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
SESSION_FILE_PATH
None
SESSION_SAVE_EVERY_REQUEST
False
SESSION_SERIALIZER
u'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE
'servirchirpsdjango.settings'
SHORT_DATETIME_FORMAT
u'm/d/Y P'
SHORT_DATE_FORMAT
u'm/d/Y'
SIGNING_BACKEND
u'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS
[]
SITE_ID
1
STATICFILES_DIRS
()
STATICFILES_FINDERS
('django.contrib.staticfiles.finders.FileSystemFinder',\n
-        'django.contrib.staticfiles.finders.AppDirectoriesFinder')
STATICFILES_STORAGE
u'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT
'/data/data/cserv/static/'
STATIC_URL
'/static/'
TEMPLATES
[{'APP_DIRS': True,\n  'BACKEND': 'django.template.backends.django.DjangoTemplates',\n
-        \ 'DIRS': ['/data/data/cserv/pythonCode/servirchirpsdjango/templates'],\n
-        \ 'OPTIONS': {'context_processors': ['django.template.context_processors.debug',\n
-        \                                    'django.template.context_processors.request',\n
-        \                                    'django.contrib.auth.context_processors.auth',\n
-        \                                    'django.contrib.messages.context_processors.messages'],\n
-        \             'debug': False}}]
TEST_NON_SERIALIZED_APPS
[]
TEST_RUNNER
u'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR
u','
TIME_FORMAT
u'P'
TIME_INPUT_FORMATS
[u'%H:%M:%S', u'%H:%M:%S.%f',
-        u'%H:%M']
TIME_ZONE
'America/Chicago'
USE_ETAGS
False
USE_I18N
True
USE_L10N
True
USE_THOUSAND_SEPARATOR
False
USE_TZ
True
USE_X_FORWARDED_HOST
False
USE_X_FORWARDED_PORT
False
WSGI_APPLICATION
'servirchirpsdjango.wsgi.application'
X_FRAME_OPTIONS
u'SAMEORIGIN'
YEAR_MONTH_FORMAT
u'F Y'
\n\n
\n\n
\n

\n You're - seeing this error because you have DEBUG = True in your\n Django - settings file. Change that to False, and Django will\n display - a standard page generated by the handler for this status code.\n

\n - \
\n\n\n\n" - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=aa15ca8d-8ec7-4498-b9bf-f9febcfd9e94 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:18 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=aa15ca8d-8ec7-4498-b9bf-f9febcfd9e94 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:19 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:19 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=d0dc6842-5d86-4c3a-97f0-d7ff51de34a8 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:20 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "12facff0-7397-4dbe-8d4c-69626ae7e38c", - "epochTime": "946684800", "value": {"avg": 9.255108833312988}}, {"date": "1/2/2000", - "workid": "f4ee9770-7ca6-4fda-9c82-33ea31561a96", "epochTime": "946771200", - "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "57c6d941-4709-44b3-a641-2f2b8e84d4b1", - "epochTime": "946857600", "value": {"avg": 0.0}}, {"date": "1/4/2000", "workid": - "9e59230a-f909-46a1-9cc8-90d22cc7e0df", "epochTime": "946944000", "value": - {"avg": 0.0}}, {"date": "1/5/2000", "workid": "93bd9838-434a-473f-8459-18df678ecf62", - "epochTime": "947030400", "value": {"avg": 18.510217666625977}}]}' - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=d0dc6842-5d86-4c3a-97f0-d7ff51de34a8 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:21 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "12facff0-7397-4dbe-8d4c-69626ae7e38c", - "epochTime": "946684800", "value": {"avg": 9.255108833312988}}, {"date": "1/2/2000", - "workid": "f4ee9770-7ca6-4fda-9c82-33ea31561a96", "epochTime": "946771200", - "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "57c6d941-4709-44b3-a641-2f2b8e84d4b1", - "epochTime": "946857600", "value": {"avg": 0.0}}, {"date": "1/4/2000", "workid": - "9e59230a-f909-46a1-9cc8-90d22cc7e0df", "epochTime": "946944000", "value": - {"avg": 0.0}}, {"date": "1/5/2000", "workid": "93bd9838-434a-473f-8459-18df678ecf62", - "epochTime": "947030400", "value": {"avg": 18.510217666625977}}]}' - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:21 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=aa15ca8d-8ec7-4498-b9bf-f9febcfd9e94 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:22 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "0f035e9e-b7d2-4a88-9c32-f1b85e0912df", - "epochTime": "946684800", "value": {"avg": 38.354225158691406}}, {"date": - "1/2/2000", "workid": "28c7066c-d074-4925-a056-00b04866c3b2", "epochTime": - "946771200", "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "b42453a7-e219-4113-bf7e-5734e8714260", - "epochTime": "946857600", "value": {"avg": 38.354225158691406}}, {"date": - "1/4/2000", "workid": "343f77dc-d63d-4918-860c-17a000124100", "epochTime": - "946944000", "value": {"avg": 0.0}}, {"date": "1/5/2000", "workid": "e4b78ca0-e0be-4428-aa1e-6e27b0d21dc4", - "epochTime": "947030400", "value": {"avg": 0.0}}]}' - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=aa15ca8d-8ec7-4498-b9bf-f9febcfd9e94 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:15:23 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "0f035e9e-b7d2-4a88-9c32-f1b85e0912df", - "epochTime": "946684800", "value": {"avg": 38.354225158691406}}, {"date": - "1/2/2000", "workid": "28c7066c-d074-4925-a056-00b04866c3b2", "epochTime": - "946771200", "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "b42453a7-e219-4113-bf7e-5734e8714260", - "epochTime": "946857600", "value": {"avg": 38.354225158691406}}, {"date": - "1/4/2000", "workid": "343f77dc-d63d-4918-860c-17a000124100", "epochTime": - "946944000", "value": {"avg": 0.0}}, {"date": "1/5/2000", "workid": "e4b78ca0-e0be-4428-aa1e-6e27b0d21dc4", - "epochTime": "947030400", "value": {"avg": 0.0}}]}' - recorded_at: 2020-02-28 22:15:21 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 diff --git a/tests/fixtures/vcr_cassettes/geojson_method.yml b/tests/fixtures/vcr_cassettes/geojson_method.yml deleted file mode 100644 index 8af239c..0000000 --- a/tests/fixtures/vcr_cassettes/geojson_method.yml +++ /dev/null @@ -1,2275 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:35 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=0&begintime=01%2F01%2F2000&endtime=01%2F05%2F2000&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:36 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["d51298c9-1b2a-40d4-981f-c57d708f8795"]) - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:37 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=0&begintime=01%2F01%2F2000&endtime=01%2F05%2F2000&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:37 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["50d8d0c9-5bc9-4ec7-8fa8-14875c698fa1"]) - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Fri, 28 Feb 2020 22:26:38 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '72338' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string: "\n\n\n\n \n \n - \ AttributeError at /getDataRequestProgress/\n \n \n \n - \ \n\n\n
\n

AttributeError at /getDataRequestProgress/

\n - \
'MultiValueDictKeyError' object has
-        no attribute 'errno'
\n \n\n \n - \ \n \n \n \n - \ \n \n - \ \n\n \n \n \n - \ \n\n \n \n \n - \ \n\n\n \n \n \n \n\n\n \n - \ \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n - \ \n \n \n \n \n
Request Method:GET
Request URL:https://climateserv.servirglobal.net/chirps/getDataRequestProgress/
Django Version:1.11
Exception Type:AttributeError
Exception Value:
'MultiValueDictKeyError'
-        object has no attribute 'errno'
Exception Location:/data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress, line 765
Python - Executable:/usr/bin/python
Python - Version:2.7.12
Python - Path:
['/data/data/cserv/pythonCode/servirchirpsdjango',\n
-        '/usr/lib/python2.7',\n '/usr/lib/python2.7/plat-x86_64-linux-gnu',\n
-        '/usr/lib/python2.7/lib-tk',\n '/usr/lib/python2.7/lib-old',\n
-        '/usr/lib/python2.7/lib-dynload',\n '/usr/local/lib/python2.7/dist-packages',\n
-        '/usr/lib/python2.7/dist-packages',\n '/data/data/cserv/pythonCode/serviringest']
Server time:Fri, 28 Feb 2020 - 16:26:38 -0600
\n
\n\n\n\n\n
\n - \

Traceback \n - \ Switch to copy-and-paste view\n

\n \n
\n - \
    \n \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py - in inner\n\n \n
    \n - \ \n
      \n - \ \n
    1.     This decorator is automatically applied
      -        to all middleware to ensure that
    2. \n \n
    3.     no
      -        middleware leaks an exception and that the next middleware in the stack
    4. \n - \ \n
    5.     can rely on getting a response instead of
      -        an exception.
    6. \n \n
    7.     """
    8. \n \n - \
    9. -        \   @wraps(get_response, assigned=available_attrs(get_response))
    10. \n - \ \n
    11.     def inner(request):
    12. \n \n - \
    13. -        \       try:
    14. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         except Exception as exc:
    2. \n - \ \n
    3.             response = response_for_exception(request,
      -        exc)
    4. \n \n
    5.         return response
    6. \n \n - \
    7. -        \   return inner
    8. \n \n
    9. \n \n
    10. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    exc
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    get_response
    <bound method WSGIHandler._legacy_get_response
    -        of <django.core.handlers.wsgi.WSGIHandler object at 0x7faa464459d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _legacy_get_response\n\n \n
    \n \n
      \n \n
    1.         #
      -        Apply request middleware
    2. \n \n
    3.         for
      -        middleware_method in self._request_middleware:
    4. \n \n - \
    5. -        \           response = middleware_method(request)
    6. \n \n - \
    7. -        \           if response:
    8. \n \n
    9.                 break
    10. \n - \ \n
    11. \n \n
    12.         if
      -        response is None:
    13. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = self._get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         return response
    2. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    middleware_method
    <bound method MessageMiddleware.process_request
    -        of <django.contrib.messages.middleware.MessageMiddleware object at 0x7faa45b273d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7faa464459d0>
    \n \n
  • \n - \ \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.                 break
    2. \n - \ \n
    3. \n \n
    4.         if
      -        response is None:
    5. \n \n
    6.             wrapped_callback = self.make_view_atomic(callback)
    7. \n - \ \n
    8.             try:
    9. \n \n - \
    10. -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
    11. \n - \ \n
    12.             except Exception as e:
    13. \n - \ \n
    \n \n
      \n
    1. \n                response = self.process_exception_by_middleware(e,
      -        request)
      ...
    \n \n
      \n \n - \
    1. \n - \ \n
    2.         # Complain if the view returned None
      -        (a common error).
    3. \n \n
    4.         if response is None:
    5. \n \n - \
    6. -        \           if isinstance(callback, types.FunctionType):    # FBV
    7. \n - \ \n
    8.                 view_name = callback.__name__
    9. \n - \ \n
    10.             else:                                           #
      -        CBV
    11. \n \n
    \n \n - \
    \n \n\n \n
    \n - \ \n Local vars\n \n - \
    \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7faa2fb16050>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7faa45b21e10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7faa464459d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7faa2fb16050>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.             response
      -        = middleware_method(request, callback, callback_args, callback_kwargs)
    2. \n - \ \n
    3.             if response:
    4. \n \n - \
    5. -        \               break
    6. \n \n
    7. \n - \ \n
    8.         if response is None:
    9. \n \n - \
    10. -        \           wrapped_callback = self.make_view_atomic(callback)
    11. \n - \ \n
    12.             try:
    13. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
      - ...
    \n \n
      \n \n
    1.             except
      -        Exception as e:
    2. \n \n
    3.                 response = self.process_exception_by_middleware(e,
      -        request)
    4. \n \n
    5. \n \n
    6.         #
      -        Complain if the view returned None (a common error).
    7. \n \n - \
    8. -        \       if response is None:
    9. \n \n
    10.             if
      -        isinstance(callback, types.FunctionType):    # FBV
    11. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7faa2fb16050>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7faa45b21e10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7faa464459d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7faa2fb16050>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py - in wrapped_view\n\n \n
    \n \n
      \n \n
    1.     """
    2. \n - \ \n
    3.     Marks a view function as being exempt from
      -        the CSRF view protection.
    4. \n \n
    5.     """
    6. \n - \ \n
    7.     # We could just do view_func.csrf_exempt
      -        = True, but decorators
    8. \n \n
    9.     #
      -        are nicer if they don't have side-effects, so we return a new
    10. \n - \ \n
    11.     # function.
    12. \n \n - \
    13. -        \   def wrapped_view(*args, **kwargs):
    14. \n \n
    \n - \ \n
      \n
    1. \n        return
      -        view_func(*args, **kwargs)
      ...
    \n \n - \
      \n - \ \n
    1.     wrapped_view.csrf_exempt = True
    2. \n - \ \n
    3.     return wraps(view_func, assigned=available_attrs(view_func))(wrapped_view)
    4. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    args
    (<WSGIRequest: GET '/chirps/getDataRequestProgress/'>,)
    kwargs
    {}
    view_func
    <function getDataRequestProgress
    -        at 0x7faa2fb11f50>
    \n \n
  • \n - \ \n \n
  • \n /data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress\n\n \n
    \n \n
      \n \n
    1.         if
      -        (progress == -1.0):
    2. \n \n
    3.             logger.warn("Problem with getDataRequestProgress:
      -        " + str(request))
    4. \n \n
    5.             return
      -        processCallBack(request, json.dumps([-1]), "application/json")
    6. \n - \ \n
    7.         else:
    8. \n \n - \
    9. -        \           return processCallBack(request, json.dumps([progress]), "application/json")
    10. \n - \ \n
    11.         ## return processCallBack(request,json.dumps([jsonresults['progress']]),"application/json")
    12. \n - \ \n
    13.     except Exception as e:
    14. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \       logger.warn("Problem with getDataRequestProgress: " + str(request)
      -        + " " + str(e.errno) + " " + str(e.strerror))
      ...
    \n - \ \n
      \n - \ \n
    1.         return processCallBack(request, json.dumps([-1]),
      -        "application/json")
    2. \n \n
    3. \n - \ \n
    4. \n \n
    5. @csrf_exempt
    6. \n - \ \n
    7. def getDataFromRequest(request):
    8. \n - \ \n
    9.     '''
    10. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    e
    MultiValueDictKeyError("'id'",)
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n
\n
\n \n
\n\n
\n \n - \ \n \n \n - \ \n

\n \n
\n
\n
\n\n\n\n
\n

Request information

\n\n\n \n

USER

\n - \

AnonymousUser

\n \n\n

GET

\n \n

No - GET data

\n \n\n

POST

\n \n

No POST data

\n - \ \n

FILES

\n \n

No FILES data

\n \n\n\n - \

COOKIES

\n \n

No cookie data

\n \n\n - \

META

\n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n
VariableValue
CONTEXT_DOCUMENT_ROOT
'/data/data/cserv/www/html'
CONTEXT_PREFIX
''
DOCUMENT_ROOT
'/data/data/cserv/www/html'
GATEWAY_INTERFACE
'CGI/1.1'
HTTP_ACCEPT
'application/json,
-        text/xml, application/xml, */*'
HTTP_ACCEPT_ENCODING
'gzip,
-        deflate'
HTTP_HOST
'climateserv.servirglobal.net'
HTTP_USER_AGENT
'libcurl/7.64.1 r-curl/4.3 crul/0.9.0'
PATH_INFO
u'/getDataRequestProgress/'
PATH_TRANSLATED
'/data/data/cserv/www/html/getDataRequestProgress/'
QUERY_STRING
''
REMOTE_ADDR
'122.199.27.9'
REMOTE_PORT
'32916'
REQUEST_METHOD
'GET'
REQUEST_SCHEME
'https'
REQUEST_URI
'/chirps/getDataRequestProgress/'
SCRIPT_FILENAME
'/data/data/cserv/pythonCode/servirchirpsdjango/servirchirpsdjango/wsgi.py'
SCRIPT_NAME
u'/chirps'
SERVER_ADDR
'10.5.5.21'
SERVER_ADMIN
'root@localhost'
SERVER_NAME
'climateserv.servirglobal.net'
SERVER_PORT
'443'
SERVER_PROTOCOL
'HTTP/1.1'
SERVER_SIGNATURE
'<address>Apache/2.4.18 (Ubuntu)
-        Server at climateserv.servirglobal.net Port 443</address>\\n'
SERVER_SOFTWARE
'Apache/2.4.18 (Ubuntu)'
SSL_TLS_SNI
'climateserv.servirglobal.net'
apache.version
(2,
-        4, 18)
mod_wsgi.application_group
'climateserv.servirglobal.net|/chirps'
mod_wsgi.callable_object
'application'
mod_wsgi.enable_sendfile
'0'
mod_wsgi.handler_script
''
mod_wsgi.input_chunked
'0'
mod_wsgi.listener_host
''
mod_wsgi.listener_port
'443'
mod_wsgi.process_group
''
mod_wsgi.request_handler
'wsgi-script'
mod_wsgi.request_start
'1582928798336887'
mod_wsgi.script_reloading
'1'
mod_wsgi.script_start
'1582928798337099'
mod_wsgi.version
(4,
-        3, 0)
wsgi.errors
<mod_wsgi.Log object at 0x7faa2ca1a9c0>
wsgi.file_wrapper
''
wsgi.input
<mod_wsgi.Input
-        object at 0x7faa2c757ab0>
wsgi.multiprocess
True
wsgi.multithread
False
wsgi.run_once
False
wsgi.url_scheme
'https'
wsgi.version
(1,
-        0)
\n\n\n

Settings

\n

Using settings module servirchirpsdjango.settings

\n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \
SettingValue
ABSOLUTE_URL_OVERRIDES
{}
ADMINS
()
ALLOWED_HOSTS
['*']
APPEND_SLASH
True
AUTHENTICATION_BACKENDS
[u'django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS
u'********************'
AUTH_USER_MODEL
u'auth.User'
BASE_DIR
'/data/data/cserv/pythonCode/servirchirpsdjango'
CACHES
{u'default': {u'BACKEND': u'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS
u'default'
CACHE_MIDDLEWARE_KEY_PREFIX
u'********************'
CACHE_MIDDLEWARE_SECONDS
600
CORS_ORIGIN_ALLOW_ALL
True
CORS_ORIGIN_WHITELIST
('54.172.93.198',)
CSRF_COOKIE_AGE
31449600
CSRF_COOKIE_DOMAIN
None
CSRF_COOKIE_HTTPONLY
False
CSRF_COOKIE_NAME
u'csrftoken'
CSRF_COOKIE_PATH
u'/'
CSRF_COOKIE_SECURE
False
CSRF_FAILURE_VIEW
u'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME
u'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS
[]
CSRF_USE_SESSIONS
False
DATABASES
{'default': {'ATOMIC_REQUESTS': False,\n
-        \            'AUTOCOMMIT': True,\n             'CONN_MAX_AGE':
-        0,\n             'ENGINE': 'django.db.backends.sqlite3',\n
-        \            'HOST': '',\n             'NAME': '/data/data/cserv/pythonCode/servirchirpsdjango/sqlite.db',\n
-        \            'OPTIONS': {},\n             'PASSWORD': u'********************',\n
-        \            'PORT': '',\n             'TEST': {'CHARSET':
-        None,\n                      'COLLATION': None,\n                      'MIRROR':
-        None,\n                      'NAME': None},\n             'TIME_ZONE':
-        None,\n             'USER': ''}}
DATABASE_ROUTERS
[]
DATA_UPLOAD_MAX_MEMORY_SIZE
2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS
1000
DATETIME_FORMAT
u'N
-        j, Y, P'
DATETIME_INPUT_FORMATS
[u'%Y-%m-%d %H:%M:%S',\n u'%Y-%m-%d
-        %H:%M:%S.%f',\n u'%Y-%m-%d %H:%M',\n u'%Y-%m-%d',\n u'%m/%d/%Y
-        %H:%M:%S',\n u'%m/%d/%Y %H:%M:%S.%f',\n u'%m/%d/%Y %H:%M',\n
-        u'%m/%d/%Y',\n u'%m/%d/%y %H:%M:%S',\n u'%m/%d/%y %H:%M:%S.%f',\n
-        u'%m/%d/%y %H:%M',\n u'%m/%d/%y']
DATE_FORMAT
u'N
-        j, Y'
DATE_INPUT_FORMATS
[u'%Y-%m-%d',\n u'%m/%d/%Y',\n
-        u'%m/%d/%y',\n u'%b %d %Y',\n u'%b %d, %Y',\n u'%d
-        %b %Y',\n u'%d %b, %Y',\n u'%B %d %Y',\n u'%B %d,
-        %Y',\n u'%d %B %Y',\n u'%d %B, %Y']
DEBUG
True
DEBUG_PROPAGATE_EXCEPTIONS
False
DECIMAL_SEPARATOR
u'.'
DEFAULT_CHARSET
u'utf-8'
DEFAULT_CONTENT_TYPE
u'text/html'
DEFAULT_EXCEPTION_REPORTER_FILTER
u'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE
u'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL
u'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE
u''
DEFAULT_TABLESPACE
u''
DISALLOWED_USER_AGENTS
[]
EMAIL_BACKEND
u'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST
u'localhost'
EMAIL_HOST_PASSWORD
u'********************'
EMAIL_HOST_USER
u''
EMAIL_PORT
25
EMAIL_SSL_CERTFILE
None
EMAIL_SSL_KEYFILE
u'********************'
EMAIL_SUBJECT_PREFIX
u'[Django] '
EMAIL_TIMEOUT
None
EMAIL_USE_LOCALTIME
False
EMAIL_USE_SSL
False
EMAIL_USE_TLS
False
FILE_CHARSET
u'utf-8'
FILE_UPLOAD_DIRECTORY_PERMISSIONS
None
FILE_UPLOAD_HANDLERS
[u'django.core.files.uploadhandler.MemoryFileUploadHandler',\n
-        u'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
FILE_UPLOAD_PERMISSIONS
None
FILE_UPLOAD_TEMP_DIR
None
FIRST_DAY_OF_WEEK
0
FIXTURE_DIRS
[]
FORCE_SCRIPT_NAME
None
FORMAT_MODULE_PATH
None
FORM_RENDERER
u'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS
[]
INSTALLED_APPS
['polls',\n
-        'django.contrib.auth',\n 'django.contrib.contenttypes',\n
-        'django.contrib.sessions',\n 'django.contrib.sites',\n 'django.contrib.messages',\n
-        'django.contrib.staticfiles',\n 'servirchirps',\n 'corsheaders',\n
-        'django.contrib.admin',\n 'django.contrib.admindocs',\n 'pydash',\n
-        'servirmetrics']
INTERNAL_IPS
[]
LANGUAGES
[(u'af', u'Afrikaans'),\n (u'ar',
-        u'Arabic'),\n (u'ast', u'Asturian'),\n (u'az',
-        u'Azerbaijani'),\n (u'bg', u'Bulgarian'),\n (u'be',
-        u'Belarusian'),\n (u'bn', u'Bengali'),\n (u'br',
-        u'Breton'),\n (u'bs', u'Bosnian'),\n (u'ca',
-        u'Catalan'),\n (u'cs', u'Czech'),\n (u'cy',
-        u'Welsh'),\n (u'da', u'Danish'),\n (u'de',
-        u'German'),\n (u'dsb', u'Lower Sorbian'),\n (u'el',
-        u'Greek'),\n (u'en', u'English'),\n (u'en-au',
-        u'Australian English'),\n (u'en-gb', u'British English'),\n
-        (u'eo', u'Esperanto'),\n (u'es', u'Spanish'),\n
-        (u'es-ar', u'Argentinian Spanish'),\n (u'es-co', u'Colombian
-        Spanish'),\n (u'es-mx', u'Mexican Spanish'),\n (u'es-ni',
-        u'Nicaraguan Spanish'),\n (u'es-ve', u'Venezuelan Spanish'),\n
-        (u'et', u'Estonian'),\n (u'eu', u'Basque'),\n
-        (u'fa', u'Persian'),\n (u'fi', u'Finnish'),\n
-        (u'fr', u'French'),\n (u'fy', u'Frisian'),\n
-        (u'ga', u'Irish'),\n (u'gd', u'Scottish Gaelic'),\n
-        (u'gl', u'Galician'),\n (u'he', u'Hebrew'),\n
-        (u'hi', u'Hindi'),\n (u'hr', u'Croatian'),\n
-        (u'hsb', u'Upper Sorbian'),\n (u'hu', u'Hungarian'),\n
-        (u'ia', u'Interlingua'),\n (u'id', u'Indonesian'),\n
-        (u'io', u'Ido'),\n (u'is', u'Icelandic'),\n
-        (u'it', u'Italian'),\n (u'ja', u'Japanese'),\n
-        (u'ka', u'Georgian'),\n (u'kk', u'Kazakh'),\n
-        (u'km', u'Khmer'),\n (u'kn', u'Kannada'),\n
-        (u'ko', u'Korean'),\n (u'lb', u'Luxembourgish'),\n
-        (u'lt', u'Lithuanian'),\n (u'lv', u'Latvian'),\n
-        (u'mk', u'Macedonian'),\n (u'ml', u'Malayalam'),\n
-        (u'mn', u'Mongolian'),\n (u'mr', u'Marathi'),\n
-        (u'my', u'Burmese'),\n (u'nb', u'Norwegian Bokm\\xe5l'),\n
-        (u'ne', u'Nepali'),\n (u'nl', u'Dutch'),\n
-        (u'nn', u'Norwegian Nynorsk'),\n (u'os', u'Ossetic'),\n
-        (u'pa', u'Punjabi'),\n (u'pl', u'Polish'),\n
-        (u'pt', u'Portuguese'),\n (u'pt-br', u'Brazilian
-        Portuguese'),\n (u'ro', u'Romanian'),\n (u'ru',
-        u'Russian'),\n (u'sk', u'Slovak'),\n (u'sl',
-        u'Slovenian'),\n (u'sq', u'Albanian'),\n (u'sr',
-        u'Serbian'),\n (u'sr-latn', u'Serbian Latin'),\n (u'sv',
-        u'Swedish'),\n (u'sw', u'Swahili'),\n (u'ta',
-        u'Tamil'),\n (u'te', u'Telugu'),\n (u'th',
-        u'Thai'),\n (u'tr', u'Turkish'),\n (u'tt',
-        u'Tatar'),\n (u'udm', u'Udmurt'),\n (u'uk',
-        u'Ukrainian'),\n (u'ur', u'Urdu'),\n (u'vi',
-        u'Vietnamese'),\n (u'zh-hans', u'Simplified Chinese'),\n
-        (u'zh-hant', u'Traditional Chinese')]
LANGUAGES_BIDI
[u'he',
-        u'ar', u'fa', u'ur']
LANGUAGE_CODE
'en-us'
LANGUAGE_COOKIE_AGE
None
LANGUAGE_COOKIE_DOMAIN
None
LANGUAGE_COOKIE_NAME
u'django_language'
LANGUAGE_COOKIE_PATH
u'/'
LOCALE_PATHS
[]
LOGGING
{'disable_existing_loggers': True,\n 'filters':
-        {},\n 'formatters': {'simple': {'format': '%(levelname)s,
-        %(message)s'},\n                'verbose': {'format':
-        '%(levelname)s, %(asctime)s, %(module)s, %(process)d, %(thread)d, %(message)s'}},\n
-        'handlers': {'console': {'class': 'logging.StreamHandler',\n
-        \                         'formatter': 'simple',\n                          'level':
-        'DEBUG'},\n              'log_file_chirps': {'class':
-        'logging.handlers.RotatingFileHandler',\n                                  'filename':
-        '/data/data/cserv/chirps.log',\n                                  'formatter':
-        'verbose',\n                                  'level': 'DEBUG',\n
-        \                                 'maxBytes': '16777216'},\n
-        \             'log_file_metrics': {'backupCount': '10',\n
-        \                                  'class': 'logging.handlers.RotatingFileHandler',\n
-        \                                  'filename': '/data/data/logs/metrics/metrics.log',\n
-        \                                  'formatter': 'verbose',\n
-        \                                  'level': 'INFO',\n                                   'maxBytes':
-        '100000000'}},\n 'loggers': {'CHIRPS': {'handlers':
-        ['log_file_chirps'],\n                        'level': 'INFO',\n
-        \                       'propagate': False},\n             'metrics_logger':
-        {'handlers': ['log_file_metrics'],\n                                'level':
-        'INFO'},\n             'servirchirps': {'handlers':
-        ['log_file_chirps'],\n                              'level':
-        'INFO',\n                              'propagate': False}},\n
-        'version': 1}
LOGGING_CONFIG
u'logging.config.dictConfig'
LOGIN_REDIRECT_URL
u'/accounts/profile/'
LOGIN_URL
u'/accounts/login/'
LOGOUT_REDIRECT_URL
None
MANAGERS
()
MEDIA_ROOT
''
MEDIA_URL
''
MESSAGE_STORAGE
u'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE
None
MIDDLEWARE_CLASSES
('corsheaders.middleware.CorsMiddleware',\n
-        'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n
-        'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n
-        'django.contrib.messages.middleware.MessageMiddleware',\n 'servirchirpsdjango.middleware.MetricsTracking')
MIGRATION_MODULES
{}
MONTH_DAY_FORMAT
u'F
-        j'
NUMBER_GROUPING
0
PASSWORD_HASHERS
u'********************'
PASSWORD_RESET_TIMEOUT_DAYS
u'********************'
PREPEND_WWW
False
ROOT_URLCONF
'servirchirpsdjango.urls'
SECRET_KEY
u'********************'
SECURE_BROWSER_XSS_FILTER
False
SECURE_CONTENT_TYPE_NOSNIFF
False
SECURE_HSTS_INCLUDE_SUBDOMAINS
False
SECURE_HSTS_PRELOAD
False
SECURE_HSTS_SECONDS
0
SECURE_PROXY_SSL_HEADER
None
SECURE_REDIRECT_EXEMPT
[]
SECURE_SSL_HOST
None
SECURE_SSL_REDIRECT
False
SERVER_EMAIL
u'root@localhost'
SESSION_CACHE_ALIAS
u'default'
SESSION_COOKIE_AGE
1209600
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_HTTPONLY
True
SESSION_COOKIE_NAME
u'sessionid'
SESSION_COOKIE_PATH
u'/'
SESSION_COOKIE_SECURE
False
SESSION_ENGINE
u'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
SESSION_FILE_PATH
None
SESSION_SAVE_EVERY_REQUEST
False
SESSION_SERIALIZER
u'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE
'servirchirpsdjango.settings'
SHORT_DATETIME_FORMAT
u'm/d/Y P'
SHORT_DATE_FORMAT
u'm/d/Y'
SIGNING_BACKEND
u'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS
[]
SITE_ID
1
STATICFILES_DIRS
()
STATICFILES_FINDERS
('django.contrib.staticfiles.finders.FileSystemFinder',\n
-        'django.contrib.staticfiles.finders.AppDirectoriesFinder')
STATICFILES_STORAGE
u'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT
'/data/data/cserv/static/'
STATIC_URL
'/static/'
TEMPLATES
[{'APP_DIRS': True,\n  'BACKEND': 'django.template.backends.django.DjangoTemplates',\n
-        \ 'DIRS': ['/data/data/cserv/pythonCode/servirchirpsdjango/templates'],\n
-        \ 'OPTIONS': {'context_processors': ['django.template.context_processors.debug',\n
-        \                                    'django.template.context_processors.request',\n
-        \                                    'django.contrib.auth.context_processors.auth',\n
-        \                                    'django.contrib.messages.context_processors.messages'],\n
-        \             'debug': False}}]
TEST_NON_SERIALIZED_APPS
[]
TEST_RUNNER
u'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR
u','
TIME_FORMAT
u'P'
TIME_INPUT_FORMATS
[u'%H:%M:%S', u'%H:%M:%S.%f',
-        u'%H:%M']
TIME_ZONE
'America/Chicago'
USE_ETAGS
False
USE_I18N
True
USE_L10N
True
USE_THOUSAND_SEPARATOR
False
USE_TZ
True
USE_X_FORWARDED_HOST
False
USE_X_FORWARDED_PORT
False
WSGI_APPLICATION
'servirchirpsdjango.wsgi.application'
X_FRAME_OPTIONS
u'SAMEORIGIN'
YEAR_MONTH_FORMAT
u'F Y'
\n\n
\n\n
\n

\n You're - seeing this error because you have DEBUG = True in your\n Django - settings file. Change that to False, and Django will\n display - a standard page generated by the handler for this status code.\n

\n - \
\n\n\n\n" - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=d51298c9-1b2a-40d4-981f-c57d708f8795 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:39 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=d51298c9-1b2a-40d4-981f-c57d708f8795 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:39 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Fri, 28 Feb 2020 22:26:40 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '72338' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string: "\n\n\n\n \n \n - \ AttributeError at /getDataRequestProgress/\n \n \n \n - \ \n\n\n
\n

AttributeError at /getDataRequestProgress/

\n - \
'MultiValueDictKeyError' object has
-        no attribute 'errno'
\n \n\n \n - \ \n \n \n \n - \ \n \n - \ \n\n \n \n \n - \ \n\n \n \n \n - \ \n\n\n \n \n \n \n\n\n \n - \ \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n - \ \n \n \n \n \n
Request Method:GET
Request URL:https://climateserv.servirglobal.net/chirps/getDataRequestProgress/
Django Version:1.11
Exception Type:AttributeError
Exception Value:
'MultiValueDictKeyError'
-        object has no attribute 'errno'
Exception Location:/data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress, line 765
Python - Executable:/usr/bin/python
Python - Version:2.7.12
Python - Path:
['/data/data/cserv/pythonCode/servirchirpsdjango',\n
-        '/usr/lib/python2.7',\n '/usr/lib/python2.7/plat-x86_64-linux-gnu',\n
-        '/usr/lib/python2.7/lib-tk',\n '/usr/lib/python2.7/lib-old',\n
-        '/usr/lib/python2.7/lib-dynload',\n '/usr/local/lib/python2.7/dist-packages',\n
-        '/usr/lib/python2.7/dist-packages',\n '/data/data/cserv/pythonCode/serviringest']
Server time:Fri, 28 Feb 2020 - 16:26:40 -0600
\n
\n\n\n\n\n
\n - \

Traceback \n - \ Switch to copy-and-paste view\n

\n \n
\n - \
    \n \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py - in inner\n\n \n
    \n - \ \n
      \n - \ \n
    1.     This decorator is automatically applied
      -        to all middleware to ensure that
    2. \n \n
    3.     no
      -        middleware leaks an exception and that the next middleware in the stack
    4. \n - \ \n
    5.     can rely on getting a response instead of
      -        an exception.
    6. \n \n
    7.     """
    8. \n \n - \
    9. -        \   @wraps(get_response, assigned=available_attrs(get_response))
    10. \n - \ \n
    11.     def inner(request):
    12. \n \n - \
    13. -        \       try:
    14. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         except Exception as exc:
    2. \n - \ \n
    3.             response = response_for_exception(request,
      -        exc)
    4. \n \n
    5.         return response
    6. \n \n - \
    7. -        \   return inner
    8. \n \n
    9. \n \n
    10. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    exc
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    get_response
    <bound method WSGIHandler._legacy_get_response
    -        of <django.core.handlers.wsgi.WSGIHandler object at 0x7ff4283b19d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _legacy_get_response\n\n \n
    \n \n
      \n \n
    1.         #
      -        Apply request middleware
    2. \n \n
    3.         for
      -        middleware_method in self._request_middleware:
    4. \n \n - \
    5. -        \           response = middleware_method(request)
    6. \n \n - \
    7. -        \           if response:
    8. \n \n
    9.                 break
    10. \n - \ \n
    11. \n \n
    12.         if
      -        response is None:
    13. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = self._get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         return response
    2. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    middleware_method
    <bound method MessageMiddleware.process_request
    -        of <django.contrib.messages.middleware.MessageMiddleware object at 0x7ff427a933d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    \n \n
  • \n - \ \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.                 break
    2. \n - \ \n
    3. \n \n
    4.         if
      -        response is None:
    5. \n \n
    6.             wrapped_callback = self.make_view_atomic(callback)
    7. \n - \ \n
    8.             try:
    9. \n \n - \
    10. -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
    11. \n - \ \n
    12.             except Exception as e:
    13. \n - \ \n
    \n \n
      \n
    1. \n                response = self.process_exception_by_middleware(e,
      -        request)
      ...
    \n \n
      \n \n - \
    1. \n - \ \n
    2.         # Complain if the view returned None
      -        (a common error).
    3. \n \n
    4.         if response is None:
    5. \n \n - \
    6. -        \           if isinstance(callback, types.FunctionType):    # FBV
    7. \n - \ \n
    8.                 view_name = callback.__name__
    9. \n - \ \n
    10.             else:                                           #
      -        CBV
    11. \n \n
    \n \n - \
    \n \n\n \n
    \n - \ \n Local vars\n \n - \
    \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7ff411a82050>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7ff427a8de10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7ff411a82050>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.             response
      -        = middleware_method(request, callback, callback_args, callback_kwargs)
    2. \n - \ \n
    3.             if response:
    4. \n \n - \
    5. -        \               break
    6. \n \n
    7. \n - \ \n
    8.         if response is None:
    9. \n \n - \
    10. -        \           wrapped_callback = self.make_view_atomic(callback)
    11. \n - \ \n
    12.             try:
    13. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
      - ...
    \n \n
      \n \n
    1.             except
      -        Exception as e:
    2. \n \n
    3.                 response = self.process_exception_by_middleware(e,
      -        request)
    4. \n \n
    5. \n \n
    6.         #
      -        Complain if the view returned None (a common error).
    7. \n \n - \
    8. -        \       if response is None:
    9. \n \n
    10.             if
      -        isinstance(callback, types.FunctionType):    # FBV
    11. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7ff411a82050>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7ff427a8de10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7ff411a82050>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py - in wrapped_view\n\n \n
    \n \n
      \n \n
    1.     """
    2. \n - \ \n
    3.     Marks a view function as being exempt from
      -        the CSRF view protection.
    4. \n \n
    5.     """
    6. \n - \ \n
    7.     # We could just do view_func.csrf_exempt
      -        = True, but decorators
    8. \n \n
    9.     #
      -        are nicer if they don't have side-effects, so we return a new
    10. \n - \ \n
    11.     # function.
    12. \n \n - \
    13. -        \   def wrapped_view(*args, **kwargs):
    14. \n \n
    \n - \ \n
      \n
    1. \n        return
      -        view_func(*args, **kwargs)
      ...
    \n \n - \
      \n - \ \n
    1.     wrapped_view.csrf_exempt = True
    2. \n - \ \n
    3.     return wraps(view_func, assigned=available_attrs(view_func))(wrapped_view)
    4. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    args
    (<WSGIRequest: GET '/chirps/getDataRequestProgress/'>,)
    kwargs
    {}
    view_func
    <function getDataRequestProgress
    -        at 0x7ff411a7df50>
    \n \n
  • \n - \ \n \n
  • \n /data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress\n\n \n
    \n \n
      \n \n
    1.         if
      -        (progress == -1.0):
    2. \n \n
    3.             logger.warn("Problem with getDataRequestProgress:
      -        " + str(request))
    4. \n \n
    5.             return
      -        processCallBack(request, json.dumps([-1]), "application/json")
    6. \n - \ \n
    7.         else:
    8. \n \n - \
    9. -        \           return processCallBack(request, json.dumps([progress]), "application/json")
    10. \n - \ \n
    11.         ## return processCallBack(request,json.dumps([jsonresults['progress']]),"application/json")
    12. \n - \ \n
    13.     except Exception as e:
    14. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \       logger.warn("Problem with getDataRequestProgress: " + str(request)
      -        + " " + str(e.errno) + " " + str(e.strerror))
      ...
    \n - \ \n
      \n - \ \n
    1.         return processCallBack(request, json.dumps([-1]),
      -        "application/json")
    2. \n \n
    3. \n - \ \n
    4. \n \n
    5. @csrf_exempt
    6. \n - \ \n
    7. def getDataFromRequest(request):
    8. \n - \ \n
    9.     '''
    10. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    e
    MultiValueDictKeyError("'id'",)
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n
\n
\n \n
\n\n
\n \n - \ \n \n \n - \ \n

\n \n
\n
\n
\n\n\n\n
\n

Request information

\n\n\n \n

USER

\n - \

AnonymousUser

\n \n\n

GET

\n \n

No - GET data

\n \n\n

POST

\n \n

No POST data

\n - \ \n

FILES

\n \n

No FILES data

\n \n\n\n - \

COOKIES

\n \n

No cookie data

\n \n\n - \

META

\n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n
VariableValue
CONTEXT_DOCUMENT_ROOT
'/data/data/cserv/www/html'
CONTEXT_PREFIX
''
DOCUMENT_ROOT
'/data/data/cserv/www/html'
GATEWAY_INTERFACE
'CGI/1.1'
HTTP_ACCEPT
'application/json,
-        text/xml, application/xml, */*'
HTTP_ACCEPT_ENCODING
'gzip,
-        deflate'
HTTP_HOST
'climateserv.servirglobal.net'
HTTP_USER_AGENT
'libcurl/7.64.1 r-curl/4.3 crul/0.9.0'
PATH_INFO
u'/getDataRequestProgress/'
PATH_TRANSLATED
'/data/data/cserv/www/html/getDataRequestProgress/'
QUERY_STRING
''
REMOTE_ADDR
'122.199.27.9'
REMOTE_PORT
'37584'
REQUEST_METHOD
'GET'
REQUEST_SCHEME
'https'
REQUEST_URI
'/chirps/getDataRequestProgress/'
SCRIPT_FILENAME
'/data/data/cserv/pythonCode/servirchirpsdjango/servirchirpsdjango/wsgi.py'
SCRIPT_NAME
u'/chirps'
SERVER_ADDR
'10.5.5.21'
SERVER_ADMIN
'root@localhost'
SERVER_NAME
'climateserv.servirglobal.net'
SERVER_PORT
'443'
SERVER_PROTOCOL
'HTTP/1.1'
SERVER_SIGNATURE
'<address>Apache/2.4.18 (Ubuntu)
-        Server at climateserv.servirglobal.net Port 443</address>\\n'
SERVER_SOFTWARE
'Apache/2.4.18 (Ubuntu)'
SSL_TLS_SNI
'climateserv.servirglobal.net'
apache.version
(2,
-        4, 18)
mod_wsgi.application_group
'climateserv.servirglobal.net|/chirps'
mod_wsgi.callable_object
'application'
mod_wsgi.enable_sendfile
'0'
mod_wsgi.handler_script
''
mod_wsgi.input_chunked
'0'
mod_wsgi.listener_host
''
mod_wsgi.listener_port
'443'
mod_wsgi.process_group
''
mod_wsgi.request_handler
'wsgi-script'
mod_wsgi.request_start
'1582928800599845'
mod_wsgi.script_reloading
'1'
mod_wsgi.script_start
'1582928800600066'
mod_wsgi.version
(4,
-        3, 0)
wsgi.errors
<mod_wsgi.Log object at 0x7ff427ac6468>
wsgi.file_wrapper
''
wsgi.input
<mod_wsgi.Input
-        object at 0x7ff40db88170>
wsgi.multiprocess
True
wsgi.multithread
False
wsgi.run_once
False
wsgi.url_scheme
'https'
wsgi.version
(1,
-        0)
\n\n\n

Settings

\n

Using settings module servirchirpsdjango.settings

\n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \
SettingValue
ABSOLUTE_URL_OVERRIDES
{}
ADMINS
()
ALLOWED_HOSTS
['*']
APPEND_SLASH
True
AUTHENTICATION_BACKENDS
[u'django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS
u'********************'
AUTH_USER_MODEL
u'auth.User'
BASE_DIR
'/data/data/cserv/pythonCode/servirchirpsdjango'
CACHES
{u'default': {u'BACKEND': u'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS
u'default'
CACHE_MIDDLEWARE_KEY_PREFIX
u'********************'
CACHE_MIDDLEWARE_SECONDS
600
CORS_ORIGIN_ALLOW_ALL
True
CORS_ORIGIN_WHITELIST
('54.172.93.198',)
CSRF_COOKIE_AGE
31449600
CSRF_COOKIE_DOMAIN
None
CSRF_COOKIE_HTTPONLY
False
CSRF_COOKIE_NAME
u'csrftoken'
CSRF_COOKIE_PATH
u'/'
CSRF_COOKIE_SECURE
False
CSRF_FAILURE_VIEW
u'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME
u'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS
[]
CSRF_USE_SESSIONS
False
DATABASES
{'default': {'ATOMIC_REQUESTS': False,\n
-        \            'AUTOCOMMIT': True,\n             'CONN_MAX_AGE':
-        0,\n             'ENGINE': 'django.db.backends.sqlite3',\n
-        \            'HOST': '',\n             'NAME': '/data/data/cserv/pythonCode/servirchirpsdjango/sqlite.db',\n
-        \            'OPTIONS': {},\n             'PASSWORD': u'********************',\n
-        \            'PORT': '',\n             'TEST': {'CHARSET':
-        None,\n                      'COLLATION': None,\n                      'MIRROR':
-        None,\n                      'NAME': None},\n             'TIME_ZONE':
-        None,\n             'USER': ''}}
DATABASE_ROUTERS
[]
DATA_UPLOAD_MAX_MEMORY_SIZE
2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS
1000
DATETIME_FORMAT
u'N
-        j, Y, P'
DATETIME_INPUT_FORMATS
[u'%Y-%m-%d %H:%M:%S',\n u'%Y-%m-%d
-        %H:%M:%S.%f',\n u'%Y-%m-%d %H:%M',\n u'%Y-%m-%d',\n u'%m/%d/%Y
-        %H:%M:%S',\n u'%m/%d/%Y %H:%M:%S.%f',\n u'%m/%d/%Y %H:%M',\n
-        u'%m/%d/%Y',\n u'%m/%d/%y %H:%M:%S',\n u'%m/%d/%y %H:%M:%S.%f',\n
-        u'%m/%d/%y %H:%M',\n u'%m/%d/%y']
DATE_FORMAT
u'N
-        j, Y'
DATE_INPUT_FORMATS
[u'%Y-%m-%d',\n u'%m/%d/%Y',\n
-        u'%m/%d/%y',\n u'%b %d %Y',\n u'%b %d, %Y',\n u'%d
-        %b %Y',\n u'%d %b, %Y',\n u'%B %d %Y',\n u'%B %d,
-        %Y',\n u'%d %B %Y',\n u'%d %B, %Y']
DEBUG
True
DEBUG_PROPAGATE_EXCEPTIONS
False
DECIMAL_SEPARATOR
u'.'
DEFAULT_CHARSET
u'utf-8'
DEFAULT_CONTENT_TYPE
u'text/html'
DEFAULT_EXCEPTION_REPORTER_FILTER
u'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE
u'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL
u'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE
u''
DEFAULT_TABLESPACE
u''
DISALLOWED_USER_AGENTS
[]
EMAIL_BACKEND
u'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST
u'localhost'
EMAIL_HOST_PASSWORD
u'********************'
EMAIL_HOST_USER
u''
EMAIL_PORT
25
EMAIL_SSL_CERTFILE
None
EMAIL_SSL_KEYFILE
u'********************'
EMAIL_SUBJECT_PREFIX
u'[Django] '
EMAIL_TIMEOUT
None
EMAIL_USE_LOCALTIME
False
EMAIL_USE_SSL
False
EMAIL_USE_TLS
False
FILE_CHARSET
u'utf-8'
FILE_UPLOAD_DIRECTORY_PERMISSIONS
None
FILE_UPLOAD_HANDLERS
[u'django.core.files.uploadhandler.MemoryFileUploadHandler',\n
-        u'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
FILE_UPLOAD_PERMISSIONS
None
FILE_UPLOAD_TEMP_DIR
None
FIRST_DAY_OF_WEEK
0
FIXTURE_DIRS
[]
FORCE_SCRIPT_NAME
None
FORMAT_MODULE_PATH
None
FORM_RENDERER
u'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS
[]
INSTALLED_APPS
['polls',\n
-        'django.contrib.auth',\n 'django.contrib.contenttypes',\n
-        'django.contrib.sessions',\n 'django.contrib.sites',\n 'django.contrib.messages',\n
-        'django.contrib.staticfiles',\n 'servirchirps',\n 'corsheaders',\n
-        'django.contrib.admin',\n 'django.contrib.admindocs',\n 'pydash',\n
-        'servirmetrics']
INTERNAL_IPS
[]
LANGUAGES
[(u'af', u'Afrikaans'),\n (u'ar',
-        u'Arabic'),\n (u'ast', u'Asturian'),\n (u'az',
-        u'Azerbaijani'),\n (u'bg', u'Bulgarian'),\n (u'be',
-        u'Belarusian'),\n (u'bn', u'Bengali'),\n (u'br',
-        u'Breton'),\n (u'bs', u'Bosnian'),\n (u'ca',
-        u'Catalan'),\n (u'cs', u'Czech'),\n (u'cy',
-        u'Welsh'),\n (u'da', u'Danish'),\n (u'de',
-        u'German'),\n (u'dsb', u'Lower Sorbian'),\n (u'el',
-        u'Greek'),\n (u'en', u'English'),\n (u'en-au',
-        u'Australian English'),\n (u'en-gb', u'British English'),\n
-        (u'eo', u'Esperanto'),\n (u'es', u'Spanish'),\n
-        (u'es-ar', u'Argentinian Spanish'),\n (u'es-co', u'Colombian
-        Spanish'),\n (u'es-mx', u'Mexican Spanish'),\n (u'es-ni',
-        u'Nicaraguan Spanish'),\n (u'es-ve', u'Venezuelan Spanish'),\n
-        (u'et', u'Estonian'),\n (u'eu', u'Basque'),\n
-        (u'fa', u'Persian'),\n (u'fi', u'Finnish'),\n
-        (u'fr', u'French'),\n (u'fy', u'Frisian'),\n
-        (u'ga', u'Irish'),\n (u'gd', u'Scottish Gaelic'),\n
-        (u'gl', u'Galician'),\n (u'he', u'Hebrew'),\n
-        (u'hi', u'Hindi'),\n (u'hr', u'Croatian'),\n
-        (u'hsb', u'Upper Sorbian'),\n (u'hu', u'Hungarian'),\n
-        (u'ia', u'Interlingua'),\n (u'id', u'Indonesian'),\n
-        (u'io', u'Ido'),\n (u'is', u'Icelandic'),\n
-        (u'it', u'Italian'),\n (u'ja', u'Japanese'),\n
-        (u'ka', u'Georgian'),\n (u'kk', u'Kazakh'),\n
-        (u'km', u'Khmer'),\n (u'kn', u'Kannada'),\n
-        (u'ko', u'Korean'),\n (u'lb', u'Luxembourgish'),\n
-        (u'lt', u'Lithuanian'),\n (u'lv', u'Latvian'),\n
-        (u'mk', u'Macedonian'),\n (u'ml', u'Malayalam'),\n
-        (u'mn', u'Mongolian'),\n (u'mr', u'Marathi'),\n
-        (u'my', u'Burmese'),\n (u'nb', u'Norwegian Bokm\\xe5l'),\n
-        (u'ne', u'Nepali'),\n (u'nl', u'Dutch'),\n
-        (u'nn', u'Norwegian Nynorsk'),\n (u'os', u'Ossetic'),\n
-        (u'pa', u'Punjabi'),\n (u'pl', u'Polish'),\n
-        (u'pt', u'Portuguese'),\n (u'pt-br', u'Brazilian
-        Portuguese'),\n (u'ro', u'Romanian'),\n (u'ru',
-        u'Russian'),\n (u'sk', u'Slovak'),\n (u'sl',
-        u'Slovenian'),\n (u'sq', u'Albanian'),\n (u'sr',
-        u'Serbian'),\n (u'sr-latn', u'Serbian Latin'),\n (u'sv',
-        u'Swedish'),\n (u'sw', u'Swahili'),\n (u'ta',
-        u'Tamil'),\n (u'te', u'Telugu'),\n (u'th',
-        u'Thai'),\n (u'tr', u'Turkish'),\n (u'tt',
-        u'Tatar'),\n (u'udm', u'Udmurt'),\n (u'uk',
-        u'Ukrainian'),\n (u'ur', u'Urdu'),\n (u'vi',
-        u'Vietnamese'),\n (u'zh-hans', u'Simplified Chinese'),\n
-        (u'zh-hant', u'Traditional Chinese')]
LANGUAGES_BIDI
[u'he',
-        u'ar', u'fa', u'ur']
LANGUAGE_CODE
'en-us'
LANGUAGE_COOKIE_AGE
None
LANGUAGE_COOKIE_DOMAIN
None
LANGUAGE_COOKIE_NAME
u'django_language'
LANGUAGE_COOKIE_PATH
u'/'
LOCALE_PATHS
[]
LOGGING
{'disable_existing_loggers': True,\n 'filters':
-        {},\n 'formatters': {'simple': {'format': '%(levelname)s,
-        %(message)s'},\n                'verbose': {'format':
-        '%(levelname)s, %(asctime)s, %(module)s, %(process)d, %(thread)d, %(message)s'}},\n
-        'handlers': {'console': {'class': 'logging.StreamHandler',\n
-        \                         'formatter': 'simple',\n                          'level':
-        'DEBUG'},\n              'log_file_chirps': {'class':
-        'logging.handlers.RotatingFileHandler',\n                                  'filename':
-        '/data/data/cserv/chirps.log',\n                                  'formatter':
-        'verbose',\n                                  'level': 'DEBUG',\n
-        \                                 'maxBytes': '16777216'},\n
-        \             'log_file_metrics': {'backupCount': '10',\n
-        \                                  'class': 'logging.handlers.RotatingFileHandler',\n
-        \                                  'filename': '/data/data/logs/metrics/metrics.log',\n
-        \                                  'formatter': 'verbose',\n
-        \                                  'level': 'INFO',\n                                   'maxBytes':
-        '100000000'}},\n 'loggers': {'CHIRPS': {'handlers':
-        ['log_file_chirps'],\n                        'level': 'INFO',\n
-        \                       'propagate': False},\n             'metrics_logger':
-        {'handlers': ['log_file_metrics'],\n                                'level':
-        'INFO'},\n             'servirchirps': {'handlers':
-        ['log_file_chirps'],\n                              'level':
-        'INFO',\n                              'propagate': False}},\n
-        'version': 1}
LOGGING_CONFIG
u'logging.config.dictConfig'
LOGIN_REDIRECT_URL
u'/accounts/profile/'
LOGIN_URL
u'/accounts/login/'
LOGOUT_REDIRECT_URL
None
MANAGERS
()
MEDIA_ROOT
''
MEDIA_URL
''
MESSAGE_STORAGE
u'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE
None
MIDDLEWARE_CLASSES
('corsheaders.middleware.CorsMiddleware',\n
-        'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n
-        'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n
-        'django.contrib.messages.middleware.MessageMiddleware',\n 'servirchirpsdjango.middleware.MetricsTracking')
MIGRATION_MODULES
{}
MONTH_DAY_FORMAT
u'F
-        j'
NUMBER_GROUPING
0
PASSWORD_HASHERS
u'********************'
PASSWORD_RESET_TIMEOUT_DAYS
u'********************'
PREPEND_WWW
False
ROOT_URLCONF
'servirchirpsdjango.urls'
SECRET_KEY
u'********************'
SECURE_BROWSER_XSS_FILTER
False
SECURE_CONTENT_TYPE_NOSNIFF
False
SECURE_HSTS_INCLUDE_SUBDOMAINS
False
SECURE_HSTS_PRELOAD
False
SECURE_HSTS_SECONDS
0
SECURE_PROXY_SSL_HEADER
None
SECURE_REDIRECT_EXEMPT
[]
SECURE_SSL_HOST
None
SECURE_SSL_REDIRECT
False
SERVER_EMAIL
u'root@localhost'
SESSION_CACHE_ALIAS
u'default'
SESSION_COOKIE_AGE
1209600
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_HTTPONLY
True
SESSION_COOKIE_NAME
u'sessionid'
SESSION_COOKIE_PATH
u'/'
SESSION_COOKIE_SECURE
False
SESSION_ENGINE
u'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
SESSION_FILE_PATH
None
SESSION_SAVE_EVERY_REQUEST
False
SESSION_SERIALIZER
u'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE
'servirchirpsdjango.settings'
SHORT_DATETIME_FORMAT
u'm/d/Y P'
SHORT_DATE_FORMAT
u'm/d/Y'
SIGNING_BACKEND
u'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS
[]
SITE_ID
1
STATICFILES_DIRS
()
STATICFILES_FINDERS
('django.contrib.staticfiles.finders.FileSystemFinder',\n
-        'django.contrib.staticfiles.finders.AppDirectoriesFinder')
STATICFILES_STORAGE
u'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT
'/data/data/cserv/static/'
STATIC_URL
'/static/'
TEMPLATES
[{'APP_DIRS': True,\n  'BACKEND': 'django.template.backends.django.DjangoTemplates',\n
-        \ 'DIRS': ['/data/data/cserv/pythonCode/servirchirpsdjango/templates'],\n
-        \ 'OPTIONS': {'context_processors': ['django.template.context_processors.debug',\n
-        \                                    'django.template.context_processors.request',\n
-        \                                    'django.contrib.auth.context_processors.auth',\n
-        \                                    'django.contrib.messages.context_processors.messages'],\n
-        \             'debug': False}}]
TEST_NON_SERIALIZED_APPS
[]
TEST_RUNNER
u'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR
u','
TIME_FORMAT
u'P'
TIME_INPUT_FORMATS
[u'%H:%M:%S', u'%H:%M:%S.%f',
-        u'%H:%M']
TIME_ZONE
'America/Chicago'
USE_ETAGS
False
USE_I18N
True
USE_L10N
True
USE_THOUSAND_SEPARATOR
False
USE_TZ
True
USE_X_FORWARDED_HOST
False
USE_X_FORWARDED_PORT
False
WSGI_APPLICATION
'servirchirpsdjango.wsgi.application'
X_FRAME_OPTIONS
u'SAMEORIGIN'
YEAR_MONTH_FORMAT
u'F Y'
\n\n
\n\n
\n

\n You're - seeing this error because you have DEBUG = True in your\n Django - settings file. Change that to False, and Django will\n display - a standard page generated by the handler for this status code.\n

\n - \
\n\n\n\n" - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=50d8d0c9-5bc9-4ec7-8fa8-14875c698fa1 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:41 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=50d8d0c9-5bc9-4ec7-8fa8-14875c698fa1 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:42 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:43 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=d51298c9-1b2a-40d4-981f-c57d708f8795 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:43 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "cee16050-c9c8-4b3d-9289-79ff2807fea7", - "epochTime": "946684800", "value": {"avg": 9.255108833312988}}, {"date": "1/2/2000", - "workid": "f2386154-0003-47ce-8d33-6a1578d23d41", "epochTime": "946771200", - "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "7ae2a87a-7ae4-41f8-9b51-5c013408fde8", - "epochTime": "946857600", "value": {"avg": 0.0}}, {"date": "1/4/2000", "workid": - "9887000f-a72f-4024-bbc8-da97c5f9e4fa", "epochTime": "946944000", "value": - {"avg": 0.0}}, {"date": "1/5/2000", "workid": "604a6ad4-a96f-4213-9ff2-ca9f10b8f23c", - "epochTime": "947030400", "value": {"avg": 18.510217666625977}}]}' - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=d51298c9-1b2a-40d4-981f-c57d708f8795 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:44 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "cee16050-c9c8-4b3d-9289-79ff2807fea7", - "epochTime": "946684800", "value": {"avg": 9.255108833312988}}, {"date": "1/2/2000", - "workid": "f2386154-0003-47ce-8d33-6a1578d23d41", "epochTime": "946771200", - "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "7ae2a87a-7ae4-41f8-9b51-5c013408fde8", - "epochTime": "946857600", "value": {"avg": 0.0}}, {"date": "1/4/2000", "workid": - "9887000f-a72f-4024-bbc8-da97c5f9e4fa", "epochTime": "946944000", "value": - {"avg": 0.0}}, {"date": "1/5/2000", "workid": "604a6ad4-a96f-4213-9ff2-ca9f10b8f23c", - "epochTime": "947030400", "value": {"avg": 18.510217666625977}}]}' - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:45 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=50d8d0c9-5bc9-4ec7-8fa8-14875c698fa1 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:45 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "e752620f-2376-4eef-bfeb-471496fe7909", - "epochTime": "946684800", "value": {"avg": 38.354225158691406}}, {"date": - "1/2/2000", "workid": "3af1779a-68c9-4f53-8ef9-58e6a8f72398", "epochTime": - "946771200", "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "adcbfd29-1534-4590-a648-3faf46195222", - "epochTime": "946857600", "value": {"avg": 38.354225158691406}}, {"date": - "1/4/2000", "workid": "329f08a9-c71a-418c-9c3c-5fe37b1c0004", "epochTime": - "946944000", "value": {"avg": 0.0}}, {"date": "1/5/2000", "workid": "3ec266f0-2dac-4fb2-b06b-fae8d51a4508", - "epochTime": "947030400", "value": {"avg": 0.0}}]}' - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=50d8d0c9-5bc9-4ec7-8fa8-14875c698fa1 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:46 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "e752620f-2376-4eef-bfeb-471496fe7909", - "epochTime": "946684800", "value": {"avg": 38.354225158691406}}, {"date": - "1/2/2000", "workid": "3af1779a-68c9-4f53-8ef9-58e6a8f72398", "epochTime": - "946771200", "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "adcbfd29-1534-4590-a648-3faf46195222", - "epochTime": "946857600", "value": {"avg": 38.354225158691406}}, {"date": - "1/4/2000", "workid": "329f08a9-c71a-418c-9c3c-5fe37b1c0004", "epochTime": - "946944000", "value": {"avg": 0.0}}, {"date": "1/5/2000", "workid": "3ec266f0-2dac-4fb2-b06b-fae8d51a4508", - "epochTime": "947030400", "value": {"avg": 0.0}}]}' - recorded_at: 2020-02-28 22:26:45 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 diff --git a/tests/fixtures/vcr_cassettes/get_esi.yml b/tests/fixtures/vcr_cassettes/get_esi.yml deleted file mode 100644 index ea346f2..0000000 --- a/tests/fixtures/vcr_cassettes/get_esi.yml +++ /dev/null @@ -1,2257 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:47 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:47 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["676a574d-4915-4b89-abf5-30dfbc55fa6b"]) - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:48 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:49 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["c4da5a22-2cad-44b6-b1b5-0df577d82458"]) - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Fri, 28 Feb 2020 22:26:50 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '72338' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string: "\n\n\n\n \n \n - \ AttributeError at /getDataRequestProgress/\n \n \n \n - \ \n\n\n
\n

AttributeError at /getDataRequestProgress/

\n - \
'MultiValueDictKeyError' object has
-        no attribute 'errno'
\n \n\n \n - \ \n \n \n \n - \ \n \n - \ \n\n \n \n \n - \ \n\n \n \n \n - \ \n\n\n \n \n \n \n\n\n \n - \ \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n - \ \n \n \n \n \n
Request Method:GET
Request URL:https://climateserv.servirglobal.net/chirps/getDataRequestProgress/
Django Version:1.11
Exception Type:AttributeError
Exception Value:
'MultiValueDictKeyError'
-        object has no attribute 'errno'
Exception Location:/data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress, line 765
Python - Executable:/usr/bin/python
Python - Version:2.7.12
Python - Path:
['/data/data/cserv/pythonCode/servirchirpsdjango',\n
-        '/usr/lib/python2.7',\n '/usr/lib/python2.7/plat-x86_64-linux-gnu',\n
-        '/usr/lib/python2.7/lib-tk',\n '/usr/lib/python2.7/lib-old',\n
-        '/usr/lib/python2.7/lib-dynload',\n '/usr/local/lib/python2.7/dist-packages',\n
-        '/usr/lib/python2.7/dist-packages',\n '/data/data/cserv/pythonCode/serviringest']
Server time:Fri, 28 Feb 2020 - 16:26:50 -0600
\n
\n\n\n\n\n
\n - \

Traceback \n - \ Switch to copy-and-paste view\n

\n \n
\n - \
    \n \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py - in inner\n\n \n
    \n - \ \n
      \n - \ \n
    1.     This decorator is automatically applied
      -        to all middleware to ensure that
    2. \n \n
    3.     no
      -        middleware leaks an exception and that the next middleware in the stack
    4. \n - \ \n
    5.     can rely on getting a response instead of
      -        an exception.
    6. \n \n
    7.     """
    8. \n \n - \
    9. -        \   @wraps(get_response, assigned=available_attrs(get_response))
    10. \n - \ \n
    11.     def inner(request):
    12. \n \n - \
    13. -        \       try:
    14. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         except Exception as exc:
    2. \n - \ \n
    3.             response = response_for_exception(request,
      -        exc)
    4. \n \n
    5.         return response
    6. \n \n - \
    7. -        \   return inner
    8. \n \n
    9. \n \n
    10. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    exc
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    get_response
    <bound method WSGIHandler._legacy_get_response
    -        of <django.core.handlers.wsgi.WSGIHandler object at 0x7ff4283b19d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _legacy_get_response\n\n \n
    \n \n
      \n \n
    1.         #
      -        Apply request middleware
    2. \n \n
    3.         for
      -        middleware_method in self._request_middleware:
    4. \n \n - \
    5. -        \           response = middleware_method(request)
    6. \n \n - \
    7. -        \           if response:
    8. \n \n
    9.                 break
    10. \n - \ \n
    11. \n \n
    12.         if
      -        response is None:
    13. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = self._get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         return response
    2. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    middleware_method
    <bound method MessageMiddleware.process_request
    -        of <django.contrib.messages.middleware.MessageMiddleware object at 0x7ff427a933d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    \n \n
  • \n - \ \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.                 break
    2. \n - \ \n
    3. \n \n
    4.         if
      -        response is None:
    5. \n \n
    6.             wrapped_callback = self.make_view_atomic(callback)
    7. \n - \ \n
    8.             try:
    9. \n \n - \
    10. -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
    11. \n - \ \n
    12.             except Exception as e:
    13. \n - \ \n
    \n \n
      \n
    1. \n                response = self.process_exception_by_middleware(e,
      -        request)
      ...
    \n \n
      \n \n - \
    1. \n - \ \n
    2.         # Complain if the view returned None
      -        (a common error).
    3. \n \n
    4.         if response is None:
    5. \n \n - \
    6. -        \           if isinstance(callback, types.FunctionType):    # FBV
    7. \n - \ \n
    8.                 view_name = callback.__name__
    9. \n - \ \n
    10.             else:                                           #
      -        CBV
    11. \n \n
    \n \n - \
    \n \n\n \n
    \n - \ \n Local vars\n \n - \
    \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7ff411a82050>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7ff427a8de10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7ff411a82050>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.             response
      -        = middleware_method(request, callback, callback_args, callback_kwargs)
    2. \n - \ \n
    3.             if response:
    4. \n \n - \
    5. -        \               break
    6. \n \n
    7. \n - \ \n
    8.         if response is None:
    9. \n \n - \
    10. -        \           wrapped_callback = self.make_view_atomic(callback)
    11. \n - \ \n
    12.             try:
    13. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
      - ...
    \n \n
      \n \n
    1.             except
      -        Exception as e:
    2. \n \n
    3.                 response = self.process_exception_by_middleware(e,
      -        request)
    4. \n \n
    5. \n \n
    6.         #
      -        Complain if the view returned None (a common error).
    7. \n \n - \
    8. -        \       if response is None:
    9. \n \n
    10.             if
      -        isinstance(callback, types.FunctionType):    # FBV
    11. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7ff411a82050>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7ff427a8de10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7ff411a82050>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py - in wrapped_view\n\n \n
    \n \n
      \n \n
    1.     """
    2. \n - \ \n
    3.     Marks a view function as being exempt from
      -        the CSRF view protection.
    4. \n \n
    5.     """
    6. \n - \ \n
    7.     # We could just do view_func.csrf_exempt
      -        = True, but decorators
    8. \n \n
    9.     #
      -        are nicer if they don't have side-effects, so we return a new
    10. \n - \ \n
    11.     # function.
    12. \n \n - \
    13. -        \   def wrapped_view(*args, **kwargs):
    14. \n \n
    \n - \ \n
      \n
    1. \n        return
      -        view_func(*args, **kwargs)
      ...
    \n \n - \
      \n - \ \n
    1.     wrapped_view.csrf_exempt = True
    2. \n - \ \n
    3.     return wraps(view_func, assigned=available_attrs(view_func))(wrapped_view)
    4. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    args
    (<WSGIRequest: GET '/chirps/getDataRequestProgress/'>,)
    kwargs
    {}
    view_func
    <function getDataRequestProgress
    -        at 0x7ff411a7df50>
    \n \n
  • \n - \ \n \n
  • \n /data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress\n\n \n
    \n \n
      \n \n
    1.         if
      -        (progress == -1.0):
    2. \n \n
    3.             logger.warn("Problem with getDataRequestProgress:
      -        " + str(request))
    4. \n \n
    5.             return
      -        processCallBack(request, json.dumps([-1]), "application/json")
    6. \n - \ \n
    7.         else:
    8. \n \n - \
    9. -        \           return processCallBack(request, json.dumps([progress]), "application/json")
    10. \n - \ \n
    11.         ## return processCallBack(request,json.dumps([jsonresults['progress']]),"application/json")
    12. \n - \ \n
    13.     except Exception as e:
    14. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \       logger.warn("Problem with getDataRequestProgress: " + str(request)
      -        + " " + str(e.errno) + " " + str(e.strerror))
      ...
    \n - \ \n
      \n - \ \n
    1.         return processCallBack(request, json.dumps([-1]),
      -        "application/json")
    2. \n \n
    3. \n - \ \n
    4. \n \n
    5. @csrf_exempt
    6. \n - \ \n
    7. def getDataFromRequest(request):
    8. \n - \ \n
    9.     '''
    10. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    e
    MultiValueDictKeyError("'id'",)
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n
\n
\n \n
\n\n
\n \n - \ \n \n \n - \ \n

\n \n
\n
\n
\n\n\n\n
\n

Request information

\n\n\n \n

USER

\n - \

AnonymousUser

\n \n\n

GET

\n \n

No - GET data

\n \n\n

POST

\n \n

No POST data

\n - \ \n

FILES

\n \n

No FILES data

\n \n\n\n - \

COOKIES

\n \n

No cookie data

\n \n\n - \

META

\n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n
VariableValue
CONTEXT_DOCUMENT_ROOT
'/data/data/cserv/www/html'
CONTEXT_PREFIX
''
DOCUMENT_ROOT
'/data/data/cserv/www/html'
GATEWAY_INTERFACE
'CGI/1.1'
HTTP_ACCEPT
'application/json,
-        text/xml, application/xml, */*'
HTTP_ACCEPT_ENCODING
'gzip,
-        deflate'
HTTP_HOST
'climateserv.servirglobal.net'
HTTP_USER_AGENT
'libcurl/7.64.1 r-curl/4.3 crul/0.9.0'
PATH_INFO
u'/getDataRequestProgress/'
PATH_TRANSLATED
'/data/data/cserv/www/html/getDataRequestProgress/'
QUERY_STRING
''
REMOTE_ADDR
'122.199.27.9'
REMOTE_PORT
'43354'
REQUEST_METHOD
'GET'
REQUEST_SCHEME
'https'
REQUEST_URI
'/chirps/getDataRequestProgress/'
SCRIPT_FILENAME
'/data/data/cserv/pythonCode/servirchirpsdjango/servirchirpsdjango/wsgi.py'
SCRIPT_NAME
u'/chirps'
SERVER_ADDR
'10.5.5.21'
SERVER_ADMIN
'root@localhost'
SERVER_NAME
'climateserv.servirglobal.net'
SERVER_PORT
'443'
SERVER_PROTOCOL
'HTTP/1.1'
SERVER_SIGNATURE
'<address>Apache/2.4.18 (Ubuntu)
-        Server at climateserv.servirglobal.net Port 443</address>\\n'
SERVER_SOFTWARE
'Apache/2.4.18 (Ubuntu)'
SSL_TLS_SNI
'climateserv.servirglobal.net'
apache.version
(2,
-        4, 18)
mod_wsgi.application_group
'climateserv.servirglobal.net|/chirps'
mod_wsgi.callable_object
'application'
mod_wsgi.enable_sendfile
'0'
mod_wsgi.handler_script
''
mod_wsgi.input_chunked
'0'
mod_wsgi.listener_host
''
mod_wsgi.listener_port
'443'
mod_wsgi.process_group
''
mod_wsgi.request_handler
'wsgi-script'
mod_wsgi.request_start
'1582928810035806'
mod_wsgi.script_reloading
'1'
mod_wsgi.script_start
'1582928810036015'
mod_wsgi.version
(4,
-        3, 0)
wsgi.errors
<mod_wsgi.Log object at 0x7ff40dc2d420>
wsgi.file_wrapper
''
wsgi.input
<mod_wsgi.Input
-        object at 0x7ff40d9a4330>
wsgi.multiprocess
True
wsgi.multithread
False
wsgi.run_once
False
wsgi.url_scheme
'https'
wsgi.version
(1,
-        0)
\n\n\n

Settings

\n

Using settings module servirchirpsdjango.settings

\n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \
SettingValue
ABSOLUTE_URL_OVERRIDES
{}
ADMINS
()
ALLOWED_HOSTS
['*']
APPEND_SLASH
True
AUTHENTICATION_BACKENDS
[u'django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS
u'********************'
AUTH_USER_MODEL
u'auth.User'
BASE_DIR
'/data/data/cserv/pythonCode/servirchirpsdjango'
CACHES
{u'default': {u'BACKEND': u'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS
u'default'
CACHE_MIDDLEWARE_KEY_PREFIX
u'********************'
CACHE_MIDDLEWARE_SECONDS
600
CORS_ORIGIN_ALLOW_ALL
True
CORS_ORIGIN_WHITELIST
('54.172.93.198',)
CSRF_COOKIE_AGE
31449600
CSRF_COOKIE_DOMAIN
None
CSRF_COOKIE_HTTPONLY
False
CSRF_COOKIE_NAME
u'csrftoken'
CSRF_COOKIE_PATH
u'/'
CSRF_COOKIE_SECURE
False
CSRF_FAILURE_VIEW
u'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME
u'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS
[]
CSRF_USE_SESSIONS
False
DATABASES
{'default': {'ATOMIC_REQUESTS': False,\n
-        \            'AUTOCOMMIT': True,\n             'CONN_MAX_AGE':
-        0,\n             'ENGINE': 'django.db.backends.sqlite3',\n
-        \            'HOST': '',\n             'NAME': '/data/data/cserv/pythonCode/servirchirpsdjango/sqlite.db',\n
-        \            'OPTIONS': {},\n             'PASSWORD': u'********************',\n
-        \            'PORT': '',\n             'TEST': {'CHARSET':
-        None,\n                      'COLLATION': None,\n                      'MIRROR':
-        None,\n                      'NAME': None},\n             'TIME_ZONE':
-        None,\n             'USER': ''}}
DATABASE_ROUTERS
[]
DATA_UPLOAD_MAX_MEMORY_SIZE
2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS
1000
DATETIME_FORMAT
u'N
-        j, Y, P'
DATETIME_INPUT_FORMATS
[u'%Y-%m-%d %H:%M:%S',\n u'%Y-%m-%d
-        %H:%M:%S.%f',\n u'%Y-%m-%d %H:%M',\n u'%Y-%m-%d',\n u'%m/%d/%Y
-        %H:%M:%S',\n u'%m/%d/%Y %H:%M:%S.%f',\n u'%m/%d/%Y %H:%M',\n
-        u'%m/%d/%Y',\n u'%m/%d/%y %H:%M:%S',\n u'%m/%d/%y %H:%M:%S.%f',\n
-        u'%m/%d/%y %H:%M',\n u'%m/%d/%y']
DATE_FORMAT
u'N
-        j, Y'
DATE_INPUT_FORMATS
[u'%Y-%m-%d',\n u'%m/%d/%Y',\n
-        u'%m/%d/%y',\n u'%b %d %Y',\n u'%b %d, %Y',\n u'%d
-        %b %Y',\n u'%d %b, %Y',\n u'%B %d %Y',\n u'%B %d,
-        %Y',\n u'%d %B %Y',\n u'%d %B, %Y']
DEBUG
True
DEBUG_PROPAGATE_EXCEPTIONS
False
DECIMAL_SEPARATOR
u'.'
DEFAULT_CHARSET
u'utf-8'
DEFAULT_CONTENT_TYPE
u'text/html'
DEFAULT_EXCEPTION_REPORTER_FILTER
u'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE
u'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL
u'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE
u''
DEFAULT_TABLESPACE
u''
DISALLOWED_USER_AGENTS
[]
EMAIL_BACKEND
u'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST
u'localhost'
EMAIL_HOST_PASSWORD
u'********************'
EMAIL_HOST_USER
u''
EMAIL_PORT
25
EMAIL_SSL_CERTFILE
None
EMAIL_SSL_KEYFILE
u'********************'
EMAIL_SUBJECT_PREFIX
u'[Django] '
EMAIL_TIMEOUT
None
EMAIL_USE_LOCALTIME
False
EMAIL_USE_SSL
False
EMAIL_USE_TLS
False
FILE_CHARSET
u'utf-8'
FILE_UPLOAD_DIRECTORY_PERMISSIONS
None
FILE_UPLOAD_HANDLERS
[u'django.core.files.uploadhandler.MemoryFileUploadHandler',\n
-        u'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
FILE_UPLOAD_PERMISSIONS
None
FILE_UPLOAD_TEMP_DIR
None
FIRST_DAY_OF_WEEK
0
FIXTURE_DIRS
[]
FORCE_SCRIPT_NAME
None
FORMAT_MODULE_PATH
None
FORM_RENDERER
u'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS
[]
INSTALLED_APPS
['polls',\n
-        'django.contrib.auth',\n 'django.contrib.contenttypes',\n
-        'django.contrib.sessions',\n 'django.contrib.sites',\n 'django.contrib.messages',\n
-        'django.contrib.staticfiles',\n 'servirchirps',\n 'corsheaders',\n
-        'django.contrib.admin',\n 'django.contrib.admindocs',\n 'pydash',\n
-        'servirmetrics']
INTERNAL_IPS
[]
LANGUAGES
[(u'af', u'Afrikaans'),\n (u'ar',
-        u'Arabic'),\n (u'ast', u'Asturian'),\n (u'az',
-        u'Azerbaijani'),\n (u'bg', u'Bulgarian'),\n (u'be',
-        u'Belarusian'),\n (u'bn', u'Bengali'),\n (u'br',
-        u'Breton'),\n (u'bs', u'Bosnian'),\n (u'ca',
-        u'Catalan'),\n (u'cs', u'Czech'),\n (u'cy',
-        u'Welsh'),\n (u'da', u'Danish'),\n (u'de',
-        u'German'),\n (u'dsb', u'Lower Sorbian'),\n (u'el',
-        u'Greek'),\n (u'en', u'English'),\n (u'en-au',
-        u'Australian English'),\n (u'en-gb', u'British English'),\n
-        (u'eo', u'Esperanto'),\n (u'es', u'Spanish'),\n
-        (u'es-ar', u'Argentinian Spanish'),\n (u'es-co', u'Colombian
-        Spanish'),\n (u'es-mx', u'Mexican Spanish'),\n (u'es-ni',
-        u'Nicaraguan Spanish'),\n (u'es-ve', u'Venezuelan Spanish'),\n
-        (u'et', u'Estonian'),\n (u'eu', u'Basque'),\n
-        (u'fa', u'Persian'),\n (u'fi', u'Finnish'),\n
-        (u'fr', u'French'),\n (u'fy', u'Frisian'),\n
-        (u'ga', u'Irish'),\n (u'gd', u'Scottish Gaelic'),\n
-        (u'gl', u'Galician'),\n (u'he', u'Hebrew'),\n
-        (u'hi', u'Hindi'),\n (u'hr', u'Croatian'),\n
-        (u'hsb', u'Upper Sorbian'),\n (u'hu', u'Hungarian'),\n
-        (u'ia', u'Interlingua'),\n (u'id', u'Indonesian'),\n
-        (u'io', u'Ido'),\n (u'is', u'Icelandic'),\n
-        (u'it', u'Italian'),\n (u'ja', u'Japanese'),\n
-        (u'ka', u'Georgian'),\n (u'kk', u'Kazakh'),\n
-        (u'km', u'Khmer'),\n (u'kn', u'Kannada'),\n
-        (u'ko', u'Korean'),\n (u'lb', u'Luxembourgish'),\n
-        (u'lt', u'Lithuanian'),\n (u'lv', u'Latvian'),\n
-        (u'mk', u'Macedonian'),\n (u'ml', u'Malayalam'),\n
-        (u'mn', u'Mongolian'),\n (u'mr', u'Marathi'),\n
-        (u'my', u'Burmese'),\n (u'nb', u'Norwegian Bokm\\xe5l'),\n
-        (u'ne', u'Nepali'),\n (u'nl', u'Dutch'),\n
-        (u'nn', u'Norwegian Nynorsk'),\n (u'os', u'Ossetic'),\n
-        (u'pa', u'Punjabi'),\n (u'pl', u'Polish'),\n
-        (u'pt', u'Portuguese'),\n (u'pt-br', u'Brazilian
-        Portuguese'),\n (u'ro', u'Romanian'),\n (u'ru',
-        u'Russian'),\n (u'sk', u'Slovak'),\n (u'sl',
-        u'Slovenian'),\n (u'sq', u'Albanian'),\n (u'sr',
-        u'Serbian'),\n (u'sr-latn', u'Serbian Latin'),\n (u'sv',
-        u'Swedish'),\n (u'sw', u'Swahili'),\n (u'ta',
-        u'Tamil'),\n (u'te', u'Telugu'),\n (u'th',
-        u'Thai'),\n (u'tr', u'Turkish'),\n (u'tt',
-        u'Tatar'),\n (u'udm', u'Udmurt'),\n (u'uk',
-        u'Ukrainian'),\n (u'ur', u'Urdu'),\n (u'vi',
-        u'Vietnamese'),\n (u'zh-hans', u'Simplified Chinese'),\n
-        (u'zh-hant', u'Traditional Chinese')]
LANGUAGES_BIDI
[u'he',
-        u'ar', u'fa', u'ur']
LANGUAGE_CODE
'en-us'
LANGUAGE_COOKIE_AGE
None
LANGUAGE_COOKIE_DOMAIN
None
LANGUAGE_COOKIE_NAME
u'django_language'
LANGUAGE_COOKIE_PATH
u'/'
LOCALE_PATHS
[]
LOGGING
{'disable_existing_loggers': True,\n 'filters':
-        {},\n 'formatters': {'simple': {'format': '%(levelname)s,
-        %(message)s'},\n                'verbose': {'format':
-        '%(levelname)s, %(asctime)s, %(module)s, %(process)d, %(thread)d, %(message)s'}},\n
-        'handlers': {'console': {'class': 'logging.StreamHandler',\n
-        \                         'formatter': 'simple',\n                          'level':
-        'DEBUG'},\n              'log_file_chirps': {'class':
-        'logging.handlers.RotatingFileHandler',\n                                  'filename':
-        '/data/data/cserv/chirps.log',\n                                  'formatter':
-        'verbose',\n                                  'level': 'DEBUG',\n
-        \                                 'maxBytes': '16777216'},\n
-        \             'log_file_metrics': {'backupCount': '10',\n
-        \                                  'class': 'logging.handlers.RotatingFileHandler',\n
-        \                                  'filename': '/data/data/logs/metrics/metrics.log',\n
-        \                                  'formatter': 'verbose',\n
-        \                                  'level': 'INFO',\n                                   'maxBytes':
-        '100000000'}},\n 'loggers': {'CHIRPS': {'handlers':
-        ['log_file_chirps'],\n                        'level': 'INFO',\n
-        \                       'propagate': False},\n             'metrics_logger':
-        {'handlers': ['log_file_metrics'],\n                                'level':
-        'INFO'},\n             'servirchirps': {'handlers':
-        ['log_file_chirps'],\n                              'level':
-        'INFO',\n                              'propagate': False}},\n
-        'version': 1}
LOGGING_CONFIG
u'logging.config.dictConfig'
LOGIN_REDIRECT_URL
u'/accounts/profile/'
LOGIN_URL
u'/accounts/login/'
LOGOUT_REDIRECT_URL
None
MANAGERS
()
MEDIA_ROOT
''
MEDIA_URL
''
MESSAGE_STORAGE
u'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE
None
MIDDLEWARE_CLASSES
('corsheaders.middleware.CorsMiddleware',\n
-        'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n
-        'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n
-        'django.contrib.messages.middleware.MessageMiddleware',\n 'servirchirpsdjango.middleware.MetricsTracking')
MIGRATION_MODULES
{}
MONTH_DAY_FORMAT
u'F
-        j'
NUMBER_GROUPING
0
PASSWORD_HASHERS
u'********************'
PASSWORD_RESET_TIMEOUT_DAYS
u'********************'
PREPEND_WWW
False
ROOT_URLCONF
'servirchirpsdjango.urls'
SECRET_KEY
u'********************'
SECURE_BROWSER_XSS_FILTER
False
SECURE_CONTENT_TYPE_NOSNIFF
False
SECURE_HSTS_INCLUDE_SUBDOMAINS
False
SECURE_HSTS_PRELOAD
False
SECURE_HSTS_SECONDS
0
SECURE_PROXY_SSL_HEADER
None
SECURE_REDIRECT_EXEMPT
[]
SECURE_SSL_HOST
None
SECURE_SSL_REDIRECT
False
SERVER_EMAIL
u'root@localhost'
SESSION_CACHE_ALIAS
u'default'
SESSION_COOKIE_AGE
1209600
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_HTTPONLY
True
SESSION_COOKIE_NAME
u'sessionid'
SESSION_COOKIE_PATH
u'/'
SESSION_COOKIE_SECURE
False
SESSION_ENGINE
u'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
SESSION_FILE_PATH
None
SESSION_SAVE_EVERY_REQUEST
False
SESSION_SERIALIZER
u'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE
'servirchirpsdjango.settings'
SHORT_DATETIME_FORMAT
u'm/d/Y P'
SHORT_DATE_FORMAT
u'm/d/Y'
SIGNING_BACKEND
u'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS
[]
SITE_ID
1
STATICFILES_DIRS
()
STATICFILES_FINDERS
('django.contrib.staticfiles.finders.FileSystemFinder',\n
-        'django.contrib.staticfiles.finders.AppDirectoriesFinder')
STATICFILES_STORAGE
u'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT
'/data/data/cserv/static/'
STATIC_URL
'/static/'
TEMPLATES
[{'APP_DIRS': True,\n  'BACKEND': 'django.template.backends.django.DjangoTemplates',\n
-        \ 'DIRS': ['/data/data/cserv/pythonCode/servirchirpsdjango/templates'],\n
-        \ 'OPTIONS': {'context_processors': ['django.template.context_processors.debug',\n
-        \                                    'django.template.context_processors.request',\n
-        \                                    'django.contrib.auth.context_processors.auth',\n
-        \                                    'django.contrib.messages.context_processors.messages'],\n
-        \             'debug': False}}]
TEST_NON_SERIALIZED_APPS
[]
TEST_RUNNER
u'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR
u','
TIME_FORMAT
u'P'
TIME_INPUT_FORMATS
[u'%H:%M:%S', u'%H:%M:%S.%f',
-        u'%H:%M']
TIME_ZONE
'America/Chicago'
USE_ETAGS
False
USE_I18N
True
USE_L10N
True
USE_THOUSAND_SEPARATOR
False
USE_TZ
True
USE_X_FORWARDED_HOST
False
USE_X_FORWARDED_PORT
False
WSGI_APPLICATION
'servirchirpsdjango.wsgi.application'
X_FRAME_OPTIONS
u'SAMEORIGIN'
YEAR_MONTH_FORMAT
u'F Y'
\n\n
\n\n
\n

\n You're - seeing this error because you have DEBUG = True in your\n Django - settings file. Change that to False, and Django will\n display - a standard page generated by the handler for this status code.\n

\n - \
\n\n\n\n" - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=676a574d-4915-4b89-abf5-30dfbc55fa6b - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:50 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=676a574d-4915-4b89-abf5-30dfbc55fa6b - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:51 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Fri, 28 Feb 2020 22:26:52 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '72338' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string: "\n\n\n\n \n \n - \ AttributeError at /getDataRequestProgress/\n \n \n \n - \ \n\n\n
\n

AttributeError at /getDataRequestProgress/

\n - \
'MultiValueDictKeyError' object has
-        no attribute 'errno'
\n \n\n \n - \ \n \n \n \n - \ \n \n - \ \n\n \n \n \n - \ \n\n \n \n \n - \ \n\n\n \n \n \n \n\n\n \n - \ \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n - \ \n \n \n \n \n
Request Method:GET
Request URL:https://climateserv.servirglobal.net/chirps/getDataRequestProgress/
Django Version:1.11
Exception Type:AttributeError
Exception Value:
'MultiValueDictKeyError'
-        object has no attribute 'errno'
Exception Location:/data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress, line 765
Python - Executable:/usr/bin/python
Python - Version:2.7.12
Python - Path:
['/data/data/cserv/pythonCode/servirchirpsdjango',\n
-        '/usr/lib/python2.7',\n '/usr/lib/python2.7/plat-x86_64-linux-gnu',\n
-        '/usr/lib/python2.7/lib-tk',\n '/usr/lib/python2.7/lib-old',\n
-        '/usr/lib/python2.7/lib-dynload',\n '/usr/local/lib/python2.7/dist-packages',\n
-        '/usr/lib/python2.7/dist-packages',\n '/data/data/cserv/pythonCode/serviringest']
Server time:Fri, 28 Feb 2020 - 16:26:52 -0600
\n
\n\n\n\n\n
\n - \

Traceback \n - \ Switch to copy-and-paste view\n

\n \n
\n - \
    \n \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py - in inner\n\n \n
    \n - \ \n
      \n - \ \n
    1.     This decorator is automatically applied
      -        to all middleware to ensure that
    2. \n \n
    3.     no
      -        middleware leaks an exception and that the next middleware in the stack
    4. \n - \ \n
    5.     can rely on getting a response instead of
      -        an exception.
    6. \n \n
    7.     """
    8. \n \n - \
    9. -        \   @wraps(get_response, assigned=available_attrs(get_response))
    10. \n - \ \n
    11.     def inner(request):
    12. \n \n - \
    13. -        \       try:
    14. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         except Exception as exc:
    2. \n - \ \n
    3.             response = response_for_exception(request,
      -        exc)
    4. \n \n
    5.         return response
    6. \n \n - \
    7. -        \   return inner
    8. \n \n
    9. \n \n
    10. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    exc
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    get_response
    <bound method WSGIHandler._legacy_get_response
    -        of <django.core.handlers.wsgi.WSGIHandler object at 0x7ff427f8b9d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _legacy_get_response\n\n \n
    \n \n
      \n \n
    1.         #
      -        Apply request middleware
    2. \n \n
    3.         for
      -        middleware_method in self._request_middleware:
    4. \n \n - \
    5. -        \           response = middleware_method(request)
    6. \n \n - \
    7. -        \           if response:
    8. \n \n
    9.                 break
    10. \n - \ \n
    11. \n \n
    12.         if
      -        response is None:
    13. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = self._get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         return response
    2. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    middleware_method
    <bound method MessageMiddleware.process_request
    -        of <django.contrib.messages.middleware.MessageMiddleware object at 0x7ff42766d3d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff427f8b9d0>
    \n \n
  • \n - \ \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.                 break
    2. \n - \ \n
    3. \n \n
    4.         if
      -        response is None:
    5. \n \n
    6.             wrapped_callback = self.make_view_atomic(callback)
    7. \n - \ \n
    8.             try:
    9. \n \n - \
    10. -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
    11. \n - \ \n
    12.             except Exception as e:
    13. \n - \ \n
    \n \n
      \n
    1. \n                response = self.process_exception_by_middleware(e,
      -        request)
      ...
    \n \n
      \n \n - \
    1. \n - \ \n
    2.         # Complain if the view returned None
      -        (a common error).
    3. \n \n
    4.         if response is None:
    5. \n \n - \
    6. -        \           if isinstance(callback, types.FunctionType):    # FBV
    7. \n - \ \n
    8.                 view_name = callback.__name__
    9. \n - \ \n
    10.             else:                                           #
      -        CBV
    11. \n \n
    \n \n - \
    \n \n\n \n
    \n - \ \n Local vars\n \n - \
    \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7ff411877050>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7ff427667e10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff427f8b9d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7ff411877050>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.             response
      -        = middleware_method(request, callback, callback_args, callback_kwargs)
    2. \n - \ \n
    3.             if response:
    4. \n \n - \
    5. -        \               break
    6. \n \n
    7. \n - \ \n
    8.         if response is None:
    9. \n \n - \
    10. -        \           wrapped_callback = self.make_view_atomic(callback)
    11. \n - \ \n
    12.             try:
    13. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
      - ...
    \n \n
      \n \n
    1.             except
      -        Exception as e:
    2. \n \n
    3.                 response = self.process_exception_by_middleware(e,
      -        request)
    4. \n \n
    5. \n \n
    6.         #
      -        Complain if the view returned None (a common error).
    7. \n \n - \
    8. -        \       if response is None:
    9. \n \n
    10.             if
      -        isinstance(callback, types.FunctionType):    # FBV
    11. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7ff411877050>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7ff427667e10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff427f8b9d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7ff411877050>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py - in wrapped_view\n\n \n
    \n \n
      \n \n
    1.     """
    2. \n - \ \n
    3.     Marks a view function as being exempt from
      -        the CSRF view protection.
    4. \n \n
    5.     """
    6. \n - \ \n
    7.     # We could just do view_func.csrf_exempt
      -        = True, but decorators
    8. \n \n
    9.     #
      -        are nicer if they don't have side-effects, so we return a new
    10. \n - \ \n
    11.     # function.
    12. \n \n - \
    13. -        \   def wrapped_view(*args, **kwargs):
    14. \n \n
    \n - \ \n
      \n
    1. \n        return
      -        view_func(*args, **kwargs)
      ...
    \n \n - \
      \n - \ \n
    1.     wrapped_view.csrf_exempt = True
    2. \n - \ \n
    3.     return wraps(view_func, assigned=available_attrs(view_func))(wrapped_view)
    4. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    args
    (<WSGIRequest: GET '/chirps/getDataRequestProgress/'>,)
    kwargs
    {}
    view_func
    <function getDataRequestProgress
    -        at 0x7ff411872f50>
    \n \n
  • \n - \ \n \n
  • \n /data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress\n\n \n
    \n \n
      \n \n
    1.         if
      -        (progress == -1.0):
    2. \n \n
    3.             logger.warn("Problem with getDataRequestProgress:
      -        " + str(request))
    4. \n \n
    5.             return
      -        processCallBack(request, json.dumps([-1]), "application/json")
    6. \n - \ \n
    7.         else:
    8. \n \n - \
    9. -        \           return processCallBack(request, json.dumps([progress]), "application/json")
    10. \n - \ \n
    11.         ## return processCallBack(request,json.dumps([jsonresults['progress']]),"application/json")
    12. \n - \ \n
    13.     except Exception as e:
    14. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \       logger.warn("Problem with getDataRequestProgress: " + str(request)
      -        + " " + str(e.errno) + " " + str(e.strerror))
      ...
    \n - \ \n
      \n - \ \n
    1.         return processCallBack(request, json.dumps([-1]),
      -        "application/json")
    2. \n \n
    3. \n - \ \n
    4. \n \n
    5. @csrf_exempt
    6. \n - \ \n
    7. def getDataFromRequest(request):
    8. \n - \ \n
    9.     '''
    10. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    e
    MultiValueDictKeyError("'id'",)
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n
\n
\n \n
\n\n
\n \n - \ \n \n \n - \ \n

\n \n
\n
\n
\n\n\n\n
\n

Request information

\n\n\n \n

USER

\n - \

AnonymousUser

\n \n\n

GET

\n \n

No - GET data

\n \n\n

POST

\n \n

No POST data

\n - \ \n

FILES

\n \n

No FILES data

\n \n\n\n - \

COOKIES

\n \n

No cookie data

\n \n\n - \

META

\n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n
VariableValue
CONTEXT_DOCUMENT_ROOT
'/data/data/cserv/www/html'
CONTEXT_PREFIX
''
DOCUMENT_ROOT
'/data/data/cserv/www/html'
GATEWAY_INTERFACE
'CGI/1.1'
HTTP_ACCEPT
'application/json,
-        text/xml, application/xml, */*'
HTTP_ACCEPT_ENCODING
'gzip,
-        deflate'
HTTP_HOST
'climateserv.servirglobal.net'
HTTP_USER_AGENT
'libcurl/7.64.1 r-curl/4.3 crul/0.9.0'
PATH_INFO
u'/getDataRequestProgress/'
PATH_TRANSLATED
'/data/data/cserv/www/html/getDataRequestProgress/'
QUERY_STRING
''
REMOTE_ADDR
'122.199.27.9'
REMOTE_PORT
'42396'
REQUEST_METHOD
'GET'
REQUEST_SCHEME
'https'
REQUEST_URI
'/chirps/getDataRequestProgress/'
SCRIPT_FILENAME
'/data/data/cserv/pythonCode/servirchirpsdjango/servirchirpsdjango/wsgi.py'
SCRIPT_NAME
u'/chirps'
SERVER_ADDR
'10.5.5.21'
SERVER_ADMIN
'root@localhost'
SERVER_NAME
'climateserv.servirglobal.net'
SERVER_PORT
'443'
SERVER_PROTOCOL
'HTTP/1.1'
SERVER_SIGNATURE
'<address>Apache/2.4.18 (Ubuntu)
-        Server at climateserv.servirglobal.net Port 443</address>\\n'
SERVER_SOFTWARE
'Apache/2.4.18 (Ubuntu)'
SSL_TLS_SNI
'climateserv.servirglobal.net'
apache.version
(2,
-        4, 18)
mod_wsgi.application_group
'climateserv.servirglobal.net|/chirps'
mod_wsgi.callable_object
'application'
mod_wsgi.enable_sendfile
'0'
mod_wsgi.handler_script
''
mod_wsgi.input_chunked
'0'
mod_wsgi.listener_host
''
mod_wsgi.listener_port
'443'
mod_wsgi.process_group
''
mod_wsgi.request_handler
'wsgi-script'
mod_wsgi.request_start
'1582928812293954'
mod_wsgi.script_reloading
'1'
mod_wsgi.script_start
'1582928812294170'
mod_wsgi.version
(4,
-        3, 0)
wsgi.errors
<mod_wsgi.Log object at 0x7ff40ea26030>
wsgi.file_wrapper
''
wsgi.input
<mod_wsgi.Input
-        object at 0x7ff40d986cf0>
wsgi.multiprocess
True
wsgi.multithread
False
wsgi.run_once
False
wsgi.url_scheme
'https'
wsgi.version
(1,
-        0)
\n\n\n

Settings

\n

Using settings module servirchirpsdjango.settings

\n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \
SettingValue
ABSOLUTE_URL_OVERRIDES
{}
ADMINS
()
ALLOWED_HOSTS
['*']
APPEND_SLASH
True
AUTHENTICATION_BACKENDS
[u'django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS
u'********************'
AUTH_USER_MODEL
u'auth.User'
BASE_DIR
'/data/data/cserv/pythonCode/servirchirpsdjango'
CACHES
{u'default': {u'BACKEND': u'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS
u'default'
CACHE_MIDDLEWARE_KEY_PREFIX
u'********************'
CACHE_MIDDLEWARE_SECONDS
600
CORS_ORIGIN_ALLOW_ALL
True
CORS_ORIGIN_WHITELIST
('54.172.93.198',)
CSRF_COOKIE_AGE
31449600
CSRF_COOKIE_DOMAIN
None
CSRF_COOKIE_HTTPONLY
False
CSRF_COOKIE_NAME
u'csrftoken'
CSRF_COOKIE_PATH
u'/'
CSRF_COOKIE_SECURE
False
CSRF_FAILURE_VIEW
u'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME
u'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS
[]
CSRF_USE_SESSIONS
False
DATABASES
{'default': {'ATOMIC_REQUESTS': False,\n
-        \            'AUTOCOMMIT': True,\n             'CONN_MAX_AGE':
-        0,\n             'ENGINE': 'django.db.backends.sqlite3',\n
-        \            'HOST': '',\n             'NAME': '/data/data/cserv/pythonCode/servirchirpsdjango/sqlite.db',\n
-        \            'OPTIONS': {},\n             'PASSWORD': u'********************',\n
-        \            'PORT': '',\n             'TEST': {'CHARSET':
-        None,\n                      'COLLATION': None,\n                      'MIRROR':
-        None,\n                      'NAME': None},\n             'TIME_ZONE':
-        None,\n             'USER': ''}}
DATABASE_ROUTERS
[]
DATA_UPLOAD_MAX_MEMORY_SIZE
2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS
1000
DATETIME_FORMAT
u'N
-        j, Y, P'
DATETIME_INPUT_FORMATS
[u'%Y-%m-%d %H:%M:%S',\n u'%Y-%m-%d
-        %H:%M:%S.%f',\n u'%Y-%m-%d %H:%M',\n u'%Y-%m-%d',\n u'%m/%d/%Y
-        %H:%M:%S',\n u'%m/%d/%Y %H:%M:%S.%f',\n u'%m/%d/%Y %H:%M',\n
-        u'%m/%d/%Y',\n u'%m/%d/%y %H:%M:%S',\n u'%m/%d/%y %H:%M:%S.%f',\n
-        u'%m/%d/%y %H:%M',\n u'%m/%d/%y']
DATE_FORMAT
u'N
-        j, Y'
DATE_INPUT_FORMATS
[u'%Y-%m-%d',\n u'%m/%d/%Y',\n
-        u'%m/%d/%y',\n u'%b %d %Y',\n u'%b %d, %Y',\n u'%d
-        %b %Y',\n u'%d %b, %Y',\n u'%B %d %Y',\n u'%B %d,
-        %Y',\n u'%d %B %Y',\n u'%d %B, %Y']
DEBUG
True
DEBUG_PROPAGATE_EXCEPTIONS
False
DECIMAL_SEPARATOR
u'.'
DEFAULT_CHARSET
u'utf-8'
DEFAULT_CONTENT_TYPE
u'text/html'
DEFAULT_EXCEPTION_REPORTER_FILTER
u'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE
u'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL
u'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE
u''
DEFAULT_TABLESPACE
u''
DISALLOWED_USER_AGENTS
[]
EMAIL_BACKEND
u'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST
u'localhost'
EMAIL_HOST_PASSWORD
u'********************'
EMAIL_HOST_USER
u''
EMAIL_PORT
25
EMAIL_SSL_CERTFILE
None
EMAIL_SSL_KEYFILE
u'********************'
EMAIL_SUBJECT_PREFIX
u'[Django] '
EMAIL_TIMEOUT
None
EMAIL_USE_LOCALTIME
False
EMAIL_USE_SSL
False
EMAIL_USE_TLS
False
FILE_CHARSET
u'utf-8'
FILE_UPLOAD_DIRECTORY_PERMISSIONS
None
FILE_UPLOAD_HANDLERS
[u'django.core.files.uploadhandler.MemoryFileUploadHandler',\n
-        u'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
FILE_UPLOAD_PERMISSIONS
None
FILE_UPLOAD_TEMP_DIR
None
FIRST_DAY_OF_WEEK
0
FIXTURE_DIRS
[]
FORCE_SCRIPT_NAME
None
FORMAT_MODULE_PATH
None
FORM_RENDERER
u'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS
[]
INSTALLED_APPS
['polls',\n
-        'django.contrib.auth',\n 'django.contrib.contenttypes',\n
-        'django.contrib.sessions',\n 'django.contrib.sites',\n 'django.contrib.messages',\n
-        'django.contrib.staticfiles',\n 'servirchirps',\n 'corsheaders',\n
-        'django.contrib.admin',\n 'django.contrib.admindocs',\n 'pydash',\n
-        'servirmetrics']
INTERNAL_IPS
[]
LANGUAGES
[(u'af', u'Afrikaans'),\n (u'ar',
-        u'Arabic'),\n (u'ast', u'Asturian'),\n (u'az',
-        u'Azerbaijani'),\n (u'bg', u'Bulgarian'),\n (u'be',
-        u'Belarusian'),\n (u'bn', u'Bengali'),\n (u'br',
-        u'Breton'),\n (u'bs', u'Bosnian'),\n (u'ca',
-        u'Catalan'),\n (u'cs', u'Czech'),\n (u'cy',
-        u'Welsh'),\n (u'da', u'Danish'),\n (u'de',
-        u'German'),\n (u'dsb', u'Lower Sorbian'),\n (u'el',
-        u'Greek'),\n (u'en', u'English'),\n (u'en-au',
-        u'Australian English'),\n (u'en-gb', u'British English'),\n
-        (u'eo', u'Esperanto'),\n (u'es', u'Spanish'),\n
-        (u'es-ar', u'Argentinian Spanish'),\n (u'es-co', u'Colombian
-        Spanish'),\n (u'es-mx', u'Mexican Spanish'),\n (u'es-ni',
-        u'Nicaraguan Spanish'),\n (u'es-ve', u'Venezuelan Spanish'),\n
-        (u'et', u'Estonian'),\n (u'eu', u'Basque'),\n
-        (u'fa', u'Persian'),\n (u'fi', u'Finnish'),\n
-        (u'fr', u'French'),\n (u'fy', u'Frisian'),\n
-        (u'ga', u'Irish'),\n (u'gd', u'Scottish Gaelic'),\n
-        (u'gl', u'Galician'),\n (u'he', u'Hebrew'),\n
-        (u'hi', u'Hindi'),\n (u'hr', u'Croatian'),\n
-        (u'hsb', u'Upper Sorbian'),\n (u'hu', u'Hungarian'),\n
-        (u'ia', u'Interlingua'),\n (u'id', u'Indonesian'),\n
-        (u'io', u'Ido'),\n (u'is', u'Icelandic'),\n
-        (u'it', u'Italian'),\n (u'ja', u'Japanese'),\n
-        (u'ka', u'Georgian'),\n (u'kk', u'Kazakh'),\n
-        (u'km', u'Khmer'),\n (u'kn', u'Kannada'),\n
-        (u'ko', u'Korean'),\n (u'lb', u'Luxembourgish'),\n
-        (u'lt', u'Lithuanian'),\n (u'lv', u'Latvian'),\n
-        (u'mk', u'Macedonian'),\n (u'ml', u'Malayalam'),\n
-        (u'mn', u'Mongolian'),\n (u'mr', u'Marathi'),\n
-        (u'my', u'Burmese'),\n (u'nb', u'Norwegian Bokm\\xe5l'),\n
-        (u'ne', u'Nepali'),\n (u'nl', u'Dutch'),\n
-        (u'nn', u'Norwegian Nynorsk'),\n (u'os', u'Ossetic'),\n
-        (u'pa', u'Punjabi'),\n (u'pl', u'Polish'),\n
-        (u'pt', u'Portuguese'),\n (u'pt-br', u'Brazilian
-        Portuguese'),\n (u'ro', u'Romanian'),\n (u'ru',
-        u'Russian'),\n (u'sk', u'Slovak'),\n (u'sl',
-        u'Slovenian'),\n (u'sq', u'Albanian'),\n (u'sr',
-        u'Serbian'),\n (u'sr-latn', u'Serbian Latin'),\n (u'sv',
-        u'Swedish'),\n (u'sw', u'Swahili'),\n (u'ta',
-        u'Tamil'),\n (u'te', u'Telugu'),\n (u'th',
-        u'Thai'),\n (u'tr', u'Turkish'),\n (u'tt',
-        u'Tatar'),\n (u'udm', u'Udmurt'),\n (u'uk',
-        u'Ukrainian'),\n (u'ur', u'Urdu'),\n (u'vi',
-        u'Vietnamese'),\n (u'zh-hans', u'Simplified Chinese'),\n
-        (u'zh-hant', u'Traditional Chinese')]
LANGUAGES_BIDI
[u'he',
-        u'ar', u'fa', u'ur']
LANGUAGE_CODE
'en-us'
LANGUAGE_COOKIE_AGE
None
LANGUAGE_COOKIE_DOMAIN
None
LANGUAGE_COOKIE_NAME
u'django_language'
LANGUAGE_COOKIE_PATH
u'/'
LOCALE_PATHS
[]
LOGGING
{'disable_existing_loggers': True,\n 'filters':
-        {},\n 'formatters': {'simple': {'format': '%(levelname)s,
-        %(message)s'},\n                'verbose': {'format':
-        '%(levelname)s, %(asctime)s, %(module)s, %(process)d, %(thread)d, %(message)s'}},\n
-        'handlers': {'console': {'class': 'logging.StreamHandler',\n
-        \                         'formatter': 'simple',\n                          'level':
-        'DEBUG'},\n              'log_file_chirps': {'class':
-        'logging.handlers.RotatingFileHandler',\n                                  'filename':
-        '/data/data/cserv/chirps.log',\n                                  'formatter':
-        'verbose',\n                                  'level': 'DEBUG',\n
-        \                                 'maxBytes': '16777216'},\n
-        \             'log_file_metrics': {'backupCount': '10',\n
-        \                                  'class': 'logging.handlers.RotatingFileHandler',\n
-        \                                  'filename': '/data/data/logs/metrics/metrics.log',\n
-        \                                  'formatter': 'verbose',\n
-        \                                  'level': 'INFO',\n                                   'maxBytes':
-        '100000000'}},\n 'loggers': {'CHIRPS': {'handlers':
-        ['log_file_chirps'],\n                        'level': 'INFO',\n
-        \                       'propagate': False},\n             'metrics_logger':
-        {'handlers': ['log_file_metrics'],\n                                'level':
-        'INFO'},\n             'servirchirps': {'handlers':
-        ['log_file_chirps'],\n                              'level':
-        'INFO',\n                              'propagate': False}},\n
-        'version': 1}
LOGGING_CONFIG
u'logging.config.dictConfig'
LOGIN_REDIRECT_URL
u'/accounts/profile/'
LOGIN_URL
u'/accounts/login/'
LOGOUT_REDIRECT_URL
None
MANAGERS
()
MEDIA_ROOT
''
MEDIA_URL
''
MESSAGE_STORAGE
u'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE
None
MIDDLEWARE_CLASSES
('corsheaders.middleware.CorsMiddleware',\n
-        'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n
-        'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n
-        'django.contrib.messages.middleware.MessageMiddleware',\n 'servirchirpsdjango.middleware.MetricsTracking')
MIGRATION_MODULES
{}
MONTH_DAY_FORMAT
u'F
-        j'
NUMBER_GROUPING
0
PASSWORD_HASHERS
u'********************'
PASSWORD_RESET_TIMEOUT_DAYS
u'********************'
PREPEND_WWW
False
ROOT_URLCONF
'servirchirpsdjango.urls'
SECRET_KEY
u'********************'
SECURE_BROWSER_XSS_FILTER
False
SECURE_CONTENT_TYPE_NOSNIFF
False
SECURE_HSTS_INCLUDE_SUBDOMAINS
False
SECURE_HSTS_PRELOAD
False
SECURE_HSTS_SECONDS
0
SECURE_PROXY_SSL_HEADER
None
SECURE_REDIRECT_EXEMPT
[]
SECURE_SSL_HOST
None
SECURE_SSL_REDIRECT
False
SERVER_EMAIL
u'root@localhost'
SESSION_CACHE_ALIAS
u'default'
SESSION_COOKIE_AGE
1209600
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_HTTPONLY
True
SESSION_COOKIE_NAME
u'sessionid'
SESSION_COOKIE_PATH
u'/'
SESSION_COOKIE_SECURE
False
SESSION_ENGINE
u'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
SESSION_FILE_PATH
None
SESSION_SAVE_EVERY_REQUEST
False
SESSION_SERIALIZER
u'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE
'servirchirpsdjango.settings'
SHORT_DATETIME_FORMAT
u'm/d/Y P'
SHORT_DATE_FORMAT
u'm/d/Y'
SIGNING_BACKEND
u'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS
[]
SITE_ID
1
STATICFILES_DIRS
()
STATICFILES_FINDERS
('django.contrib.staticfiles.finders.FileSystemFinder',\n
-        'django.contrib.staticfiles.finders.AppDirectoriesFinder')
STATICFILES_STORAGE
u'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT
'/data/data/cserv/static/'
STATIC_URL
'/static/'
TEMPLATES
[{'APP_DIRS': True,\n  'BACKEND': 'django.template.backends.django.DjangoTemplates',\n
-        \ 'DIRS': ['/data/data/cserv/pythonCode/servirchirpsdjango/templates'],\n
-        \ 'OPTIONS': {'context_processors': ['django.template.context_processors.debug',\n
-        \                                    'django.template.context_processors.request',\n
-        \                                    'django.contrib.auth.context_processors.auth',\n
-        \                                    'django.contrib.messages.context_processors.messages'],\n
-        \             'debug': False}}]
TEST_NON_SERIALIZED_APPS
[]
TEST_RUNNER
u'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR
u','
TIME_FORMAT
u'P'
TIME_INPUT_FORMATS
[u'%H:%M:%S', u'%H:%M:%S.%f',
-        u'%H:%M']
TIME_ZONE
'America/Chicago'
USE_ETAGS
False
USE_I18N
True
USE_L10N
True
USE_THOUSAND_SEPARATOR
False
USE_TZ
True
USE_X_FORWARDED_HOST
False
USE_X_FORWARDED_PORT
False
WSGI_APPLICATION
'servirchirpsdjango.wsgi.application'
X_FRAME_OPTIONS
u'SAMEORIGIN'
YEAR_MONTH_FORMAT
u'F Y'
\n\n
\n\n
\n

\n You're - seeing this error because you have DEBUG = True in your\n Django - settings file. Change that to False, and Django will\n display - a standard page generated by the handler for this status code.\n

\n - \
\n\n\n\n" - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=c4da5a22-2cad-44b6-b1b5-0df577d82458 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:53 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=c4da5a22-2cad-44b6-b1b5-0df577d82458 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:54 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:54 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=676a574d-4915-4b89-abf5-30dfbc55fa6b - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:55 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": []}' - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=676a574d-4915-4b89-abf5-30dfbc55fa6b - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:56 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": []}' - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:56 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=c4da5a22-2cad-44b6-b1b5-0df577d82458 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:57 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2002", "workid": "6197db6f-6a41-4da8-93ab-6b5db1c5841a", - "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "c89e314d-e333-481b-944b-e33d6911f9bc", "epochTime": - "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "c738b9d1-45f3-422a-8af5-1678a99674ed", "epochTime": "1011225600", - "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=c4da5a22-2cad-44b6-b1b5-0df577d82458 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:58 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2002", "workid": "6197db6f-6a41-4da8-93ab-6b5db1c5841a", - "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "c89e314d-e333-481b-944b-e33d6911f9bc", "epochTime": - "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "c738b9d1-45f3-422a-8af5-1678a99674ed", "epochTime": "1011225600", - "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2020-02-28 22:26:57 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 diff --git a/tests/fixtures/vcr_cassettes/sf_method.yml b/tests/fixtures/vcr_cassettes/sf_method.yml deleted file mode 100644 index 2ec8dd1..0000000 --- a/tests/fixtures/vcr_cassettes/sf_method.yml +++ /dev/null @@ -1,2275 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:23 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=0&begintime=01%2F01%2F2000&endtime=01%2F05%2F2000&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:24 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["9e1076d0-a958-4854-a2bf-e046f0c4dc91"]) - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:25 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=0&begintime=01%2F01%2F2000&endtime=01%2F05%2F2000&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:25 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["02d13860-06d0-439b-8efe-3ff18a49954d"]) - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Fri, 28 Feb 2020 22:26:26 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '72338' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string: "\n\n\n\n \n \n - \ AttributeError at /getDataRequestProgress/\n \n \n \n - \ \n\n\n
\n

AttributeError at /getDataRequestProgress/

\n - \
'MultiValueDictKeyError' object has
-        no attribute 'errno'
\n \n\n \n - \ \n \n \n \n - \ \n \n - \ \n\n \n \n \n - \ \n\n \n \n \n - \ \n\n\n \n \n \n \n\n\n \n - \ \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n - \ \n \n \n \n \n
Request Method:GET
Request URL:https://climateserv.servirglobal.net/chirps/getDataRequestProgress/
Django Version:1.11
Exception Type:AttributeError
Exception Value:
'MultiValueDictKeyError'
-        object has no attribute 'errno'
Exception Location:/data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress, line 765
Python - Executable:/usr/bin/python
Python - Version:2.7.12
Python - Path:
['/data/data/cserv/pythonCode/servirchirpsdjango',\n
-        '/usr/lib/python2.7',\n '/usr/lib/python2.7/plat-x86_64-linux-gnu',\n
-        '/usr/lib/python2.7/lib-tk',\n '/usr/lib/python2.7/lib-old',\n
-        '/usr/lib/python2.7/lib-dynload',\n '/usr/local/lib/python2.7/dist-packages',\n
-        '/usr/lib/python2.7/dist-packages',\n '/data/data/cserv/pythonCode/serviringest']
Server time:Fri, 28 Feb 2020 - 16:26:26 -0600
\n
\n\n\n\n\n
\n - \

Traceback \n - \ Switch to copy-and-paste view\n

\n \n
\n - \
    \n \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py - in inner\n\n \n
    \n - \ \n
      \n - \ \n
    1.     This decorator is automatically applied
      -        to all middleware to ensure that
    2. \n \n
    3.     no
      -        middleware leaks an exception and that the next middleware in the stack
    4. \n - \ \n
    5.     can rely on getting a response instead of
      -        an exception.
    6. \n \n
    7.     """
    8. \n \n - \
    9. -        \   @wraps(get_response, assigned=available_attrs(get_response))
    10. \n - \ \n
    11.     def inner(request):
    12. \n \n - \
    13. -        \       try:
    14. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         except Exception as exc:
    2. \n - \ \n
    3.             response = response_for_exception(request,
      -        exc)
    4. \n \n
    5.         return response
    6. \n \n - \
    7. -        \   return inner
    8. \n \n
    9. \n \n
    10. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    exc
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    get_response
    <bound method WSGIHandler._legacy_get_response
    -        of <django.core.handlers.wsgi.WSGIHandler object at 0x7ff4283b19d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _legacy_get_response\n\n \n
    \n \n
      \n \n
    1.         #
      -        Apply request middleware
    2. \n \n
    3.         for
      -        middleware_method in self._request_middleware:
    4. \n \n - \
    5. -        \           response = middleware_method(request)
    6. \n \n - \
    7. -        \           if response:
    8. \n \n
    9.                 break
    10. \n - \ \n
    11. \n \n
    12.         if
      -        response is None:
    13. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = self._get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         return response
    2. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    middleware_method
    <bound method MessageMiddleware.process_request
    -        of <django.contrib.messages.middleware.MessageMiddleware object at 0x7ff427a933d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    \n \n
  • \n - \ \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.                 break
    2. \n - \ \n
    3. \n \n
    4.         if
      -        response is None:
    5. \n \n
    6.             wrapped_callback = self.make_view_atomic(callback)
    7. \n - \ \n
    8.             try:
    9. \n \n - \
    10. -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
    11. \n - \ \n
    12.             except Exception as e:
    13. \n - \ \n
    \n \n
      \n
    1. \n                response = self.process_exception_by_middleware(e,
      -        request)
      ...
    \n \n
      \n \n - \
    1. \n - \ \n
    2.         # Complain if the view returned None
      -        (a common error).
    3. \n \n
    4.         if response is None:
    5. \n \n - \
    6. -        \           if isinstance(callback, types.FunctionType):    # FBV
    7. \n - \ \n
    8.                 view_name = callback.__name__
    9. \n - \ \n
    10.             else:                                           #
      -        CBV
    11. \n \n
    \n \n - \
    \n \n\n \n
    \n - \ \n Local vars\n \n - \
    \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7ff411a7ded8>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7ff427a8de10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7ff411a7ded8>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.             response
      -        = middleware_method(request, callback, callback_args, callback_kwargs)
    2. \n - \ \n
    3.             if response:
    4. \n \n - \
    5. -        \               break
    6. \n \n
    7. \n - \ \n
    8.         if response is None:
    9. \n \n - \
    10. -        \           wrapped_callback = self.make_view_atomic(callback)
    11. \n - \ \n
    12.             try:
    13. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
      - ...
    \n \n
      \n \n
    1.             except
      -        Exception as e:
    2. \n \n
    3.                 response = self.process_exception_by_middleware(e,
      -        request)
    4. \n \n
    5. \n \n
    6.         #
      -        Complain if the view returned None (a common error).
    7. \n \n - \
    8. -        \       if response is None:
    9. \n \n
    10.             if
      -        isinstance(callback, types.FunctionType):    # FBV
    11. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7ff411a7ded8>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7ff427a8de10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7ff411a7ded8>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py - in wrapped_view\n\n \n
    \n \n
      \n \n
    1.     """
    2. \n - \ \n
    3.     Marks a view function as being exempt from
      -        the CSRF view protection.
    4. \n \n
    5.     """
    6. \n - \ \n
    7.     # We could just do view_func.csrf_exempt
      -        = True, but decorators
    8. \n \n
    9.     #
      -        are nicer if they don't have side-effects, so we return a new
    10. \n - \ \n
    11.     # function.
    12. \n \n - \
    13. -        \   def wrapped_view(*args, **kwargs):
    14. \n \n
    \n - \ \n
      \n
    1. \n        return
      -        view_func(*args, **kwargs)
      ...
    \n \n - \
      \n - \ \n
    1.     wrapped_view.csrf_exempt = True
    2. \n - \ \n
    3.     return wraps(view_func, assigned=available_attrs(view_func))(wrapped_view)
    4. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    args
    (<WSGIRequest: GET '/chirps/getDataRequestProgress/'>,)
    kwargs
    {}
    view_func
    <function getDataRequestProgress
    -        at 0x7ff411a7de60>
    \n \n
  • \n - \ \n \n
  • \n /data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress\n\n \n
    \n \n
      \n \n
    1.         if
      -        (progress == -1.0):
    2. \n \n
    3.             logger.warn("Problem with getDataRequestProgress:
      -        " + str(request))
    4. \n \n
    5.             return
      -        processCallBack(request, json.dumps([-1]), "application/json")
    6. \n - \ \n
    7.         else:
    8. \n \n - \
    9. -        \           return processCallBack(request, json.dumps([progress]), "application/json")
    10. \n - \ \n
    11.         ## return processCallBack(request,json.dumps([jsonresults['progress']]),"application/json")
    12. \n - \ \n
    13.     except Exception as e:
    14. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \       logger.warn("Problem with getDataRequestProgress: " + str(request)
      -        + " " + str(e.errno) + " " + str(e.strerror))
      ...
    \n - \ \n
      \n - \ \n
    1.         return processCallBack(request, json.dumps([-1]),
      -        "application/json")
    2. \n \n
    3. \n - \ \n
    4. \n \n
    5. @csrf_exempt
    6. \n - \ \n
    7. def getDataFromRequest(request):
    8. \n - \ \n
    9.     '''
    10. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    e
    MultiValueDictKeyError("'id'",)
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n
\n
\n \n
\n\n
\n \n - \ \n \n \n - \ \n

\n \n
\n
\n
\n\n\n\n
\n

Request information

\n\n\n \n

USER

\n - \

AnonymousUser

\n \n\n

GET

\n \n

No - GET data

\n \n\n

POST

\n \n

No POST data

\n - \ \n

FILES

\n \n

No FILES data

\n \n\n\n - \

COOKIES

\n \n

No cookie data

\n \n\n - \

META

\n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n
VariableValue
CONTEXT_DOCUMENT_ROOT
'/data/data/cserv/www/html'
CONTEXT_PREFIX
''
DOCUMENT_ROOT
'/data/data/cserv/www/html'
GATEWAY_INTERFACE
'CGI/1.1'
HTTP_ACCEPT
'application/json,
-        text/xml, application/xml, */*'
HTTP_ACCEPT_ENCODING
'gzip,
-        deflate'
HTTP_HOST
'climateserv.servirglobal.net'
HTTP_USER_AGENT
'libcurl/7.64.1 r-curl/4.3 crul/0.9.0'
PATH_INFO
u'/getDataRequestProgress/'
PATH_TRANSLATED
'/data/data/cserv/www/html/getDataRequestProgress/'
QUERY_STRING
''
REMOTE_ADDR
'122.199.27.9'
REMOTE_PORT
'44070'
REQUEST_METHOD
'GET'
REQUEST_SCHEME
'https'
REQUEST_URI
'/chirps/getDataRequestProgress/'
SCRIPT_FILENAME
'/data/data/cserv/pythonCode/servirchirpsdjango/servirchirpsdjango/wsgi.py'
SCRIPT_NAME
u'/chirps'
SERVER_ADDR
'10.5.5.21'
SERVER_ADMIN
'root@localhost'
SERVER_NAME
'climateserv.servirglobal.net'
SERVER_PORT
'443'
SERVER_PROTOCOL
'HTTP/1.1'
SERVER_SIGNATURE
'<address>Apache/2.4.18 (Ubuntu)
-        Server at climateserv.servirglobal.net Port 443</address>\\n'
SERVER_SOFTWARE
'Apache/2.4.18 (Ubuntu)'
SSL_TLS_SNI
'climateserv.servirglobal.net'
apache.version
(2,
-        4, 18)
mod_wsgi.application_group
'climateserv.servirglobal.net|/chirps'
mod_wsgi.callable_object
'application'
mod_wsgi.enable_sendfile
'0'
mod_wsgi.handler_script
''
mod_wsgi.input_chunked
'0'
mod_wsgi.listener_host
''
mod_wsgi.listener_port
'443'
mod_wsgi.process_group
''
mod_wsgi.request_handler
'wsgi-script'
mod_wsgi.request_start
'1582928786355945'
mod_wsgi.script_reloading
'1'
mod_wsgi.script_start
'1582928786356175'
mod_wsgi.version
(4,
-        3, 0)
wsgi.errors
<mod_wsgi.Log object at 0x7ff40ec83a98>
wsgi.file_wrapper
''
wsgi.input
<mod_wsgi.Input
-        object at 0x7ff40dc17270>
wsgi.multiprocess
True
wsgi.multithread
False
wsgi.run_once
False
wsgi.url_scheme
'https'
wsgi.version
(1,
-        0)
\n\n\n

Settings

\n

Using settings module servirchirpsdjango.settings

\n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \
SettingValue
ABSOLUTE_URL_OVERRIDES
{}
ADMINS
()
ALLOWED_HOSTS
['*']
APPEND_SLASH
True
AUTHENTICATION_BACKENDS
[u'django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS
u'********************'
AUTH_USER_MODEL
u'auth.User'
BASE_DIR
'/data/data/cserv/pythonCode/servirchirpsdjango'
CACHES
{u'default': {u'BACKEND': u'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS
u'default'
CACHE_MIDDLEWARE_KEY_PREFIX
u'********************'
CACHE_MIDDLEWARE_SECONDS
600
CORS_ORIGIN_ALLOW_ALL
True
CORS_ORIGIN_WHITELIST
('54.172.93.198',)
CSRF_COOKIE_AGE
31449600
CSRF_COOKIE_DOMAIN
None
CSRF_COOKIE_HTTPONLY
False
CSRF_COOKIE_NAME
u'csrftoken'
CSRF_COOKIE_PATH
u'/'
CSRF_COOKIE_SECURE
False
CSRF_FAILURE_VIEW
u'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME
u'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS
[]
CSRF_USE_SESSIONS
False
DATABASES
{'default': {'ATOMIC_REQUESTS': False,\n
-        \            'AUTOCOMMIT': True,\n             'CONN_MAX_AGE':
-        0,\n             'ENGINE': 'django.db.backends.sqlite3',\n
-        \            'HOST': '',\n             'NAME': '/data/data/cserv/pythonCode/servirchirpsdjango/sqlite.db',\n
-        \            'OPTIONS': {},\n             'PASSWORD': u'********************',\n
-        \            'PORT': '',\n             'TEST': {'CHARSET':
-        None,\n                      'COLLATION': None,\n                      'MIRROR':
-        None,\n                      'NAME': None},\n             'TIME_ZONE':
-        None,\n             'USER': ''}}
DATABASE_ROUTERS
[]
DATA_UPLOAD_MAX_MEMORY_SIZE
2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS
1000
DATETIME_FORMAT
u'N
-        j, Y, P'
DATETIME_INPUT_FORMATS
[u'%Y-%m-%d %H:%M:%S',\n u'%Y-%m-%d
-        %H:%M:%S.%f',\n u'%Y-%m-%d %H:%M',\n u'%Y-%m-%d',\n u'%m/%d/%Y
-        %H:%M:%S',\n u'%m/%d/%Y %H:%M:%S.%f',\n u'%m/%d/%Y %H:%M',\n
-        u'%m/%d/%Y',\n u'%m/%d/%y %H:%M:%S',\n u'%m/%d/%y %H:%M:%S.%f',\n
-        u'%m/%d/%y %H:%M',\n u'%m/%d/%y']
DATE_FORMAT
u'N
-        j, Y'
DATE_INPUT_FORMATS
[u'%Y-%m-%d',\n u'%m/%d/%Y',\n
-        u'%m/%d/%y',\n u'%b %d %Y',\n u'%b %d, %Y',\n u'%d
-        %b %Y',\n u'%d %b, %Y',\n u'%B %d %Y',\n u'%B %d,
-        %Y',\n u'%d %B %Y',\n u'%d %B, %Y']
DEBUG
True
DEBUG_PROPAGATE_EXCEPTIONS
False
DECIMAL_SEPARATOR
u'.'
DEFAULT_CHARSET
u'utf-8'
DEFAULT_CONTENT_TYPE
u'text/html'
DEFAULT_EXCEPTION_REPORTER_FILTER
u'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE
u'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL
u'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE
u''
DEFAULT_TABLESPACE
u''
DISALLOWED_USER_AGENTS
[]
EMAIL_BACKEND
u'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST
u'localhost'
EMAIL_HOST_PASSWORD
u'********************'
EMAIL_HOST_USER
u''
EMAIL_PORT
25
EMAIL_SSL_CERTFILE
None
EMAIL_SSL_KEYFILE
u'********************'
EMAIL_SUBJECT_PREFIX
u'[Django] '
EMAIL_TIMEOUT
None
EMAIL_USE_LOCALTIME
False
EMAIL_USE_SSL
False
EMAIL_USE_TLS
False
FILE_CHARSET
u'utf-8'
FILE_UPLOAD_DIRECTORY_PERMISSIONS
None
FILE_UPLOAD_HANDLERS
[u'django.core.files.uploadhandler.MemoryFileUploadHandler',\n
-        u'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
FILE_UPLOAD_PERMISSIONS
None
FILE_UPLOAD_TEMP_DIR
None
FIRST_DAY_OF_WEEK
0
FIXTURE_DIRS
[]
FORCE_SCRIPT_NAME
None
FORMAT_MODULE_PATH
None
FORM_RENDERER
u'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS
[]
INSTALLED_APPS
['polls',\n
-        'django.contrib.auth',\n 'django.contrib.contenttypes',\n
-        'django.contrib.sessions',\n 'django.contrib.sites',\n 'django.contrib.messages',\n
-        'django.contrib.staticfiles',\n 'servirchirps',\n 'corsheaders',\n
-        'django.contrib.admin',\n 'django.contrib.admindocs',\n 'pydash',\n
-        'servirmetrics']
INTERNAL_IPS
[]
LANGUAGES
[(u'af', u'Afrikaans'),\n (u'ar',
-        u'Arabic'),\n (u'ast', u'Asturian'),\n (u'az',
-        u'Azerbaijani'),\n (u'bg', u'Bulgarian'),\n (u'be',
-        u'Belarusian'),\n (u'bn', u'Bengali'),\n (u'br',
-        u'Breton'),\n (u'bs', u'Bosnian'),\n (u'ca',
-        u'Catalan'),\n (u'cs', u'Czech'),\n (u'cy',
-        u'Welsh'),\n (u'da', u'Danish'),\n (u'de',
-        u'German'),\n (u'dsb', u'Lower Sorbian'),\n (u'el',
-        u'Greek'),\n (u'en', u'English'),\n (u'en-au',
-        u'Australian English'),\n (u'en-gb', u'British English'),\n
-        (u'eo', u'Esperanto'),\n (u'es', u'Spanish'),\n
-        (u'es-ar', u'Argentinian Spanish'),\n (u'es-co', u'Colombian
-        Spanish'),\n (u'es-mx', u'Mexican Spanish'),\n (u'es-ni',
-        u'Nicaraguan Spanish'),\n (u'es-ve', u'Venezuelan Spanish'),\n
-        (u'et', u'Estonian'),\n (u'eu', u'Basque'),\n
-        (u'fa', u'Persian'),\n (u'fi', u'Finnish'),\n
-        (u'fr', u'French'),\n (u'fy', u'Frisian'),\n
-        (u'ga', u'Irish'),\n (u'gd', u'Scottish Gaelic'),\n
-        (u'gl', u'Galician'),\n (u'he', u'Hebrew'),\n
-        (u'hi', u'Hindi'),\n (u'hr', u'Croatian'),\n
-        (u'hsb', u'Upper Sorbian'),\n (u'hu', u'Hungarian'),\n
-        (u'ia', u'Interlingua'),\n (u'id', u'Indonesian'),\n
-        (u'io', u'Ido'),\n (u'is', u'Icelandic'),\n
-        (u'it', u'Italian'),\n (u'ja', u'Japanese'),\n
-        (u'ka', u'Georgian'),\n (u'kk', u'Kazakh'),\n
-        (u'km', u'Khmer'),\n (u'kn', u'Kannada'),\n
-        (u'ko', u'Korean'),\n (u'lb', u'Luxembourgish'),\n
-        (u'lt', u'Lithuanian'),\n (u'lv', u'Latvian'),\n
-        (u'mk', u'Macedonian'),\n (u'ml', u'Malayalam'),\n
-        (u'mn', u'Mongolian'),\n (u'mr', u'Marathi'),\n
-        (u'my', u'Burmese'),\n (u'nb', u'Norwegian Bokm\\xe5l'),\n
-        (u'ne', u'Nepali'),\n (u'nl', u'Dutch'),\n
-        (u'nn', u'Norwegian Nynorsk'),\n (u'os', u'Ossetic'),\n
-        (u'pa', u'Punjabi'),\n (u'pl', u'Polish'),\n
-        (u'pt', u'Portuguese'),\n (u'pt-br', u'Brazilian
-        Portuguese'),\n (u'ro', u'Romanian'),\n (u'ru',
-        u'Russian'),\n (u'sk', u'Slovak'),\n (u'sl',
-        u'Slovenian'),\n (u'sq', u'Albanian'),\n (u'sr',
-        u'Serbian'),\n (u'sr-latn', u'Serbian Latin'),\n (u'sv',
-        u'Swedish'),\n (u'sw', u'Swahili'),\n (u'ta',
-        u'Tamil'),\n (u'te', u'Telugu'),\n (u'th',
-        u'Thai'),\n (u'tr', u'Turkish'),\n (u'tt',
-        u'Tatar'),\n (u'udm', u'Udmurt'),\n (u'uk',
-        u'Ukrainian'),\n (u'ur', u'Urdu'),\n (u'vi',
-        u'Vietnamese'),\n (u'zh-hans', u'Simplified Chinese'),\n
-        (u'zh-hant', u'Traditional Chinese')]
LANGUAGES_BIDI
[u'he',
-        u'ar', u'fa', u'ur']
LANGUAGE_CODE
'en-us'
LANGUAGE_COOKIE_AGE
None
LANGUAGE_COOKIE_DOMAIN
None
LANGUAGE_COOKIE_NAME
u'django_language'
LANGUAGE_COOKIE_PATH
u'/'
LOCALE_PATHS
[]
LOGGING
{'disable_existing_loggers': True,\n 'filters':
-        {},\n 'formatters': {'simple': {'format': '%(levelname)s,
-        %(message)s'},\n                'verbose': {'format':
-        '%(levelname)s, %(asctime)s, %(module)s, %(process)d, %(thread)d, %(message)s'}},\n
-        'handlers': {'console': {'class': 'logging.StreamHandler',\n
-        \                         'formatter': 'simple',\n                          'level':
-        'DEBUG'},\n              'log_file_chirps': {'class':
-        'logging.handlers.RotatingFileHandler',\n                                  'filename':
-        '/data/data/cserv/chirps.log',\n                                  'formatter':
-        'verbose',\n                                  'level': 'DEBUG',\n
-        \                                 'maxBytes': '16777216'},\n
-        \             'log_file_metrics': {'backupCount': '10',\n
-        \                                  'class': 'logging.handlers.RotatingFileHandler',\n
-        \                                  'filename': '/data/data/logs/metrics/metrics.log',\n
-        \                                  'formatter': 'verbose',\n
-        \                                  'level': 'INFO',\n                                   'maxBytes':
-        '100000000'}},\n 'loggers': {'CHIRPS': {'handlers':
-        ['log_file_chirps'],\n                        'level': 'INFO',\n
-        \                       'propagate': False},\n             'metrics_logger':
-        {'handlers': ['log_file_metrics'],\n                                'level':
-        'INFO'},\n             'servirchirps': {'handlers':
-        ['log_file_chirps'],\n                              'level':
-        'INFO',\n                              'propagate': False}},\n
-        'version': 1}
LOGGING_CONFIG
u'logging.config.dictConfig'
LOGIN_REDIRECT_URL
u'/accounts/profile/'
LOGIN_URL
u'/accounts/login/'
LOGOUT_REDIRECT_URL
None
MANAGERS
()
MEDIA_ROOT
''
MEDIA_URL
''
MESSAGE_STORAGE
u'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE
None
MIDDLEWARE_CLASSES
('corsheaders.middleware.CorsMiddleware',\n
-        'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n
-        'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n
-        'django.contrib.messages.middleware.MessageMiddleware',\n 'servirchirpsdjango.middleware.MetricsTracking')
MIGRATION_MODULES
{}
MONTH_DAY_FORMAT
u'F
-        j'
NUMBER_GROUPING
0
PASSWORD_HASHERS
u'********************'
PASSWORD_RESET_TIMEOUT_DAYS
u'********************'
PREPEND_WWW
False
ROOT_URLCONF
'servirchirpsdjango.urls'
SECRET_KEY
u'********************'
SECURE_BROWSER_XSS_FILTER
False
SECURE_CONTENT_TYPE_NOSNIFF
False
SECURE_HSTS_INCLUDE_SUBDOMAINS
False
SECURE_HSTS_PRELOAD
False
SECURE_HSTS_SECONDS
0
SECURE_PROXY_SSL_HEADER
None
SECURE_REDIRECT_EXEMPT
[]
SECURE_SSL_HOST
None
SECURE_SSL_REDIRECT
False
SERVER_EMAIL
u'root@localhost'
SESSION_CACHE_ALIAS
u'default'
SESSION_COOKIE_AGE
1209600
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_HTTPONLY
True
SESSION_COOKIE_NAME
u'sessionid'
SESSION_COOKIE_PATH
u'/'
SESSION_COOKIE_SECURE
False
SESSION_ENGINE
u'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
SESSION_FILE_PATH
None
SESSION_SAVE_EVERY_REQUEST
False
SESSION_SERIALIZER
u'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE
'servirchirpsdjango.settings'
SHORT_DATETIME_FORMAT
u'm/d/Y P'
SHORT_DATE_FORMAT
u'm/d/Y'
SIGNING_BACKEND
u'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS
[]
SITE_ID
1
STATICFILES_DIRS
()
STATICFILES_FINDERS
('django.contrib.staticfiles.finders.FileSystemFinder',\n
-        'django.contrib.staticfiles.finders.AppDirectoriesFinder')
STATICFILES_STORAGE
u'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT
'/data/data/cserv/static/'
STATIC_URL
'/static/'
TEMPLATES
[{'APP_DIRS': True,\n  'BACKEND': 'django.template.backends.django.DjangoTemplates',\n
-        \ 'DIRS': ['/data/data/cserv/pythonCode/servirchirpsdjango/templates'],\n
-        \ 'OPTIONS': {'context_processors': ['django.template.context_processors.debug',\n
-        \                                    'django.template.context_processors.request',\n
-        \                                    'django.contrib.auth.context_processors.auth',\n
-        \                                    'django.contrib.messages.context_processors.messages'],\n
-        \             'debug': False}}]
TEST_NON_SERIALIZED_APPS
[]
TEST_RUNNER
u'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR
u','
TIME_FORMAT
u'P'
TIME_INPUT_FORMATS
[u'%H:%M:%S', u'%H:%M:%S.%f',
-        u'%H:%M']
TIME_ZONE
'America/Chicago'
USE_ETAGS
False
USE_I18N
True
USE_L10N
True
USE_THOUSAND_SEPARATOR
False
USE_TZ
True
USE_X_FORWARDED_HOST
False
USE_X_FORWARDED_PORT
False
WSGI_APPLICATION
'servirchirpsdjango.wsgi.application'
X_FRAME_OPTIONS
u'SAMEORIGIN'
YEAR_MONTH_FORMAT
u'F Y'
\n\n
\n\n
\n

\n You're - seeing this error because you have DEBUG = True in your\n Django - settings file. Change that to False, and Django will\n display - a standard page generated by the handler for this status code.\n

\n - \
\n\n\n\n" - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=9e1076d0-a958-4854-a2bf-e046f0c4dc91 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:27 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=9e1076d0-a958-4854-a2bf-e046f0c4dc91 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:28 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Fri, 28 Feb 2020 22:26:28 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '72338' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string: "\n\n\n\n \n \n - \ AttributeError at /getDataRequestProgress/\n \n \n \n - \ \n\n\n
\n

AttributeError at /getDataRequestProgress/

\n - \
'MultiValueDictKeyError' object has
-        no attribute 'errno'
\n \n\n \n - \ \n \n \n \n - \ \n \n - \ \n\n \n \n \n - \ \n\n \n \n \n - \ \n\n\n \n \n \n \n\n\n \n - \ \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n - \ \n \n \n \n \n
Request Method:GET
Request URL:https://climateserv.servirglobal.net/chirps/getDataRequestProgress/
Django Version:1.11
Exception Type:AttributeError
Exception Value:
'MultiValueDictKeyError'
-        object has no attribute 'errno'
Exception Location:/data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress, line 765
Python - Executable:/usr/bin/python
Python - Version:2.7.12
Python - Path:
['/data/data/cserv/pythonCode/servirchirpsdjango',\n
-        '/usr/lib/python2.7',\n '/usr/lib/python2.7/plat-x86_64-linux-gnu',\n
-        '/usr/lib/python2.7/lib-tk',\n '/usr/lib/python2.7/lib-old',\n
-        '/usr/lib/python2.7/lib-dynload',\n '/usr/local/lib/python2.7/dist-packages',\n
-        '/usr/lib/python2.7/dist-packages',\n '/data/data/cserv/pythonCode/serviringest']
Server time:Fri, 28 Feb 2020 - 16:26:28 -0600
\n
\n\n\n\n\n
\n - \

Traceback \n - \ Switch to copy-and-paste view\n

\n \n
\n - \
    \n \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py - in inner\n\n \n
    \n - \ \n
      \n - \ \n
    1.     This decorator is automatically applied
      -        to all middleware to ensure that
    2. \n \n
    3.     no
      -        middleware leaks an exception and that the next middleware in the stack
    4. \n - \ \n
    5.     can rely on getting a response instead of
      -        an exception.
    6. \n \n
    7.     """
    8. \n \n - \
    9. -        \   @wraps(get_response, assigned=available_attrs(get_response))
    10. \n - \ \n
    11.     def inner(request):
    12. \n \n - \
    13. -        \       try:
    14. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         except Exception as exc:
    2. \n - \ \n
    3.             response = response_for_exception(request,
      -        exc)
    4. \n \n
    5.         return response
    6. \n \n - \
    7. -        \   return inner
    8. \n \n
    9. \n \n
    10. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    exc
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    get_response
    <bound method WSGIHandler._legacy_get_response
    -        of <django.core.handlers.wsgi.WSGIHandler object at 0x7ff4283b19d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _legacy_get_response\n\n \n
    \n \n
      \n \n
    1.         #
      -        Apply request middleware
    2. \n \n
    3.         for
      -        middleware_method in self._request_middleware:
    4. \n \n - \
    5. -        \           response = middleware_method(request)
    6. \n \n - \
    7. -        \           if response:
    8. \n \n
    9.                 break
    10. \n - \ \n
    11. \n \n
    12.         if
      -        response is None:
    13. \n \n
    \n \n - \
      \n
    1. \n            response
      -        = self._get_response(request)
      ...
    \n \n - \
      \n - \ \n
    1.         return response
    2. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    middleware_method
    <bound method MessageMiddleware.process_request
    -        of <django.contrib.messages.middleware.MessageMiddleware object at 0x7ff427a933d0>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    \n \n
  • \n - \ \n \n
  • \n /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.                 break
    2. \n - \ \n
    3. \n \n
    4.         if
      -        response is None:
    5. \n \n
    6.             wrapped_callback = self.make_view_atomic(callback)
    7. \n - \ \n
    8.             try:
    9. \n \n - \
    10. -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
    11. \n - \ \n
    12.             except Exception as e:
    13. \n - \ \n
    \n \n
      \n
    1. \n                response = self.process_exception_by_middleware(e,
      -        request)
      ...
    \n \n
      \n \n - \
    1. \n - \ \n
    2.         # Complain if the view returned None
      -        (a common error).
    3. \n \n
    4.         if response is None:
    5. \n \n - \
    6. -        \           if isinstance(callback, types.FunctionType):    # FBV
    7. \n - \ \n
    8.                 view_name = callback.__name__
    9. \n - \ \n
    10.             else:                                           #
      -        CBV
    11. \n \n
    \n \n - \
    \n \n\n \n
    \n - \ \n Local vars\n \n - \
    \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7ff411a82050>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7ff427a8de10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7ff411a82050>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py - in _get_response\n\n \n
    \n \n
      \n \n
    1.             response
      -        = middleware_method(request, callback, callback_args, callback_kwargs)
    2. \n - \ \n
    3.             if response:
    4. \n \n - \
    5. -        \               break
    6. \n \n
    7. \n - \ \n
    8.         if response is None:
    9. \n \n - \
    10. -        \           wrapped_callback = self.make_view_atomic(callback)
    11. \n - \ \n
    12.             try:
    13. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \               response = wrapped_callback(request, *callback_args, **callback_kwargs)
      - ...
    \n \n
      \n \n
    1.             except
      -        Exception as e:
    2. \n \n
    3.                 response = self.process_exception_by_middleware(e,
      -        request)
    4. \n \n
    5. \n \n
    6.         #
      -        Complain if the view returned None (a common error).
    7. \n \n - \
    8. -        \       if response is None:
    9. \n \n
    10.             if
      -        isinstance(callback, types.FunctionType):    # FBV
    11. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n
    VariableValue
    callback
    <function getDataRequestProgress
    -        at 0x7ff411a82050>
    callback_args
    ()
    callback_kwargs
    {}
    e
    AttributeError("'MultiValueDictKeyError'
    -        object has no attribute 'errno'",)
    middleware_method
    <bound method CsrfViewMiddleware.process_view
    -        of <django.middleware.csrf.CsrfViewMiddleware object at 0x7ff427a8de10>>
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    resolver
    <RegexURLResolver 'servirchirpsdjango.urls'
    -        (None:None) ^/>
    resolver_match
    ResolverMatch(func=servirchirps.views.getDataRequestProgress,
    -        args=(), kwargs={}, url_name=None, app_names=[], namespaces=[])
    response
    None
    self
    <django.core.handlers.wsgi.WSGIHandler
    -        object at 0x7ff4283b19d0>
    wrapped_callback
    <function getDataRequestProgress at 0x7ff411a82050>
    \n - \ \n
  • \n \n \n
  • \n - \ /usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py - in wrapped_view\n\n \n
    \n \n
      \n \n
    1.     """
    2. \n - \ \n
    3.     Marks a view function as being exempt from
      -        the CSRF view protection.
    4. \n \n
    5.     """
    6. \n - \ \n
    7.     # We could just do view_func.csrf_exempt
      -        = True, but decorators
    8. \n \n
    9.     #
      -        are nicer if they don't have side-effects, so we return a new
    10. \n - \ \n
    11.     # function.
    12. \n \n - \
    13. -        \   def wrapped_view(*args, **kwargs):
    14. \n \n
    \n - \ \n
      \n
    1. \n        return
      -        view_func(*args, **kwargs)
      ...
    \n \n - \
      \n - \ \n
    1.     wrapped_view.csrf_exempt = True
    2. \n - \ \n
    3.     return wraps(view_func, assigned=available_attrs(view_func))(wrapped_view)
    4. \n - \ \n
    \n \n
    \n - \ \n\n \n
    \n \n - \ - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n - \ \n \n \n - \ \n
    VariableValue
    args
    (<WSGIRequest: GET '/chirps/getDataRequestProgress/'>,)
    kwargs
    {}
    view_func
    <function getDataRequestProgress
    -        at 0x7ff411a7df50>
    \n \n
  • \n - \ \n \n
  • \n /data/data/cserv/pythonCode/servirchirpsdjango/servirchirps/views.py - in getDataRequestProgress\n\n \n
    \n \n
      \n \n
    1.         if
      -        (progress == -1.0):
    2. \n \n
    3.             logger.warn("Problem with getDataRequestProgress:
      -        " + str(request))
    4. \n \n
    5.             return
      -        processCallBack(request, json.dumps([-1]), "application/json")
    6. \n - \ \n
    7.         else:
    8. \n \n - \
    9. -        \           return processCallBack(request, json.dumps([progress]), "application/json")
    10. \n - \ \n
    11.         ## return processCallBack(request,json.dumps([jsonresults['progress']]),"application/json")
    12. \n - \ \n
    13.     except Exception as e:
    14. \n \n - \
    \n \n
      \n - \
    1. \n
      -        \       logger.warn("Problem with getDataRequestProgress: " + str(request)
      -        + " " + str(e.errno) + " " + str(e.strerror))
      ...
    \n - \ \n
      \n - \ \n
    1.         return processCallBack(request, json.dumps([-1]),
      -        "application/json")
    2. \n \n
    3. \n - \ \n
    4. \n \n
    5. @csrf_exempt
    6. \n - \ \n
    7. def getDataFromRequest(request):
    8. \n - \ \n
    9.     '''
    10. \n \n - \
    \n \n
    \n \n\n \n - \
    \n \n - Local vars\n \n
    \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n
    VariableValue
    e
    MultiValueDictKeyError("'id'",)
    request
    <WSGIRequest: GET '/chirps/getDataRequestProgress/'>
    \n - \ \n
  • \n \n
\n
\n \n
\n\n
\n \n - \ \n \n \n - \ \n

\n \n
\n
\n
\n\n\n\n
\n

Request information

\n\n\n \n

USER

\n - \

AnonymousUser

\n \n\n

GET

\n \n

No - GET data

\n \n\n

POST

\n \n

No POST data

\n - \ \n

FILES

\n \n

No FILES data

\n \n\n\n - \

COOKIES

\n \n

No cookie data

\n \n\n - \

META

\n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n
VariableValue
CONTEXT_DOCUMENT_ROOT
'/data/data/cserv/www/html'
CONTEXT_PREFIX
''
DOCUMENT_ROOT
'/data/data/cserv/www/html'
GATEWAY_INTERFACE
'CGI/1.1'
HTTP_ACCEPT
'application/json,
-        text/xml, application/xml, */*'
HTTP_ACCEPT_ENCODING
'gzip,
-        deflate'
HTTP_HOST
'climateserv.servirglobal.net'
HTTP_USER_AGENT
'libcurl/7.64.1 r-curl/4.3 crul/0.9.0'
PATH_INFO
u'/getDataRequestProgress/'
PATH_TRANSLATED
'/data/data/cserv/www/html/getDataRequestProgress/'
QUERY_STRING
''
REMOTE_ADDR
'122.199.27.9'
REMOTE_PORT
'37457'
REQUEST_METHOD
'GET'
REQUEST_SCHEME
'https'
REQUEST_URI
'/chirps/getDataRequestProgress/'
SCRIPT_FILENAME
'/data/data/cserv/pythonCode/servirchirpsdjango/servirchirpsdjango/wsgi.py'
SCRIPT_NAME
u'/chirps'
SERVER_ADDR
'10.5.5.21'
SERVER_ADMIN
'root@localhost'
SERVER_NAME
'climateserv.servirglobal.net'
SERVER_PORT
'443'
SERVER_PROTOCOL
'HTTP/1.1'
SERVER_SIGNATURE
'<address>Apache/2.4.18 (Ubuntu)
-        Server at climateserv.servirglobal.net Port 443</address>\\n'
SERVER_SOFTWARE
'Apache/2.4.18 (Ubuntu)'
SSL_TLS_SNI
'climateserv.servirglobal.net'
apache.version
(2,
-        4, 18)
mod_wsgi.application_group
'climateserv.servirglobal.net|/chirps'
mod_wsgi.callable_object
'application'
mod_wsgi.enable_sendfile
'0'
mod_wsgi.handler_script
''
mod_wsgi.input_chunked
'0'
mod_wsgi.listener_host
''
mod_wsgi.listener_port
'443'
mod_wsgi.process_group
''
mod_wsgi.request_handler
'wsgi-script'
mod_wsgi.request_start
'1582928788790915'
mod_wsgi.script_reloading
'1'
mod_wsgi.script_start
'1582928788791143'
mod_wsgi.version
(4,
-        3, 0)
wsgi.errors
<mod_wsgi.Log object at 0x7ff40ebcc9c0>
wsgi.file_wrapper
''
wsgi.input
<mod_wsgi.Input
-        object at 0x7ff40ec6a9f0>
wsgi.multiprocess
True
wsgi.multithread
False
wsgi.run_once
False
wsgi.url_scheme
'https'
wsgi.version
(1,
-        0)
\n\n\n

Settings

\n

Using settings module servirchirpsdjango.settings

\n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n \n - \ \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n - \ \n \n \n - \ \n \n \n \n \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n - \ \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n \n \n \n \n \n - \ \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n \n \n - \ \n \n \n - \ \n \n \n \n - \ \n - \ \n \n \n \n - \ \n \n - \ \n \n \n \n \n \n \n - \
SettingValue
ABSOLUTE_URL_OVERRIDES
{}
ADMINS
()
ALLOWED_HOSTS
['*']
APPEND_SLASH
True
AUTHENTICATION_BACKENDS
[u'django.contrib.auth.backends.ModelBackend']
AUTH_PASSWORD_VALIDATORS
u'********************'
AUTH_USER_MODEL
u'auth.User'
BASE_DIR
'/data/data/cserv/pythonCode/servirchirpsdjango'
CACHES
{u'default': {u'BACKEND': u'django.core.cache.backends.locmem.LocMemCache'}}
CACHE_MIDDLEWARE_ALIAS
u'default'
CACHE_MIDDLEWARE_KEY_PREFIX
u'********************'
CACHE_MIDDLEWARE_SECONDS
600
CORS_ORIGIN_ALLOW_ALL
True
CORS_ORIGIN_WHITELIST
('54.172.93.198',)
CSRF_COOKIE_AGE
31449600
CSRF_COOKIE_DOMAIN
None
CSRF_COOKIE_HTTPONLY
False
CSRF_COOKIE_NAME
u'csrftoken'
CSRF_COOKIE_PATH
u'/'
CSRF_COOKIE_SECURE
False
CSRF_FAILURE_VIEW
u'django.views.csrf.csrf_failure'
CSRF_HEADER_NAME
u'HTTP_X_CSRFTOKEN'
CSRF_TRUSTED_ORIGINS
[]
CSRF_USE_SESSIONS
False
DATABASES
{'default': {'ATOMIC_REQUESTS': False,\n
-        \            'AUTOCOMMIT': True,\n             'CONN_MAX_AGE':
-        0,\n             'ENGINE': 'django.db.backends.sqlite3',\n
-        \            'HOST': '',\n             'NAME': '/data/data/cserv/pythonCode/servirchirpsdjango/sqlite.db',\n
-        \            'OPTIONS': {},\n             'PASSWORD': u'********************',\n
-        \            'PORT': '',\n             'TEST': {'CHARSET':
-        None,\n                      'COLLATION': None,\n                      'MIRROR':
-        None,\n                      'NAME': None},\n             'TIME_ZONE':
-        None,\n             'USER': ''}}
DATABASE_ROUTERS
[]
DATA_UPLOAD_MAX_MEMORY_SIZE
2621440
DATA_UPLOAD_MAX_NUMBER_FIELDS
1000
DATETIME_FORMAT
u'N
-        j, Y, P'
DATETIME_INPUT_FORMATS
[u'%Y-%m-%d %H:%M:%S',\n u'%Y-%m-%d
-        %H:%M:%S.%f',\n u'%Y-%m-%d %H:%M',\n u'%Y-%m-%d',\n u'%m/%d/%Y
-        %H:%M:%S',\n u'%m/%d/%Y %H:%M:%S.%f',\n u'%m/%d/%Y %H:%M',\n
-        u'%m/%d/%Y',\n u'%m/%d/%y %H:%M:%S',\n u'%m/%d/%y %H:%M:%S.%f',\n
-        u'%m/%d/%y %H:%M',\n u'%m/%d/%y']
DATE_FORMAT
u'N
-        j, Y'
DATE_INPUT_FORMATS
[u'%Y-%m-%d',\n u'%m/%d/%Y',\n
-        u'%m/%d/%y',\n u'%b %d %Y',\n u'%b %d, %Y',\n u'%d
-        %b %Y',\n u'%d %b, %Y',\n u'%B %d %Y',\n u'%B %d,
-        %Y',\n u'%d %B %Y',\n u'%d %B, %Y']
DEBUG
True
DEBUG_PROPAGATE_EXCEPTIONS
False
DECIMAL_SEPARATOR
u'.'
DEFAULT_CHARSET
u'utf-8'
DEFAULT_CONTENT_TYPE
u'text/html'
DEFAULT_EXCEPTION_REPORTER_FILTER
u'django.views.debug.SafeExceptionReporterFilter'
DEFAULT_FILE_STORAGE
u'django.core.files.storage.FileSystemStorage'
DEFAULT_FROM_EMAIL
u'webmaster@localhost'
DEFAULT_INDEX_TABLESPACE
u''
DEFAULT_TABLESPACE
u''
DISALLOWED_USER_AGENTS
[]
EMAIL_BACKEND
u'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST
u'localhost'
EMAIL_HOST_PASSWORD
u'********************'
EMAIL_HOST_USER
u''
EMAIL_PORT
25
EMAIL_SSL_CERTFILE
None
EMAIL_SSL_KEYFILE
u'********************'
EMAIL_SUBJECT_PREFIX
u'[Django] '
EMAIL_TIMEOUT
None
EMAIL_USE_LOCALTIME
False
EMAIL_USE_SSL
False
EMAIL_USE_TLS
False
FILE_CHARSET
u'utf-8'
FILE_UPLOAD_DIRECTORY_PERMISSIONS
None
FILE_UPLOAD_HANDLERS
[u'django.core.files.uploadhandler.MemoryFileUploadHandler',\n
-        u'django.core.files.uploadhandler.TemporaryFileUploadHandler']
FILE_UPLOAD_MAX_MEMORY_SIZE
2621440
FILE_UPLOAD_PERMISSIONS
None
FILE_UPLOAD_TEMP_DIR
None
FIRST_DAY_OF_WEEK
0
FIXTURE_DIRS
[]
FORCE_SCRIPT_NAME
None
FORMAT_MODULE_PATH
None
FORM_RENDERER
u'django.forms.renderers.DjangoTemplates'
IGNORABLE_404_URLS
[]
INSTALLED_APPS
['polls',\n
-        'django.contrib.auth',\n 'django.contrib.contenttypes',\n
-        'django.contrib.sessions',\n 'django.contrib.sites',\n 'django.contrib.messages',\n
-        'django.contrib.staticfiles',\n 'servirchirps',\n 'corsheaders',\n
-        'django.contrib.admin',\n 'django.contrib.admindocs',\n 'pydash',\n
-        'servirmetrics']
INTERNAL_IPS
[]
LANGUAGES
[(u'af', u'Afrikaans'),\n (u'ar',
-        u'Arabic'),\n (u'ast', u'Asturian'),\n (u'az',
-        u'Azerbaijani'),\n (u'bg', u'Bulgarian'),\n (u'be',
-        u'Belarusian'),\n (u'bn', u'Bengali'),\n (u'br',
-        u'Breton'),\n (u'bs', u'Bosnian'),\n (u'ca',
-        u'Catalan'),\n (u'cs', u'Czech'),\n (u'cy',
-        u'Welsh'),\n (u'da', u'Danish'),\n (u'de',
-        u'German'),\n (u'dsb', u'Lower Sorbian'),\n (u'el',
-        u'Greek'),\n (u'en', u'English'),\n (u'en-au',
-        u'Australian English'),\n (u'en-gb', u'British English'),\n
-        (u'eo', u'Esperanto'),\n (u'es', u'Spanish'),\n
-        (u'es-ar', u'Argentinian Spanish'),\n (u'es-co', u'Colombian
-        Spanish'),\n (u'es-mx', u'Mexican Spanish'),\n (u'es-ni',
-        u'Nicaraguan Spanish'),\n (u'es-ve', u'Venezuelan Spanish'),\n
-        (u'et', u'Estonian'),\n (u'eu', u'Basque'),\n
-        (u'fa', u'Persian'),\n (u'fi', u'Finnish'),\n
-        (u'fr', u'French'),\n (u'fy', u'Frisian'),\n
-        (u'ga', u'Irish'),\n (u'gd', u'Scottish Gaelic'),\n
-        (u'gl', u'Galician'),\n (u'he', u'Hebrew'),\n
-        (u'hi', u'Hindi'),\n (u'hr', u'Croatian'),\n
-        (u'hsb', u'Upper Sorbian'),\n (u'hu', u'Hungarian'),\n
-        (u'ia', u'Interlingua'),\n (u'id', u'Indonesian'),\n
-        (u'io', u'Ido'),\n (u'is', u'Icelandic'),\n
-        (u'it', u'Italian'),\n (u'ja', u'Japanese'),\n
-        (u'ka', u'Georgian'),\n (u'kk', u'Kazakh'),\n
-        (u'km', u'Khmer'),\n (u'kn', u'Kannada'),\n
-        (u'ko', u'Korean'),\n (u'lb', u'Luxembourgish'),\n
-        (u'lt', u'Lithuanian'),\n (u'lv', u'Latvian'),\n
-        (u'mk', u'Macedonian'),\n (u'ml', u'Malayalam'),\n
-        (u'mn', u'Mongolian'),\n (u'mr', u'Marathi'),\n
-        (u'my', u'Burmese'),\n (u'nb', u'Norwegian Bokm\\xe5l'),\n
-        (u'ne', u'Nepali'),\n (u'nl', u'Dutch'),\n
-        (u'nn', u'Norwegian Nynorsk'),\n (u'os', u'Ossetic'),\n
-        (u'pa', u'Punjabi'),\n (u'pl', u'Polish'),\n
-        (u'pt', u'Portuguese'),\n (u'pt-br', u'Brazilian
-        Portuguese'),\n (u'ro', u'Romanian'),\n (u'ru',
-        u'Russian'),\n (u'sk', u'Slovak'),\n (u'sl',
-        u'Slovenian'),\n (u'sq', u'Albanian'),\n (u'sr',
-        u'Serbian'),\n (u'sr-latn', u'Serbian Latin'),\n (u'sv',
-        u'Swedish'),\n (u'sw', u'Swahili'),\n (u'ta',
-        u'Tamil'),\n (u'te', u'Telugu'),\n (u'th',
-        u'Thai'),\n (u'tr', u'Turkish'),\n (u'tt',
-        u'Tatar'),\n (u'udm', u'Udmurt'),\n (u'uk',
-        u'Ukrainian'),\n (u'ur', u'Urdu'),\n (u'vi',
-        u'Vietnamese'),\n (u'zh-hans', u'Simplified Chinese'),\n
-        (u'zh-hant', u'Traditional Chinese')]
LANGUAGES_BIDI
[u'he',
-        u'ar', u'fa', u'ur']
LANGUAGE_CODE
'en-us'
LANGUAGE_COOKIE_AGE
None
LANGUAGE_COOKIE_DOMAIN
None
LANGUAGE_COOKIE_NAME
u'django_language'
LANGUAGE_COOKIE_PATH
u'/'
LOCALE_PATHS
[]
LOGGING
{'disable_existing_loggers': True,\n 'filters':
-        {},\n 'formatters': {'simple': {'format': '%(levelname)s,
-        %(message)s'},\n                'verbose': {'format':
-        '%(levelname)s, %(asctime)s, %(module)s, %(process)d, %(thread)d, %(message)s'}},\n
-        'handlers': {'console': {'class': 'logging.StreamHandler',\n
-        \                         'formatter': 'simple',\n                          'level':
-        'DEBUG'},\n              'log_file_chirps': {'class':
-        'logging.handlers.RotatingFileHandler',\n                                  'filename':
-        '/data/data/cserv/chirps.log',\n                                  'formatter':
-        'verbose',\n                                  'level': 'DEBUG',\n
-        \                                 'maxBytes': '16777216'},\n
-        \             'log_file_metrics': {'backupCount': '10',\n
-        \                                  'class': 'logging.handlers.RotatingFileHandler',\n
-        \                                  'filename': '/data/data/logs/metrics/metrics.log',\n
-        \                                  'formatter': 'verbose',\n
-        \                                  'level': 'INFO',\n                                   'maxBytes':
-        '100000000'}},\n 'loggers': {'CHIRPS': {'handlers':
-        ['log_file_chirps'],\n                        'level': 'INFO',\n
-        \                       'propagate': False},\n             'metrics_logger':
-        {'handlers': ['log_file_metrics'],\n                                'level':
-        'INFO'},\n             'servirchirps': {'handlers':
-        ['log_file_chirps'],\n                              'level':
-        'INFO',\n                              'propagate': False}},\n
-        'version': 1}
LOGGING_CONFIG
u'logging.config.dictConfig'
LOGIN_REDIRECT_URL
u'/accounts/profile/'
LOGIN_URL
u'/accounts/login/'
LOGOUT_REDIRECT_URL
None
MANAGERS
()
MEDIA_ROOT
''
MEDIA_URL
''
MESSAGE_STORAGE
u'django.contrib.messages.storage.fallback.FallbackStorage'
MIDDLEWARE
None
MIDDLEWARE_CLASSES
('corsheaders.middleware.CorsMiddleware',\n
-        'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n
-        'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n
-        'django.contrib.messages.middleware.MessageMiddleware',\n 'servirchirpsdjango.middleware.MetricsTracking')
MIGRATION_MODULES
{}
MONTH_DAY_FORMAT
u'F
-        j'
NUMBER_GROUPING
0
PASSWORD_HASHERS
u'********************'
PASSWORD_RESET_TIMEOUT_DAYS
u'********************'
PREPEND_WWW
False
ROOT_URLCONF
'servirchirpsdjango.urls'
SECRET_KEY
u'********************'
SECURE_BROWSER_XSS_FILTER
False
SECURE_CONTENT_TYPE_NOSNIFF
False
SECURE_HSTS_INCLUDE_SUBDOMAINS
False
SECURE_HSTS_PRELOAD
False
SECURE_HSTS_SECONDS
0
SECURE_PROXY_SSL_HEADER
None
SECURE_REDIRECT_EXEMPT
[]
SECURE_SSL_HOST
None
SECURE_SSL_REDIRECT
False
SERVER_EMAIL
u'root@localhost'
SESSION_CACHE_ALIAS
u'default'
SESSION_COOKIE_AGE
1209600
SESSION_COOKIE_DOMAIN
None
SESSION_COOKIE_HTTPONLY
True
SESSION_COOKIE_NAME
u'sessionid'
SESSION_COOKIE_PATH
u'/'
SESSION_COOKIE_SECURE
False
SESSION_ENGINE
u'django.contrib.sessions.backends.db'
SESSION_EXPIRE_AT_BROWSER_CLOSE
False
SESSION_FILE_PATH
None
SESSION_SAVE_EVERY_REQUEST
False
SESSION_SERIALIZER
u'django.contrib.sessions.serializers.JSONSerializer'
SETTINGS_MODULE
'servirchirpsdjango.settings'
SHORT_DATETIME_FORMAT
u'm/d/Y P'
SHORT_DATE_FORMAT
u'm/d/Y'
SIGNING_BACKEND
u'django.core.signing.TimestampSigner'
SILENCED_SYSTEM_CHECKS
[]
SITE_ID
1
STATICFILES_DIRS
()
STATICFILES_FINDERS
('django.contrib.staticfiles.finders.FileSystemFinder',\n
-        'django.contrib.staticfiles.finders.AppDirectoriesFinder')
STATICFILES_STORAGE
u'django.contrib.staticfiles.storage.StaticFilesStorage'
STATIC_ROOT
'/data/data/cserv/static/'
STATIC_URL
'/static/'
TEMPLATES
[{'APP_DIRS': True,\n  'BACKEND': 'django.template.backends.django.DjangoTemplates',\n
-        \ 'DIRS': ['/data/data/cserv/pythonCode/servirchirpsdjango/templates'],\n
-        \ 'OPTIONS': {'context_processors': ['django.template.context_processors.debug',\n
-        \                                    'django.template.context_processors.request',\n
-        \                                    'django.contrib.auth.context_processors.auth',\n
-        \                                    'django.contrib.messages.context_processors.messages'],\n
-        \             'debug': False}}]
TEST_NON_SERIALIZED_APPS
[]
TEST_RUNNER
u'django.test.runner.DiscoverRunner'
THOUSAND_SEPARATOR
u','
TIME_FORMAT
u'P'
TIME_INPUT_FORMATS
[u'%H:%M:%S', u'%H:%M:%S.%f',
-        u'%H:%M']
TIME_ZONE
'America/Chicago'
USE_ETAGS
False
USE_I18N
True
USE_L10N
True
USE_THOUSAND_SEPARATOR
False
USE_TZ
True
USE_X_FORWARDED_HOST
False
USE_X_FORWARDED_PORT
False
WSGI_APPLICATION
'servirchirpsdjango.wsgi.application'
X_FRAME_OPTIONS
u'SAMEORIGIN'
YEAR_MONTH_FORMAT
u'F Y'
\n\n
\n\n
\n

\n You're - seeing this error because you have DEBUG = True in your\n Django - settings file. Change that to False, and Django will\n display - a standard page generated by the handler for this status code.\n

\n - \
\n\n\n\n" - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=02d13860-06d0-439b-8efe-3ff18a49954d - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:29 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=02d13860-06d0-439b-8efe-3ff18a49954d - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:30 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:31 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=9e1076d0-a958-4854-a2bf-e046f0c4dc91 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:32 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "4af71c8e-ad5d-49d4-a67f-22f9d107d697", - "epochTime": "946684800", "value": {"avg": 9.255108833312988}}, {"date": "1/2/2000", - "workid": "2e11b2ee-bb57-4dc9-af5d-4674ea58f734", "epochTime": "946771200", - "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "2a000c46-4909-4543-8427-1c719ffbdce2", - "epochTime": "946857600", "value": {"avg": 0.0}}, {"date": "1/4/2000", "workid": - "ea46d089-5691-4eec-9e85-3464fd6f0868", "epochTime": "946944000", "value": - {"avg": 0.0}}, {"date": "1/5/2000", "workid": "b82ca50e-6e38-432a-8d88-b7a09321959b", - "epochTime": "947030400", "value": {"avg": 18.510217666625977}}]}' - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=9e1076d0-a958-4854-a2bf-e046f0c4dc91 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:32 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "4af71c8e-ad5d-49d4-a67f-22f9d107d697", - "epochTime": "946684800", "value": {"avg": 9.255108833312988}}, {"date": "1/2/2000", - "workid": "2e11b2ee-bb57-4dc9-af5d-4674ea58f734", "epochTime": "946771200", - "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "2a000c46-4909-4543-8427-1c719ffbdce2", - "epochTime": "946857600", "value": {"avg": 0.0}}, {"date": "1/4/2000", "workid": - "ea46d089-5691-4eec-9e85-3464fd6f0868", "epochTime": "946944000", "value": - {"avg": 0.0}}, {"date": "1/5/2000", "workid": "b82ca50e-6e38-432a-8d88-b7a09321959b", - "epochTime": "947030400", "value": {"avg": 18.510217666625977}}]}' - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:33 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=02d13860-06d0-439b-8efe-3ff18a49954d - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:34 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "29935263-a0c9-45d0-9628-0b54f5bd929d", - "epochTime": "946684800", "value": {"avg": 38.354225158691406}}, {"date": - "1/2/2000", "workid": "857d85e8-968f-4554-a61e-80aebd070be7", "epochTime": - "946771200", "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "79a9ee3d-52a3-4c47-914b-77aa3f78df12", - "epochTime": "946857600", "value": {"avg": 38.354225158691406}}, {"date": - "1/4/2000", "workid": "d348f5a1-70ef-498d-8ad5-f26f67a9cde6", "epochTime": - "946944000", "value": {"avg": 0.0}}, {"date": "1/5/2000", "workid": "29eca791-f453-4780-9bd1-87640f2d2027", - "epochTime": "947030400", "value": {"avg": 0.0}}]}' - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=02d13860-06d0-439b-8efe-3ff18a49954d - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3 crul/0.9.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Fri, 28 Feb 2020 22:26:34 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "29935263-a0c9-45d0-9628-0b54f5bd929d", - "epochTime": "946684800", "value": {"avg": 38.354225158691406}}, {"date": - "1/2/2000", "workid": "857d85e8-968f-4554-a61e-80aebd070be7", "epochTime": - "946771200", "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "79a9ee3d-52a3-4c47-914b-77aa3f78df12", - "epochTime": "946857600", "value": {"avg": 38.354225158691406}}, {"date": - "1/4/2000", "workid": "d348f5a1-70ef-498d-8ad5-f26f67a9cde6", "epochTime": - "946944000", "value": {"avg": 0.0}}, {"date": "1/5/2000", "workid": "29eca791-f453-4780-9bd1-87640f2d2027", - "epochTime": "947030400", "value": {"avg": 0.0}}]}' - recorded_at: 2020-02-28 22:26:33 GMT - recorded_with: vcr/0.4.2.94, webmockr/0.5.1.98 diff --git a/tests/testthat/helper-chirps.R b/tests/testthat/helper-chirps.R deleted file mode 100644 index 9f768db..0000000 --- a/tests/testthat/helper-chirps.R +++ /dev/null @@ -1,2 +0,0 @@ -library("vcr") -invisible(vcr::vcr_configure(dir = "../fixtures/vcr_cassettes")) diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index bfc3a66..9f5ab5d 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -1,53 +1,26 @@ -# load("tests/test_data.rda") -load("../test_data.rda") - -# Test if get_chirps fetch the correct values, -# for this we downloaded two points from -# https://climateserv.servirglobal.net/ -# and will compare it with the values retrieved by get_chirps - -# Test default method +# Test if get_chirps() returns a properly formatted object. +# for this we downloaded two points from https://climateserv.servirglobal.net/ +# Test default method ----- test_that("default method", { - vcr::use_cassette("default_method", { - x <- get_chirps(lonlat, dates) - - x <- round(x$chirps, 2) - - equal <- all(x == chirps$chirps) - - expect_true(equal) - }) + x <- get_chirps(lonlat, dates) + expect_named(x, c("id", "lon", "lat", "date", "chirps")) + expect_equal(nrow(x), 10) + expect_s3_class(x, c("chirps", "chirps_df", "data.frame")) }) -library("sf") -# get_chirps for sf objects -coords <- st_as_sf(lonlat, coords = c("lon", "lat")) - +# Test `sf` method ----- test_that("sf method", { - vcr::use_cassette("sf_method", { - y <- get_chirps(coords, dates) - - y <- round(y$chirps, 2) - - equal <- all(y == chirps$chirps) - - expect_true(equal) - }) + y <- get_chirps(coords, dates) + expect_named(y, c("id", "lon", "lat", "date", "chirps")) + expect_equal(nrow(y), 10) + expect_s3_class(y, c("chirps", "chirps_df", "data.frame")) }) -# get chirps with geojson method -geojson <- as.geojson(lonlat) - - +# Test geojson method ----- test_that("geojson method", { - vcr::use_cassette("geojson_method", { - z <- suppressWarnings(get_chirps(geojson, dates)) - - z <- round(z$chirps, 2) - - equal <- all(z == chirps$chirps) - - expect_true(equal) - }) + z <- suppressWarnings(get_chirps(geojson, dates)) + expect_named(z, c("id", "lon", "lat", "date", "chirps")) + expect_equal(nrow(z), 10) + expect_s3_class(z, c("chirps", "chirps_df", "data.frame")) }) diff --git a/tests/testthat/test-get_esi.R b/tests/testthat/test-get_esi.R index 3523ac6..55720d1 100644 --- a/tests/testthat/test-get_esi.R +++ b/tests/testthat/test-get_esi.R @@ -1,22 +1,11 @@ # load("tests/test_data.rda") load("../test_data.rda") -# Test if get_chirps fetch the correct values, -# for this we downloaded two points from -# https://climateserv.servirglobal.net/ -# and will compare it with the values retrieved by get_chirps - -values <- c(NA, -1.89, -1.92, -2.12) - -# Test get_esi +# Test get_esi() ----- test_that("get_esi", { - vcr::use_cassette("get_esi", { - x <- get_esi(lonlat, dates = c("2002-01-01", "2002-01-31")) - - x <- round(x$esi, 2) - - equal <- all(x == values, na.rm = TRUE) - - expect_true(equal) - }) + x <- get_esi(lonlat, dates = c("2002-01-01", "2002-01-31")) + + expect_named(x, c("id", "lon", "lat", "date", "esi")) + expect_equal(nrow(x), 10) + expect_s3_class(x, c("chirps", "chirps_df", "data.frame")) }) From c8c729b33124c8f97139ce03d7e7020a7f1d1973 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 09:58:21 +0800 Subject: [PATCH 11/93] update test_data.rda contents --- R/test_data.rda | Bin 0 -> 493 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 R/test_data.rda diff --git a/R/test_data.rda b/R/test_data.rda new file mode 100644 index 0000000000000000000000000000000000000000..6f8f0637c16faf1adf8672c26fc8268c37a49ed9 GIT binary patch literal 493 zcmV-uOT$1A9ydwRNJa4O!IOfmX|>=nVAX>lC_ah`8uPG) z*p?XdS_*pg=0ya5hR1?*dO{= z6L1T{=EhQP9)Kq(3;+*9$TMoSW;IVxbIel*E{k0BGysT?p)Oue#=_Q2{Zu#68jO0U zJ}OFu8T^WpB>hB+F=RG|%*BwBkA&Y9R8u)&&j!vIifT73+;wq{xCZ2j^YOd2w{u7# zx!AtkoBX(!7p5PPo&r1~_b8OE=pymux=kGFDWRT{W+B)WeI1VJBt{bszOEeWEO?HB zd|9#eNR3&I8g)~#BSwa-##x>ja$_Pb{Ba!TGsPcKQ*0$~Sa>DLCp-;&VquDI<#JL1 zzZg=AbrSW`>q|llNII)Rc4zl$s{>ej|F<;AFbiHXb@pPPBYMt2X=GE_Ri&n+_wA^kH|d=bqxFOA~h|gcc@=l je9n@4COSxb@^spV=DudIhfqqJH|Tx?$PdwA=LG-&vj*r~ literal 0 HcmV?d00001 From 05d7aba68103c2d55e574dca2e1d700add9be9f8 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 10:00:08 +0800 Subject: [PATCH 12/93] remove test_data.rda from ./R --- R/test_data.rda | Bin 493 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 R/test_data.rda diff --git a/R/test_data.rda b/R/test_data.rda deleted file mode 100644 index 6f8f0637c16faf1adf8672c26fc8268c37a49ed9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 493 zcmV-uOT$1A9ydwRNJa4O!IOfmX|>=nVAX>lC_ah`8uPG) z*p?XdS_*pg=0ya5hR1?*dO{= z6L1T{=EhQP9)Kq(3;+*9$TMoSW;IVxbIel*E{k0BGysT?p)Oue#=_Q2{Zu#68jO0U zJ}OFu8T^WpB>hB+F=RG|%*BwBkA&Y9R8u)&&j!vIifT73+;wq{xCZ2j^YOd2w{u7# zx!AtkoBX(!7p5PPo&r1~_b8OE=pymux=kGFDWRT{W+B)WeI1VJBt{bszOEeWEO?HB zd|9#eNR3&I8g)~#BSwa-##x>ja$_Pb{Ba!TGsPcKQ*0$~Sa>DLCp-;&VquDI<#JL1 zzZg=AbrSW`>q|llNII)Rc4zl$s{>ej|F<;AFbiHXb@pPPBYMt2X=GE_Ri&n+_wA^kH|d=bqxFOA~h|gcc@=l je9n@4COSxb@^spV=DudIhfqqJH|Tx?$PdwA=LG-&vj*r~ From 8c87e0ea8598248a326f97e9384e1582bff736d3 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 10:00:46 +0800 Subject: [PATCH 13/93] setup chirps to use vcr --- DESCRIPTION | 1 + tests/testthat/setup-chirps.R | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 tests/testthat/setup-chirps.R diff --git a/DESCRIPTION b/DESCRIPTION index f179d97..2c39d81 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -40,6 +40,7 @@ Imports: stats, terra (>= 1.2-10) Suggests: + vcr (>= 0.6.0), climatrends, knitr, markdown, diff --git a/tests/testthat/setup-chirps.R b/tests/testthat/setup-chirps.R new file mode 100644 index 0000000..1c8e3e7 --- /dev/null +++ b/tests/testthat/setup-chirps.R @@ -0,0 +1,5 @@ +library("vcr") # *Required* as vcr is set up on loading +invisible(vcr::vcr_configure( + dir = vcr::vcr_test_path("fixtures") +)) +vcr::check_cassette_names() From 6daaa04ff5a58e20887261e4b6d7524caa0990cc Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 10:10:45 +0800 Subject: [PATCH 14/93] Add new cassette for get_esi tests --- tests/fixtures/get_esi.yml | 537 ++++++++++++++++++++++++++++++++++ tests/testthat/test-get_esi.R | 11 +- 2 files changed, 543 insertions(+), 5 deletions(-) create mode 100644 tests/fixtures/get_esi.yml diff --git a/tests/fixtures/get_esi.yml b/tests/fixtures/get_esi.yml new file mode 100644 index 0000000..d85059d --- /dev/null +++ b/tests/fixtures/get_esi.yml @@ -0,0 +1,537 @@ +http_interactions: +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:16 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:17 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["5f663dfd-929d-4934-9741-6ddbff427581"]) + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:18 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:19 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["5c9e8625-0117-4f80-b1df-9f452f4627ee"]) + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:02:20 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=5f663dfd-929d-4934-9741-6ddbff427581 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:21 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=5f663dfd-929d-4934-9741-6ddbff427581 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:22 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:02:23 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=5c9e8625-0117-4f80-b1df-9f452f4627ee + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:24 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=5c9e8625-0117-4f80-b1df-9f452f4627ee + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:25 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:26 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=5f663dfd-929d-4934-9741-6ddbff427581 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:27 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": []}' + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=5f663dfd-929d-4934-9741-6ddbff427581 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:28 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": []}' + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:29 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=5c9e8625-0117-4f80-b1df-9f452f4627ee + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:30 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2002", "workid": "6e2f1923-8f2d-475a-8929-52cc4308f0f2", + "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": + "1/9/2002", "workid": "1226a7c5-50d2-420d-a00f-35bc669d3bea", "epochTime": + "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", + "workid": "eebc661f-4cdd-4cfd-a41b-58f6b8e6f018", "epochTime": "1011225600", + "value": {"avg": -2.1174285411834717}}]}' + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=5c9e8625-0117-4f80-b1df-9f452f4627ee + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:02:31 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2002", "workid": "6e2f1923-8f2d-475a-8929-52cc4308f0f2", + "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": + "1/9/2002", "workid": "1226a7c5-50d2-420d-a00f-35bc669d3bea", "epochTime": + "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", + "workid": "eebc661f-4cdd-4cfd-a41b-58f6b8e6f018", "epochTime": "1011225600", + "value": {"avg": -2.1174285411834717}}]}' + recorded_at: 2021-09-19 02:02:31 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/testthat/test-get_esi.R b/tests/testthat/test-get_esi.R index 55720d1..f2b0152 100644 --- a/tests/testthat/test-get_esi.R +++ b/tests/testthat/test-get_esi.R @@ -1,11 +1,12 @@ -# load("tests/test_data.rda") + load("../test_data.rda") # Test get_esi() ----- -test_that("get_esi", { - x <- get_esi(lonlat, dates = c("2002-01-01", "2002-01-31")) - +test_that("get_esi returns proper values", { + vcr::use_cassette("get_esi", { + x <- get_esi(lonlat, dates = c("2002-01-01", "2002-01-31")) + }) expect_named(x, c("id", "lon", "lat", "date", "esi")) - expect_equal(nrow(x), 10) + expect_equal(nrow(x), 4) expect_s3_class(x, c("chirps", "chirps_df", "data.frame")) }) From 8870794a4c372d760a667024fc8d4c2d64a315d2 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 10:11:23 +0800 Subject: [PATCH 15/93] Revise tests for get_chirps (vcr still doesn't work here though?) --- tests/testthat/test-get_chirps.R | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index 9f5ab5d..fbcc01a 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -1,25 +1,33 @@ # Test if get_chirps() returns a properly formatted object. # for this we downloaded two points from https://climateserv.servirglobal.net/ +load("../test_data.rda") + # Test default method ----- -test_that("default method", { - x <- get_chirps(lonlat, dates) +test_that("default_method returns proper values", { + vcr::use_cassette("default_method", { + x <- get_chirps(lonlat, dates) + }) expect_named(x, c("id", "lon", "lat", "date", "chirps")) expect_equal(nrow(x), 10) expect_s3_class(x, c("chirps", "chirps_df", "data.frame")) }) # Test `sf` method ----- -test_that("sf method", { - y <- get_chirps(coords, dates) +test_that("sf_method", { + vcr::use_cassette("sf_method", { + y <- get_chirps(coords, dates) + }) expect_named(y, c("id", "lon", "lat", "date", "chirps")) expect_equal(nrow(y), 10) expect_s3_class(y, c("chirps", "chirps_df", "data.frame")) }) # Test geojson method ----- -test_that("geojson method", { - z <- suppressWarnings(get_chirps(geojson, dates)) +test_that("geojson_method", { + vcr::use_cassette("geojson_method", { + z <- suppressWarnings(get_chirps(geojson, dates)) + }) expect_named(z, c("id", "lon", "lat", "date", "chirps")) expect_equal(nrow(z), 10) expect_s3_class(z, c("chirps", "chirps_df", "data.frame")) From 2a834ae00b66a7c61d4a0cc1ed1082aa3b85d50b Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 10:11:37 +0800 Subject: [PATCH 16/93] Update .gitattributes for vcr config --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..165ff7a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* text=auto +tests/fixtures/**/* -diff From 713308c3703c644eba8a1a19ac9a44be2791fd30 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 10:14:55 +0800 Subject: [PATCH 17/93] creates `coords` and `geojson` objects for tests --- tests/testthat/test-get_chirps.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index fbcc01a..a0e62cf 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -14,6 +14,7 @@ test_that("default_method returns proper values", { }) # Test `sf` method ----- +coords <- st_as_sf(lonlat, coords = c("lon", "lat")) test_that("sf_method", { vcr::use_cassette("sf_method", { y <- get_chirps(coords, dates) @@ -24,6 +25,7 @@ test_that("sf_method", { }) # Test geojson method ----- +geojson <- as.geojson(lonlat) test_that("geojson_method", { vcr::use_cassette("geojson_method", { z <- suppressWarnings(get_chirps(geojson, dates)) From 87ea90c29c61b7f42c15133e47723527c3ada754 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 10:16:45 +0800 Subject: [PATCH 18/93] Add comment on contents of test_data.rda for clarity --- tests/testthat/test-get_chirps.R | 1 + tests/testthat/test-get_esi.R | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index a0e62cf..c21dc87 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -1,6 +1,7 @@ # Test if get_chirps() returns a properly formatted object. # for this we downloaded two points from https://climateserv.servirglobal.net/ +# test_data.rda contains lat/lon and date values for the following tests load("../test_data.rda") # Test default method ----- diff --git a/tests/testthat/test-get_esi.R b/tests/testthat/test-get_esi.R index f2b0152..02bb527 100644 --- a/tests/testthat/test-get_esi.R +++ b/tests/testthat/test-get_esi.R @@ -1,4 +1,5 @@ +# test_data.rda contains lat/lon and date values for the following test load("../test_data.rda") # Test get_esi() ----- From 7226cf9bed3d2fa6595294610aec8bf3d6a0a1c8 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 10:42:00 +0800 Subject: [PATCH 19/93] Enhance tests for get_esi --- .../fixtures/ESI_geojson_method_return_df.yml | 537 ++++++++++++++++++ .../ESI_geojson_method_return_geojson.yml | 537 ++++++++++++++++++ tests/fixtures/ESI_sf_method_return_df.yml | 537 ++++++++++++++++++ tests/fixtures/ESI_sf_method_return_sf.yml | 537 ++++++++++++++++++ tests/testthat/test-get_esi.R | 56 +- 5 files changed, 2203 insertions(+), 1 deletion(-) create mode 100644 tests/fixtures/ESI_geojson_method_return_df.yml create mode 100644 tests/fixtures/ESI_geojson_method_return_geojson.yml create mode 100644 tests/fixtures/ESI_sf_method_return_df.yml create mode 100644 tests/fixtures/ESI_sf_method_return_sf.yml diff --git a/tests/fixtures/ESI_geojson_method_return_df.yml b/tests/fixtures/ESI_geojson_method_return_df.yml new file mode 100644 index 0000000..9d236bc --- /dev/null +++ b/tests/fixtures/ESI_geojson_method_return_df.yml @@ -0,0 +1,537 @@ +http_interactions: +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:45 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:46 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["70dc5a46-bf7f-4870-b9ca-9b3d14302773"]) + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:47 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:47 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["8b2b8978-072c-4814-9f52-f288366e9b4e"]) + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:40:49 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=70dc5a46-bf7f-4870-b9ca-9b3d14302773 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:49 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=70dc5a46-bf7f-4870-b9ca-9b3d14302773 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:50 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:40:51 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=8b2b8978-072c-4814-9f52-f288366e9b4e + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:52 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=8b2b8978-072c-4814-9f52-f288366e9b4e + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:53 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:54 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=70dc5a46-bf7f-4870-b9ca-9b3d14302773 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:54 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": []}' + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=70dc5a46-bf7f-4870-b9ca-9b3d14302773 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:55 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": []}' + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:56 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=8b2b8978-072c-4814-9f52-f288366e9b4e + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:57 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2002", "workid": "9f13fb1d-9ee5-46ae-a7b0-8b8447d5b426", + "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": + "1/9/2002", "workid": "b9445fb6-9375-41c0-8108-1ab09d68e4fa", "epochTime": + "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", + "workid": "160af5b1-1167-46ff-a06b-fead63411448", "epochTime": "1011225600", + "value": {"avg": -2.1174285411834717}}]}' + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=8b2b8978-072c-4814-9f52-f288366e9b4e + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:58 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2002", "workid": "9f13fb1d-9ee5-46ae-a7b0-8b8447d5b426", + "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": + "1/9/2002", "workid": "b9445fb6-9375-41c0-8108-1ab09d68e4fa", "epochTime": + "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", + "workid": "160af5b1-1167-46ff-a06b-fead63411448", "epochTime": "1011225600", + "value": {"avg": -2.1174285411834717}}]}' + recorded_at: 2021-09-19 02:40:58 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/fixtures/ESI_geojson_method_return_geojson.yml b/tests/fixtures/ESI_geojson_method_return_geojson.yml new file mode 100644 index 0000000..191dc06 --- /dev/null +++ b/tests/fixtures/ESI_geojson_method_return_geojson.yml @@ -0,0 +1,537 @@ +http_interactions: +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:59 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:41:00 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["ba4b03a6-4cd8-4417-ba87-01c73bb80c6a"]) + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:41:01 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:41:02 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["eb385ec6-bce9-4855-bffe-30748f32c496"]) + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:41:03 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=ba4b03a6-4cd8-4417-ba87-01c73bb80c6a + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:41:04 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=ba4b03a6-4cd8-4417-ba87-01c73bb80c6a + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:41:04 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:41:05 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=eb385ec6-bce9-4855-bffe-30748f32c496 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:41:06 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=eb385ec6-bce9-4855-bffe-30748f32c496 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:41:07 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:41:08 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=ba4b03a6-4cd8-4417-ba87-01c73bb80c6a + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:41:08 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": []}' + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=ba4b03a6-4cd8-4417-ba87-01c73bb80c6a + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:41:09 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": []}' + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:41:10 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=eb385ec6-bce9-4855-bffe-30748f32c496 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:41:11 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2002", "workid": "c437a2bb-e64e-4b3a-9171-1b1f24240651", + "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": + "1/9/2002", "workid": "2be45146-3114-45e2-afa6-13c93f6a1192", "epochTime": + "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", + "workid": "6139c7d1-16b4-490a-919a-2a50915fb458", "epochTime": "1011225600", + "value": {"avg": -2.1174285411834717}}]}' + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=eb385ec6-bce9-4855-bffe-30748f32c496 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:41:12 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2002", "workid": "c437a2bb-e64e-4b3a-9171-1b1f24240651", + "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": + "1/9/2002", "workid": "2be45146-3114-45e2-afa6-13c93f6a1192", "epochTime": + "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", + "workid": "6139c7d1-16b4-490a-919a-2a50915fb458", "epochTime": "1011225600", + "value": {"avg": -2.1174285411834717}}]}' + recorded_at: 2021-09-19 02:41:12 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/fixtures/ESI_sf_method_return_df.yml b/tests/fixtures/ESI_sf_method_return_df.yml new file mode 100644 index 0000000..8b32621 --- /dev/null +++ b/tests/fixtures/ESI_sf_method_return_df.yml @@ -0,0 +1,537 @@ +http_interactions: +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:17 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:17 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["3ad0c088-7ba7-4330-84fb-0a990a86720e"]) + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:19 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:19 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["5f2cb51d-03ee-4ec8-a3b1-438e878f9c65"]) + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:40:20 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=3ad0c088-7ba7-4330-84fb-0a990a86720e + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:21 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=3ad0c088-7ba7-4330-84fb-0a990a86720e + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:22 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:40:23 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=5f2cb51d-03ee-4ec8-a3b1-438e878f9c65 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:24 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=5f2cb51d-03ee-4ec8-a3b1-438e878f9c65 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:24 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:25 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=3ad0c088-7ba7-4330-84fb-0a990a86720e + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:26 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": []}' + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=3ad0c088-7ba7-4330-84fb-0a990a86720e + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:27 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": []}' + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:28 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=5f2cb51d-03ee-4ec8-a3b1-438e878f9c65 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:29 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2002", "workid": "3dc72ca5-6b67-490f-afc4-4c9c5e2939d8", + "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": + "1/9/2002", "workid": "7c783c6c-db55-4c92-b686-c49d2592a719", "epochTime": + "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", + "workid": "00191d53-161e-459d-acba-2500b153dd11", "epochTime": "1011225600", + "value": {"avg": -2.1174285411834717}}]}' + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=5f2cb51d-03ee-4ec8-a3b1-438e878f9c65 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:30 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2002", "workid": "3dc72ca5-6b67-490f-afc4-4c9c5e2939d8", + "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": + "1/9/2002", "workid": "7c783c6c-db55-4c92-b686-c49d2592a719", "epochTime": + "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", + "workid": "00191d53-161e-459d-acba-2500b153dd11", "epochTime": "1011225600", + "value": {"avg": -2.1174285411834717}}]}' + recorded_at: 2021-09-19 02:40:30 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/fixtures/ESI_sf_method_return_sf.yml b/tests/fixtures/ESI_sf_method_return_sf.yml new file mode 100644 index 0000000..e0b0c0c --- /dev/null +++ b/tests/fixtures/ESI_sf_method_return_sf.yml @@ -0,0 +1,537 @@ +http_interactions: +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:30 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:31 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["ec2cfa8b-19f3-41d2-afe4-2aa26b6b063a"]) + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:32 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:33 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["b37aab58-7c39-45bf-9cc4-7f8eb58cbb3d"]) + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:40:34 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=ec2cfa8b-19f3-41d2-afe4-2aa26b6b063a + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:35 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=ec2cfa8b-19f3-41d2-afe4-2aa26b6b063a + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:36 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:40:37 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=b37aab58-7c39-45bf-9cc4-7f8eb58cbb3d + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:38 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=b37aab58-7c39-45bf-9cc4-7f8eb58cbb3d + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:38 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:40 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=ec2cfa8b-19f3-41d2-afe4-2aa26b6b063a + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:40 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": []}' + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=ec2cfa8b-19f3-41d2-afe4-2aa26b6b063a + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:41 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": []}' + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:42 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=b37aab58-7c39-45bf-9cc4-7f8eb58cbb3d + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:43 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2002", "workid": "6933b49c-23ec-4fb7-b18b-9f1c3f0caba1", + "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": + "1/9/2002", "workid": "3b3ae7ef-69a7-4272-aea7-98622caa4a63", "epochTime": + "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", + "workid": "f38ebdec-a12e-47da-bb14-ccdf9ee38abc", "epochTime": "1011225600", + "value": {"avg": -2.1174285411834717}}]}' + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=b37aab58-7c39-45bf-9cc4-7f8eb58cbb3d + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:40:44 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2002", "workid": "6933b49c-23ec-4fb7-b18b-9f1c3f0caba1", + "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": + "1/9/2002", "workid": "3b3ae7ef-69a7-4272-aea7-98622caa4a63", "epochTime": + "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", + "workid": "f38ebdec-a12e-47da-bb14-ccdf9ee38abc", "epochTime": "1011225600", + "value": {"avg": -2.1174285411834717}}]}' + recorded_at: 2021-09-19 02:40:44 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/testthat/test-get_esi.R b/tests/testthat/test-get_esi.R index 02bb527..6849ad1 100644 --- a/tests/testthat/test-get_esi.R +++ b/tests/testthat/test-get_esi.R @@ -1,4 +1,5 @@ + # test_data.rda contains lat/lon and date values for the following test load("../test_data.rda") @@ -9,5 +10,58 @@ test_that("get_esi returns proper values", { }) expect_named(x, c("id", "lon", "lat", "date", "esi")) expect_equal(nrow(x), 4) - expect_s3_class(x, c("chirps", "chirps_df", "data.frame")) + expect_s3_class(x, c("chirps_df", "data.frame")) +}) + +# Test sf data frame method ----- +coords <- st_as_sf(lonlat, coords = c("lon", "lat")) +test_that("get_esi() sf method return df", { + vcr::use_cassette("ESI_sf_method_return_df", { + y <- get_esi(coords, dates = c("2002-01-01", "2002-01-31")) + }) + expect_named(y, c("id", "lon", "lat", "date", "esi")) + expect_equal(nrow(y), 3) + expect_s3_class(y, c("chirps_df", "data.frame")) +}) + +# Test sf `sf` method ----- +coords <- st_as_sf(lonlat, coords = c("lon", "lat")) +test_that("get_esi() sf method return sf", { + vcr::use_cassette("ESI_sf_method_return_sf", { + y <- get_esi(coords, + dates = c("2002-01-01", "2002-01-31"), + as.sf = TRUE) + }) + expect_named(y, c("day_11688", "day_11696", "day_11704", "geometry")) + expect_equal(nrow(y), 2) + expect_s3_class(y, c("sf", "data.frame")) +}) + +# Test geojson data frame method ----- +geojson <- as.geojson(lonlat) +test_that("get_esi() geojson method return df", { + vcr::use_cassette("ESI_geojson_method_return_df", { + z <- + suppressWarnings(get_esi(geojson, + dates = c("2002-01-01", "2002-01-31"))) + }) + expect_named(z, c("id", "lon", "lat", "date", "esi")) + expect_equal(nrow(z), 3) + expect_s3_class(z, c("chirps_df", "data.frame")) +}) + +# Test geojson `geojson` method ----- +geojson <- as.geojson(lonlat) +test_that("get_esi() geojson method return geojson", { + vcr::use_cassette("ESI_geojson_method_return_geojson", { + z <- + suppressWarnings(get_esi( + geojson, + dates = c("2002-01-01", "2002-01-31"), + as.geojson = TRUE + )) + }) + expect_named(z, c("1", "2")) + expect_equal(length(z), 2) + expect_s3_class(z, c("geojson", "json", "character")) }) From d5c564c59e7b18bbbe09d2e084df701635dcb5db Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 10:49:28 +0800 Subject: [PATCH 20/93] Rename cassettes to follow a standard scheme --- .../fixtures/{get_esi.yml => ESI_default.yml} | 96 +++++++++---------- tests/testthat/test-get_esi.R | 3 +- 2 files changed, 49 insertions(+), 50 deletions(-) rename tests/fixtures/{get_esi.yml => ESI_default.yml} (87%) diff --git a/tests/fixtures/get_esi.yml b/tests/fixtures/ESI_default.yml similarity index 87% rename from tests/fixtures/get_esi.yml rename to tests/fixtures/ESI_default.yml index d85059d..98b11c4 100644 --- a/tests/fixtures/get_esi.yml +++ b/tests/fixtures/ESI_default.yml @@ -16,7 +16,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:16 GMT + date: Sun, 19 Sep 2021 02:48:49 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -31,7 +31,7 @@ http_interactions: file: no string: '["Datatype not supported", "Error with begintime", "Error with endtime", "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get @@ -50,7 +50,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:17 GMT + date: Sun, 19 Sep 2021 02:48:50 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -62,8 +62,8 @@ http_interactions: body: encoding: UTF-8 file: no - string: successCallback(["5f663dfd-929d-4934-9741-6ddbff427581"]) - recorded_at: 2021-09-19 02:02:31 GMT + string: successCallback(["ed082837-8ee5-40f0-b7b9-e29ac516ee08"]) + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get @@ -82,7 +82,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:18 GMT + date: Sun, 19 Sep 2021 02:48:51 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -97,7 +97,7 @@ http_interactions: file: no string: '["Datatype not supported", "Error with begintime", "Error with endtime", "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get @@ -116,7 +116,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:19 GMT + date: Sun, 19 Sep 2021 02:48:52 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -128,8 +128,8 @@ http_interactions: body: encoding: UTF-8 file: no - string: successCallback(["5c9e8625-0117-4f80-b1df-9f452f4627ee"]) - recorded_at: 2021-09-19 02:02:31 GMT + string: successCallback(["f8d371c3-0b21-419e-8e59-cea916e9f2c3"]) + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get @@ -148,7 +148,7 @@ http_interactions: explanation: Server got itself in trouble headers: status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:02:20 GMT + date: Sun, 19 Sep 2021 02:48:52 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -161,11 +161,11 @@ http_interactions: encoding: UTF-8 file: no string:

Server Error (500)

- recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=5f663dfd-929d-4934-9741-6ddbff427581 + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=ed082837-8ee5-40f0-b7b9-e29ac516ee08 body: encoding: '' string: '' @@ -180,7 +180,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:21 GMT + date: Sun, 19 Sep 2021 02:48:53 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -194,11 +194,11 @@ http_interactions: encoding: UTF-8 file: no string: '[100.0]' - recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=5f663dfd-929d-4934-9741-6ddbff427581 + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=ed082837-8ee5-40f0-b7b9-e29ac516ee08 body: encoding: '' string: '' @@ -213,7 +213,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:22 GMT + date: Sun, 19 Sep 2021 02:48:54 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -227,7 +227,7 @@ http_interactions: encoding: UTF-8 file: no string: '[100.0]' - recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get @@ -246,7 +246,7 @@ http_interactions: explanation: Server got itself in trouble headers: status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:02:23 GMT + date: Sun, 19 Sep 2021 02:48:55 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -259,11 +259,11 @@ http_interactions: encoding: UTF-8 file: no string:

Server Error (500)

- recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=5c9e8625-0117-4f80-b1df-9f452f4627ee + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=f8d371c3-0b21-419e-8e59-cea916e9f2c3 body: encoding: '' string: '' @@ -278,7 +278,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:24 GMT + date: Sun, 19 Sep 2021 02:48:56 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -292,11 +292,11 @@ http_interactions: encoding: UTF-8 file: no string: '[100.0]' - recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=5c9e8625-0117-4f80-b1df-9f452f4627ee + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=f8d371c3-0b21-419e-8e59-cea916e9f2c3 body: encoding: '' string: '' @@ -311,7 +311,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:25 GMT + date: Sun, 19 Sep 2021 02:48:57 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -325,7 +325,7 @@ http_interactions: encoding: UTF-8 file: no string: '[100.0]' - recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get @@ -344,7 +344,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:26 GMT + date: Sun, 19 Sep 2021 02:48:58 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -358,11 +358,11 @@ http_interactions: encoding: UTF-8 file: no string: need to send id - recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=5f663dfd-929d-4934-9741-6ddbff427581 + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=ed082837-8ee5-40f0-b7b9-e29ac516ee08 body: encoding: '' string: '' @@ -377,7 +377,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:27 GMT + date: Sun, 19 Sep 2021 02:48:58 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -391,11 +391,11 @@ http_interactions: encoding: UTF-8 file: no string: '{"data": []}' - recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=5f663dfd-929d-4934-9741-6ddbff427581 + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=ed082837-8ee5-40f0-b7b9-e29ac516ee08 body: encoding: '' string: '' @@ -410,7 +410,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:28 GMT + date: Sun, 19 Sep 2021 02:48:59 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -424,7 +424,7 @@ http_interactions: encoding: UTF-8 file: no string: '{"data": []}' - recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get @@ -443,7 +443,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:29 GMT + date: Sun, 19 Sep 2021 02:49:00 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -457,11 +457,11 @@ http_interactions: encoding: UTF-8 file: no string: need to send id - recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=5c9e8625-0117-4f80-b1df-9f452f4627ee + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=f8d371c3-0b21-419e-8e59-cea916e9f2c3 body: encoding: '' string: '' @@ -476,7 +476,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:30 GMT + date: Sun, 19 Sep 2021 02:49:01 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -489,17 +489,17 @@ http_interactions: body: encoding: UTF-8 file: no - string: '{"data": [{"date": "1/1/2002", "workid": "6e2f1923-8f2d-475a-8929-52cc4308f0f2", + string: '{"data": [{"date": "1/1/2002", "workid": "0f179b78-fb88-4e60-8002-f3a702a76d4c", "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "1226a7c5-50d2-420d-a00f-35bc669d3bea", "epochTime": + "1/9/2002", "workid": "f737b659-f0ec-48b2-8d5c-7476d1d6d4a6", "epochTime": "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "eebc661f-4cdd-4cfd-a41b-58f6b8e6f018", "epochTime": "1011225600", + "workid": "f5142762-8434-4ef5-b12c-5079fae9c841", "epochTime": "1011225600", "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 - request: method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=5c9e8625-0117-4f80-b1df-9f452f4627ee + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=f8d371c3-0b21-419e-8e59-cea916e9f2c3 body: encoding: '' string: '' @@ -514,7 +514,7 @@ http_interactions: explanation: Request fulfilled, document follows headers: status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:02:31 GMT + date: Sun, 19 Sep 2021 02:49:02 GMT server: Apache/2.4.18 (Ubuntu) strict-transport-security: max-age=63072000; includeSubdomains x-frame-options: DENY @@ -527,11 +527,11 @@ http_interactions: body: encoding: UTF-8 file: no - string: '{"data": [{"date": "1/1/2002", "workid": "6e2f1923-8f2d-475a-8929-52cc4308f0f2", + string: '{"data": [{"date": "1/1/2002", "workid": "0f179b78-fb88-4e60-8002-f3a702a76d4c", "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "1226a7c5-50d2-420d-a00f-35bc669d3bea", "epochTime": + "1/9/2002", "workid": "f737b659-f0ec-48b2-8d5c-7476d1d6d4a6", "epochTime": "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "eebc661f-4cdd-4cfd-a41b-58f6b8e6f018", "epochTime": "1011225600", + "workid": "f5142762-8434-4ef5-b12c-5079fae9c841", "epochTime": "1011225600", "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2021-09-19 02:02:31 GMT + recorded_at: 2021-09-19 02:49:02 GMT recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/testthat/test-get_esi.R b/tests/testthat/test-get_esi.R index 6849ad1..d259901 100644 --- a/tests/testthat/test-get_esi.R +++ b/tests/testthat/test-get_esi.R @@ -1,11 +1,10 @@ - # test_data.rda contains lat/lon and date values for the following test load("../test_data.rda") # Test get_esi() ----- test_that("get_esi returns proper values", { - vcr::use_cassette("get_esi", { + vcr::use_cassette("ESI_default", { x <- get_esi(lonlat, dates = c("2002-01-01", "2002-01-31")) }) expect_named(x, c("id", "lon", "lat", "date", "esi")) From d2cb2d90ce2f4656d0c01b2fe1cf14f27edf0350 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 10:59:03 +0800 Subject: [PATCH 21/93] remove redundant lines --- tests/testthat/test-get_esi.R | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/testthat/test-get_esi.R b/tests/testthat/test-get_esi.R index d259901..2b865f0 100644 --- a/tests/testthat/test-get_esi.R +++ b/tests/testthat/test-get_esi.R @@ -3,7 +3,7 @@ load("../test_data.rda") # Test get_esi() ----- -test_that("get_esi returns proper values", { +test_that("get_esi() returns proper values", { vcr::use_cassette("ESI_default", { x <- get_esi(lonlat, dates = c("2002-01-01", "2002-01-31")) }) @@ -24,7 +24,6 @@ test_that("get_esi() sf method return df", { }) # Test sf `sf` method ----- -coords <- st_as_sf(lonlat, coords = c("lon", "lat")) test_that("get_esi() sf method return sf", { vcr::use_cassette("ESI_sf_method_return_sf", { y <- get_esi(coords, @@ -50,7 +49,6 @@ test_that("get_esi() geojson method return df", { }) # Test geojson `geojson` method ----- -geojson <- as.geojson(lonlat) test_that("get_esi() geojson method return geojson", { vcr::use_cassette("ESI_geojson_method_return_geojson", { z <- From b464e1dc829b900ea4dfd66acb78939ad4f13037 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 11:00:52 +0800 Subject: [PATCH 22/93] begin to rewrite tests for get_chirps() --- tests/fixtures/CHIRPS_default.yml | 428 ++++++++++++++++++++++++++++++ tests/testthat/test-get_chirps.R | 35 +-- 2 files changed, 433 insertions(+), 30 deletions(-) create mode 100644 tests/fixtures/CHIRPS_default.yml diff --git a/tests/fixtures/CHIRPS_default.yml b/tests/fixtures/CHIRPS_default.yml new file mode 100644 index 0000000..f1a4c42 --- /dev/null +++ b/tests/fixtures/CHIRPS_default.yml @@ -0,0 +1,428 @@ +http_interactions: +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:49:58 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:49:59 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["473fea4f-9433-4cd6-8115-9fea398d45e5"]) + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:00 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:01 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["280628e3-5e2d-426b-b615-aa04ef829b65"]) + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:50:02 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:03 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:04 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:50:05 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=280628e3-5e2d-426b-b615-aa04ef829b65 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:05 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=280628e3-5e2d-426b-b615-aa04ef829b65 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:06 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:07 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:08 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:09 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index c21dc87..cf802b4 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -1,37 +1,12 @@ -# Test if get_chirps() returns a properly formatted object. -# for this we downloaded two points from https://climateserv.servirglobal.net/ - -# test_data.rda contains lat/lon and date values for the following tests +# test_data.rda contains lat/lon and date values for the following test load("../test_data.rda") -# Test default method ----- -test_that("default_method returns proper values", { - vcr::use_cassette("default_method", { +# Test get_chirps() ----- +test_that("get_chirps() returns proper values", { + vcr::use_cassette("CHIRPS_default", { x <- get_chirps(lonlat, dates) }) expect_named(x, c("id", "lon", "lat", "date", "chirps")) expect_equal(nrow(x), 10) - expect_s3_class(x, c("chirps", "chirps_df", "data.frame")) -}) - -# Test `sf` method ----- -coords <- st_as_sf(lonlat, coords = c("lon", "lat")) -test_that("sf_method", { - vcr::use_cassette("sf_method", { - y <- get_chirps(coords, dates) - }) - expect_named(y, c("id", "lon", "lat", "date", "chirps")) - expect_equal(nrow(y), 10) - expect_s3_class(y, c("chirps", "chirps_df", "data.frame")) -}) - -# Test geojson method ----- -geojson <- as.geojson(lonlat) -test_that("geojson_method", { - vcr::use_cassette("geojson_method", { - z <- suppressWarnings(get_chirps(geojson, dates)) - }) - expect_named(z, c("id", "lon", "lat", "date", "chirps")) - expect_equal(nrow(z), 10) - expect_s3_class(z, c("chirps", "chirps_df", "data.frame")) + expect_s3_class(x, c("chirps_df", "data.frame")) }) From 8ba2fe6558c6302898da170bcdd1abd81bca12e9 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 11:04:29 +0800 Subject: [PATCH 23/93] The "sf" test on line 14 cassette is not created --- tests/testthat/test-get_chirps.R | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index cf802b4..584beff 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -10,3 +10,14 @@ test_that("get_chirps() returns proper values", { expect_equal(nrow(x), 10) expect_s3_class(x, c("chirps_df", "data.frame")) }) + +# Test sf data frame method ----- +coords <- st_as_sf(lonlat, coords = c("lon", "lat")) +test_that("get_chirps() sf method return df", { + vcr::use_cassette("CHIRPS_sf_method_return_df", { + x <- get_chirps(coords, dates) + }) + expect_named(x, c("id", "lon", "lat", "date", "chirps")) + expect_equal(nrow(x), 10) + expect_s3_class(x, c("chirps_df", "data.frame")) +}) From b6d5f08cce828eb791705d5e26550f8477fe0ffa Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 19 Sep 2021 13:37:02 +0800 Subject: [PATCH 24/93] More fiddling with vcr for tests --- tests/fixtures/CHIRPS_sf_method_return_df.yml | 428 ++++++++++++++++++ tests/testthat/test-get_chirps.R | 24 +- 2 files changed, 448 insertions(+), 4 deletions(-) create mode 100644 tests/fixtures/CHIRPS_sf_method_return_df.yml diff --git a/tests/fixtures/CHIRPS_sf_method_return_df.yml b/tests/fixtures/CHIRPS_sf_method_return_df.yml new file mode 100644 index 0000000..f1a4c42 --- /dev/null +++ b/tests/fixtures/CHIRPS_sf_method_return_df.yml @@ -0,0 +1,428 @@ +http_interactions: +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:49:58 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:49:59 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["473fea4f-9433-4cd6-8115-9fea398d45e5"]) + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:00 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:01 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["280628e3-5e2d-426b-b615-aa04ef829b65"]) + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:50:02 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:03 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:04 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Sun, 19 Sep 2021 02:50:05 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=280628e3-5e2d-426b-b615-aa04ef829b65 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:05 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=280628e3-5e2d-426b-b615-aa04ef829b65 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:06 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:07 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:08 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Sun, 19 Sep 2021 02:50:09 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-19 02:50:09 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index 584beff..18b7d46 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -1,4 +1,5 @@ -# test_data.rda contains lat/lon and date values for the following test + +# test_data.rda contains lat/lon and date values for the following tests load("../test_data.rda") # Test get_chirps() ----- @@ -8,10 +9,10 @@ test_that("get_chirps() returns proper values", { }) expect_named(x, c("id", "lon", "lat", "date", "chirps")) expect_equal(nrow(x), 10) - expect_s3_class(x, c("chirps_df", "data.frame")) + expect_s3_class(x, c("chirps", "chirps_df", "data.frame")) }) -# Test sf data frame method ----- +# Test sf return data frame method ----- coords <- st_as_sf(lonlat, coords = c("lon", "lat")) test_that("get_chirps() sf method return df", { vcr::use_cassette("CHIRPS_sf_method_return_df", { @@ -19,5 +20,20 @@ test_that("get_chirps() sf method return df", { }) expect_named(x, c("id", "lon", "lat", "date", "chirps")) expect_equal(nrow(x), 10) - expect_s3_class(x, c("chirps_df", "data.frame")) + expect_s3_class(x, c("chirps", "chirps_df", "data.frame")) +}) + +# Test sf return `sf` method ----- +test_that("get_chirps() sf method return sf", { + vcr::use_cassette("CHIRPS_sf_method_return_sf", { + x <- get_chirps(coords, dates, as.sf = TRUE) + }) + expect_named(x, c("day_10957", + "day_10958", + "day_10959", + "day_10960", + "day_10961", + "geometry")) + expect_equal(nrow(x), 2) + expect_s3_class(x, c("sf", "data.frame")) }) From 46c9f675c6433f9b2f5088ddd2e4507e6292d84f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 20 Sep 2021 09:57:16 +0200 Subject: [PATCH 25/93] change suggestion --- tests/testthat/test-get_chirps.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index 18b7d46..25639d5 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -26,7 +26,7 @@ test_that("get_chirps() sf method return df", { # Test sf return `sf` method ----- test_that("get_chirps() sf method return sf", { vcr::use_cassette("CHIRPS_sf_method_return_sf", { - x <- get_chirps(coords, dates, as.sf = TRUE) + x <- get_chirps(coords, dates, as.sf = TRUE, server = "ClimateSERV") }) expect_named(x, c("day_10957", "day_10958", From 7e975384ffa1ef3cff5b6ee72322a17a15aba366 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 20 Sep 2021 16:34:09 +0800 Subject: [PATCH 26/93] Adds fixture for CHIRPS_sf_method_return_sf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks Maëlle Salmon! --- tests/fixtures/CHIRPS_sf_method_return_sf.yml | 555 ++++++++++++++++++ 1 file changed, 555 insertions(+) create mode 100644 tests/fixtures/CHIRPS_sf_method_return_sf.yml diff --git a/tests/fixtures/CHIRPS_sf_method_return_sf.yml b/tests/fixtures/CHIRPS_sf_method_return_sf.yml new file mode 100644 index 0000000..5619db2 --- /dev/null +++ b/tests/fixtures/CHIRPS_sf_method_return_sf.yml @@ -0,0 +1,555 @@ +http_interactions: +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:11 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=0&begintime=01%2F01%2F2000&endtime=01%2F05%2F2000&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:12 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["bebb6c49-441a-4fda-821f-e2aca6eb0173"]) + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:13 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '["Datatype not supported", "Error with begintime", "Error with endtime", + "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=0&begintime=01%2F01%2F2000&endtime=01%2F05%2F2000&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:13 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '57' + connection: close + content-type: application/json + body: + encoding: UTF-8 + file: no + string: successCallback(["9960326e-bdf9-46c0-892f-9338bf8a9aca"]) + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Mon, 20 Sep 2021 08:19:14 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=bebb6c49-441a-4fda-821f-e2aca6eb0173 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:15 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=bebb6c49-441a-4fda-821f-e2aca6eb0173 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:15 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '500' + message: Internal Server Error + explanation: Server got itself in trouble + headers: + status: HTTP/1.1 500 Internal Server Error + date: Mon, 20 Sep 2021 08:19:16 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie + content-length: '27' + connection: close + content-type: text/html + body: + encoding: UTF-8 + file: no + string:

Server Error (500)

+ recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=9960326e-bdf9-46c0-892f-9338bf8a9aca + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:17 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=9960326e-bdf9-46c0-892f-9338bf8a9aca + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:18 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '[100.0]' + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:19 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=bebb6c49-441a-4fda-821f-e2aca6eb0173 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:19 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2000", "workid": "5df19ff6-b5b8-430e-8a66-a6ead5456062", + "epochTime": "946684800", "value": {"avg": 9.255108833312988}}, {"date": "1/2/2000", + "workid": "2bc72233-92a2-400a-b46f-4edfe4c74abf", "epochTime": "946771200", + "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "0a830f16-1a8c-44f6-8c9a-f8e69a64b7d3", + "epochTime": "946857600", "value": {"avg": 0.0}}, {"date": "1/4/2000", "workid": + "fddcf677-f408-49ab-9436-ab946b3ca498", "epochTime": "946944000", "value": + {"avg": 0.0}}, {"date": "1/5/2000", "workid": "2bc78c85-9d2e-4ae4-9610-2ff6d3dea923", + "epochTime": "947030400", "value": {"avg": 18.510217666625977}}]}' + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=bebb6c49-441a-4fda-821f-e2aca6eb0173 + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:20 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2000", "workid": "5df19ff6-b5b8-430e-8a66-a6ead5456062", + "epochTime": "946684800", "value": {"avg": 9.255108833312988}}, {"date": "1/2/2000", + "workid": "2bc72233-92a2-400a-b46f-4edfe4c74abf", "epochTime": "946771200", + "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "0a830f16-1a8c-44f6-8c9a-f8e69a64b7d3", + "epochTime": "946857600", "value": {"avg": 0.0}}, {"date": "1/4/2000", "workid": + "fddcf677-f408-49ab-9436-ab946b3ca498", "epochTime": "946944000", "value": + {"avg": 0.0}}, {"date": "1/5/2000", "workid": "2bc78c85-9d2e-4ae4-9610-2ff6d3dea923", + "epochTime": "947030400", "value": {"avg": 18.510217666625977}}]}' + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:21 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: need to send id + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=9960326e-bdf9-46c0-892f-9338bf8a9aca + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:22 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2000", "workid": "99ede304-6933-4bf9-92bb-ed502f1a768d", + "epochTime": "946684800", "value": {"avg": 38.354225158691406}}, {"date": + "1/2/2000", "workid": "d2615254-f34f-4205-96c1-868448ee9e23", "epochTime": + "946771200", "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "bd93cf54-6197-4435-917f-ed4fba5aff13", + "epochTime": "946857600", "value": {"avg": 38.354225158691406}}, {"date": + "1/4/2000", "workid": "1bed0525-25de-4b94-bd94-2507a54113c8", "epochTime": + "946944000", "value": {"avg": 0.0}}, {"date": "1/5/2000", "workid": "ef9a7c32-d5f2-4ed2-a664-9ca942618897", + "epochTime": "947030400", "value": {"avg": 0.0}}]}' + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 +- request: + method: get + uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=9960326e-bdf9-46c0-892f-9338bf8a9aca + body: + encoding: '' + string: '' + headers: + User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 + Accept-Encoding: gzip, deflate + Accept: application/json, text/xml, application/xml, */* + response: + status: + status_code: '200' + message: OK + explanation: Request fulfilled, document follows + headers: + status: HTTP/1.1 200 OK + date: Mon, 20 Sep 2021 08:19:22 GMT + server: Apache/2.4.18 (Ubuntu) + strict-transport-security: max-age=63072000; includeSubdomains + x-frame-options: DENY + x-content-type-options: nosniff + vary: Cookie,Accept-Encoding + content-encoding: gzip + connection: close + transfer-encoding: chunked + content-type: text/html; charset=utf-8 + body: + encoding: UTF-8 + file: no + string: '{"data": [{"date": "1/1/2000", "workid": "99ede304-6933-4bf9-92bb-ed502f1a768d", + "epochTime": "946684800", "value": {"avg": 38.354225158691406}}, {"date": + "1/2/2000", "workid": "d2615254-f34f-4205-96c1-868448ee9e23", "epochTime": + "946771200", "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "bd93cf54-6197-4435-917f-ed4fba5aff13", + "epochTime": "946857600", "value": {"avg": 38.354225158691406}}, {"date": + "1/4/2000", "workid": "1bed0525-25de-4b94-bd94-2507a54113c8", "epochTime": + "946944000", "value": {"avg": 0.0}}, {"date": "1/5/2000", "workid": "ef9a7c32-d5f2-4ed2-a664-9ca942618897", + "epochTime": "947030400", "value": {"avg": 0.0}}]}' + recorded_at: 2021-09-20 08:19:22 GMT + recorded_with: vcr/1.0.2, webmockr/0.8.0 From 54549ebac7d06a0c660ecedb049e523fe64f9b57 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 20 Sep 2021 16:34:56 +0800 Subject: [PATCH 27/93] use testthat::test_path() for loading helper data Closes https://github.com/ropensci/chirps/issues/33 --- tests/testthat/test-get_chirps.R | 28 ++++++++++++++++++---------- tests/testthat/test-get_esi.R | 4 ++-- tests/{ => testthat}/test_data.rda | Bin 3 files changed, 20 insertions(+), 12 deletions(-) rename tests/{ => testthat}/test_data.rda (100%) diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index 25639d5..c4ca4c5 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -1,11 +1,12 @@ # test_data.rda contains lat/lon and date values for the following tests -load("../test_data.rda") +load(testthat::test_path("test_data.rda")) # Test get_chirps() ----- test_that("get_chirps() returns proper values", { vcr::use_cassette("CHIRPS_default", { - x <- get_chirps(lonlat, dates) + x <- get_chirps(object = lonlat, + dates = dates) }) expect_named(x, c("id", "lon", "lat", "date", "chirps")) expect_equal(nrow(x), 10) @@ -16,7 +17,8 @@ test_that("get_chirps() returns proper values", { coords <- st_as_sf(lonlat, coords = c("lon", "lat")) test_that("get_chirps() sf method return df", { vcr::use_cassette("CHIRPS_sf_method_return_df", { - x <- get_chirps(coords, dates) + x <- get_chirps(object = coords, + dates = dates) }) expect_named(x, c("id", "lon", "lat", "date", "chirps")) expect_equal(nrow(x), 10) @@ -26,14 +28,20 @@ test_that("get_chirps() sf method return df", { # Test sf return `sf` method ----- test_that("get_chirps() sf method return sf", { vcr::use_cassette("CHIRPS_sf_method_return_sf", { - x <- get_chirps(coords, dates, as.sf = TRUE, server = "ClimateSERV") + x <- get_chirps(object = coords, + dates = dates, + as.sf = TRUE, + server = "ClimateSERV") }) - expect_named(x, c("day_10957", - "day_10958", - "day_10959", - "day_10960", - "day_10961", - "geometry")) + expect_named(x, + c( + "day_10957", + "day_10958", + "day_10959", + "day_10960", + "day_10961", + "geometry" + )) expect_equal(nrow(x), 2) expect_s3_class(x, c("sf", "data.frame")) }) diff --git a/tests/testthat/test-get_esi.R b/tests/testthat/test-get_esi.R index 2b865f0..3abce13 100644 --- a/tests/testthat/test-get_esi.R +++ b/tests/testthat/test-get_esi.R @@ -1,6 +1,6 @@ -# test_data.rda contains lat/lon and date values for the following test -load("../test_data.rda") +# test_data.rda contains lat/lon and date values for the following tests +load(testthat::test_path("test_data.rda")) # Test get_esi() ----- test_that("get_esi() returns proper values", { diff --git a/tests/test_data.rda b/tests/testthat/test_data.rda similarity index 100% rename from tests/test_data.rda rename to tests/testthat/test_data.rda From 86674b402db3f42696d952cbb922e8aa3f1eb6e6 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 20 Sep 2021 18:40:58 +0800 Subject: [PATCH 28/93] Fix long lines --- R/get_chirts.R | 2 +- R/get_imerg.R | 5 ++++- R/print.R | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/R/get_chirts.R b/R/get_chirts.R index 7b9e8e3..d1961a9 100644 --- a/R/get_chirts.R +++ b/R/get_chirts.R @@ -7,7 +7,7 @@ #' currently available from 1983 to 2016. Soon available to near-present. #' #' @inheritParams get_chirps -#' @param object an object of class \code{\link[base]{data.frame}} (or any other +#' @param object an object of class \code{\link[base]{data.frame}} (or any other #' object that can be coerced to a \code{data.frame}), #' \code{\link[terra]{SpatVector}}, or \code{\link[terra]{SpatRaster}} #' @param var character, A valid variable from the options: \dQuote{Tmax}, diff --git a/R/get_imerg.R b/R/get_imerg.R index cd9b4b8..5705200 100644 --- a/R/get_imerg.R +++ b/R/get_imerg.R @@ -204,7 +204,10 @@ get_imerg.sf <- function(object, dates, operation = 5, as.sf = FALSE, ...) { #' @rdname get_imerg #' @method get_imerg geojson #' @export -get_imerg.geojson <- function(object, dates, operation = 5, as.geojson = FALSE, ...) { +get_imerg.geojson <- function(object, + dates, + operation = 5, + as.geojson = FALSE, ...) { # check for the geometry tag if (isFALSE(grepl("geometry", object[[1]]))) { diff --git a/R/print.R b/R/print.R index facd7a5..f72c907 100644 --- a/R/print.R +++ b/R/print.R @@ -9,7 +9,7 @@ print.chirps_df <- function(x, ...){ }) classes <- as.vector(unlist(classes)) - class_abb = c(list = "", integer = "", numeric = "", + class_abb <- c(list = "", integer = "", numeric = "", character = "", Date = "", complex = "", factor = "", POSIXct = "", logical = "", IDate = "", integer64 = "", raw = "", From 22e1fb7c86d62c0545ea002d067f02ff61a4917f Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 20 Sep 2021 18:41:35 +0800 Subject: [PATCH 29/93] Clean up test code --- tests/testthat/test-get_chirps.R | 4 ++-- tests/testthat/test-get_esi.R | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index c4ca4c5..5edbae2 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -1,8 +1,8 @@ # test_data.rda contains lat/lon and date values for the following tests -load(testthat::test_path("test_data.rda")) +load(test_path("test_data.rda")) -# Test get_chirps() ----- +# Test get_chirps() default method ----- test_that("get_chirps() returns proper values", { vcr::use_cassette("CHIRPS_default", { x <- get_chirps(object = lonlat, diff --git a/tests/testthat/test-get_esi.R b/tests/testthat/test-get_esi.R index 3abce13..aab9d4c 100644 --- a/tests/testthat/test-get_esi.R +++ b/tests/testthat/test-get_esi.R @@ -1,6 +1,6 @@ # test_data.rda contains lat/lon and date values for the following tests -load(testthat::test_path("test_data.rda")) +load(test_path("test_data.rda")) # Test get_esi() ----- test_that("get_esi() returns proper values", { From 1c22d7bebd5f5de0f62b376bde66d0e58673d33d Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 20 Sep 2021 18:42:04 +0800 Subject: [PATCH 30/93] Load rda file using testthat::test_data --- tests/testthat/test-precip_indices.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-precip_indices.R b/tests/testthat/test-precip_indices.R index db16166..c425ec1 100644 --- a/tests/testthat/test-precip_indices.R +++ b/tests/testthat/test-precip_indices.R @@ -1,5 +1,6 @@ -# load("tests/test_data.rda") -load("../test_data.rda") + +# test_data.rda contains lat/lon and date values for the following tests +load(test_path("test_data.rda")) # Test the default behaviour values <- c(3, 1, 1, 0, From fb4ee270337b0996df5771c22cea6b26453007a2 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 20 Sep 2021 18:42:20 +0800 Subject: [PATCH 31/93] Add tests for date validation --- tests/testthat/test-internal_functions.R | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/testthat/test-internal_functions.R diff --git a/tests/testthat/test-internal_functions.R b/tests/testthat/test-internal_functions.R new file mode 100644 index 0000000..38a3521 --- /dev/null +++ b/tests/testthat/test-internal_functions.R @@ -0,0 +1,12 @@ + +# Test .validate_dates() ----- +test_that(".validate_dates() checks for backwards dates properly", { + x <- c("2015-01-15", "2015-01-14") + expect_error(.validate_dates(x, availability = c("1981-01-01", "0")), + regexp = "Please check your dates.*") +}) + +test_that(".validate_dates() allows for one day to be fetched", { + x <- c("2015-01-15", "2015-01-15") + expect_error(.validate_dates(x, availability = c("1981-01-01", "0")), NA) +}) From 25e32deeff85f99d016d3882028ab5cfe7a2adb8 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 20 Sep 2021 18:42:42 +0800 Subject: [PATCH 32/93] Format documentation long lines and tags --- R/as.geojson.R | 5 +++-- R/get_chirps.R | 18 ++++++++++-------- R/get_imerg.R | 12 ++++++------ man/as.geojson.Rd | 5 +++-- man/get_chirps.Rd | 18 ++++++++++-------- man/get_chirts.Rd | 5 +++-- man/get_esi.Rd | 5 +++-- man/get_imerg.Rd | 17 +++++++++-------- 8 files changed, 47 insertions(+), 38 deletions(-) diff --git a/R/as.geojson.R b/R/as.geojson.R index cba80ca..1b0fad4 100644 --- a/R/as.geojson.R +++ b/R/as.geojson.R @@ -3,8 +3,9 @@ #' Take single points from geographical coordinates and coerce into a #' geojson of geometry 'Polygon' #' -#' @param lonlat a data.frame or matrix with geographical coordinates lonlat, in -#' that order, or an object of class 'sf' with geometry type 'POINT' or 'POLYGON' +#' @param lonlat a data.frame or matrix with geographical coordinates lonlat, in +#' that order, or an object of class 'sf' with geometry type 'POINT' or +#' 'POLYGON' #' @param dist numeric, buffer distance for all \code{lonlat} #' @param nQuadSegs integer, number of segments per quadrant #' @param ... further arguments passed to \code{\link[sf]{sf}} methods diff --git a/R/get_chirps.R b/R/get_chirps.R index 4fb1838..87239d6 100644 --- a/R/get_chirps.R +++ b/R/get_chirps.R @@ -3,15 +3,17 @@ #' Get daily precipitation data from the "Climate Hazards Group". #' #' @param object input, an object of class \code{\link[base]{data.frame}} (or -#' any other object that can be coerced to data.frame), \code{\link[terra]{SpatVector}}, -#' \code{\link[terra]{SpatRaster}}, \code{\link[sf]{sf}} or \code{geojson} +#' any other object that can be coerced to \code{data.frame}), +#' \code{\link[terra]{SpatVector}}, \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 #' "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} -#' @param as.raster logical, returns an object of class \code{\link[terra]{SpatRaster}} +#' @param as.raster logical, returns an object of class +#' \code{\link[terra]{SpatRaster}} #' @param as.matrix logical, returns an object of class \code{matrix} #' @param ... further arguments passed to \code{\link[terra]{terra}} #' or \code{\link[sf]{sf}} methods @@ -23,8 +25,8 @@ #' #' \strong{Additional arguments when using server = "CHC"} #' -#' \bold{resolution}: numeric, resolution of CHIRPS tiles either -#' 0.05 (default) or 0.25 degrees +#' \bold{resolution}: numeric, resolution of CHIRPS tiles either 0.05 (default) +#' or 0.25 degrees #' #' \strong{Additional arguments when using server = "ClimateSERV"} #' @@ -55,9 +57,9 @@ #' Funk C. et al. (2015). Scientific Data, 2, 150066. #' \cr\doi{10.1038/sdata.2015.66} #' -#' @note get_chirps may return some warning messages given by -#' \code{\link[sf]{sf}}, please look sf documentation for -#' possible issues. +#' @note \code{get_chirps()} may return some warning messages given by +#' \code{\link[sf]{sf}}, please look \CRANpkg{sf} documentation for possible +#' issues. #' #' @examplesIf interactive() #' library("chirps") diff --git a/R/get_imerg.R b/R/get_imerg.R index 5705200..0214a8d 100644 --- a/R/get_imerg.R +++ b/R/get_imerg.R @@ -1,11 +1,11 @@ #' Get Integrated Multisatellite Retrievals for GPM (IMERG) data #' -#' The IMERG dataset provides near-real time global observations of -#' rainfall at 10km resolution, which can be used to estimate total -#' rainfall accumulation from storm systems and quantify the intensity -#' of rainfall and flood impacts from tropical cyclones and other storm -#' systems. IMERG is a daily precipitation dataset available from 2015 -#' to present within the latitudes 70 and -70. +#' The IMERG dataset provides near-real time global observations of rainfall at +#' 10km resolution, which can be used to estimate total rainfall accumulation +#' from storm systems and quantify the intensity of rainfall and flood impacts +#' from tropical cyclones and other storm systems. \acronym{IMERG} is a daily +#' precipitation dataset available from 2015 to present within the latitudes 70 +#' and -70 degrees. #' #' @inheritParams get_chirps #' @param operation optional, an integer that represents which type of diff --git a/man/as.geojson.Rd b/man/as.geojson.Rd index 8b26033..6409ac2 100644 --- a/man/as.geojson.Rd +++ b/man/as.geojson.Rd @@ -13,8 +13,9 @@ as.geojson(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) \method{as.geojson}{sf}(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) } \arguments{ -\item{lonlat}{a data.frame or matrix with geographical coordinates lonlat, in -that order, or an object of class 'sf' with geometry type 'POINT' or 'POLYGON'} +\item{lonlat}{a data.frame or matrix with geographical coordinates lonlat, in +that order, or an object of class 'sf' with geometry type 'POINT' or +'POLYGON'} \item{dist}{numeric, buffer distance for all \code{lonlat}} diff --git a/man/get_chirps.Rd b/man/get_chirps.Rd index f86c2ab..148e6b7 100644 --- a/man/get_chirps.Rd +++ b/man/get_chirps.Rd @@ -30,8 +30,9 @@ get_chirps(object, dates, server = "CHC", ...) } \arguments{ \item{object}{input, an object of class \code{\link[base]{data.frame}} (or -any other object that can be coerced to data.frame), \code{\link[terra]{SpatVector}}, -\code{\link[terra]{SpatRaster}}, \code{\link[sf]{sf}} or \code{geojson}} +any other object that can be coerced to \code{data.frame}), +\code{\link[terra]{SpatVector}}, \code{\link[terra]{SpatRaster}}, +\code{\link[sf]{sf}} or \code{geojson}} \item{dates}{a character of start and end dates in that order in the format "YYYY-MM-DD"} @@ -45,7 +46,8 @@ See details} \item{as.matrix}{logical, returns an object of class \code{matrix}} -\item{as.raster}{logical, returns an object of class \code{\link[terra]{SpatRaster}}} +\item{as.raster}{logical, returns an object of class +\code{\link[terra]{SpatRaster}}} \item{as.sf}{logical, returns an object of class \code{\link[sf]{sf}}} @@ -70,8 +72,8 @@ Data description at \strong{Additional arguments when using server = "CHC"} -\bold{resolution}: numeric, resolution of CHIRPS tiles either - 0.05 (default) or 0.25 degrees +\bold{resolution}: numeric, resolution of CHIRPS tiles either 0.05 (default) + or 0.25 degrees \strong{Additional arguments when using server = "ClimateSERV"} @@ -90,9 +92,9 @@ Data description at } } \note{ -get_chirps may return some warning messages given by -\code{\link[sf]{sf}}, please look sf documentation for -possible issues. +\code{get_chirps()} may return some warning messages given by +\code{\link[sf]{sf}}, please look \CRANpkg{sf} documentation for possible +issues. } \examples{ \dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} diff --git a/man/get_chirts.Rd b/man/get_chirts.Rd index 7c8917b..20a0c84 100644 --- a/man/get_chirts.Rd +++ b/man/get_chirts.Rd @@ -16,7 +16,7 @@ get_chirts(object, dates, var, ...) \method{get_chirts}{SpatRaster}(object, dates, var, as.raster = TRUE, ...) } \arguments{ -\item{object}{an object of class \code{\link[base]{data.frame}} (or any other +\item{object}{an object of class \code{\link[base]{data.frame}} (or any other object that can be coerced to a \code{data.frame}), \code{\link[terra]{SpatVector}}, or \code{\link[terra]{SpatRaster}}} @@ -30,7 +30,8 @@ object that can be coerced to a \code{data.frame}), \item{as.matrix}{logical, returns an object of class \code{matrix}} -\item{as.raster}{logical, returns an object of class \code{\link[terra]{SpatRaster}}} +\item{as.raster}{logical, returns an object of class +\code{\link[terra]{SpatRaster}}} } \value{ A SpatRaster object if \code{as.raster=TRUE}, else \code{matrix}, diff --git a/man/get_esi.Rd b/man/get_esi.Rd index f9c15cc..c0442aa 100644 --- a/man/get_esi.Rd +++ b/man/get_esi.Rd @@ -17,8 +17,9 @@ get_esi(object, dates, operation = 5, period = 1, ...) } \arguments{ \item{object}{input, an object of class \code{\link[base]{data.frame}} (or -any other object that can be coerced to data.frame), \code{\link[terra]{SpatVector}}, -\code{\link[terra]{SpatRaster}}, \code{\link[sf]{sf}} or \code{geojson}} +any other object that can be coerced to \code{data.frame}), +\code{\link[terra]{SpatVector}}, \code{\link[terra]{SpatRaster}}, +\code{\link[sf]{sf}} or \code{geojson}} \item{dates}{a character of start and end dates in that order in the format "YYYY-MM-DD"} diff --git a/man/get_imerg.Rd b/man/get_imerg.Rd index 00619a6..2990978 100644 --- a/man/get_imerg.Rd +++ b/man/get_imerg.Rd @@ -17,8 +17,9 @@ get_imerg(object, dates, operation = 5, ...) } \arguments{ \item{object}{input, an object of class \code{\link[base]{data.frame}} (or -any other object that can be coerced to data.frame), \code{\link[terra]{SpatVector}}, -\code{\link[terra]{SpatRaster}}, \code{\link[sf]{sf}} or \code{geojson}} +any other object that can be coerced to \code{data.frame}), +\code{\link[terra]{SpatVector}}, \code{\link[terra]{SpatRaster}}, +\code{\link[sf]{sf}} or \code{geojson}} \item{dates}{a character of start and end dates in that order in the format "YYYY-MM-DD"} @@ -43,12 +44,12 @@ A data frame of \acronym{imerg} data: \item{imerg}{the IMERG value} } \description{ -The IMERG dataset provides near-real time global observations of - rainfall at 10km resolution, which can be used to estimate total - rainfall accumulation from storm systems and quantify the intensity - of rainfall and flood impacts from tropical cyclones and other storm - systems. IMERG is a daily precipitation dataset available from 2015 - to present within the latitudes 70 and -70. +The IMERG dataset provides near-real time global observations of rainfall at + 10km resolution, which can be used to estimate total rainfall accumulation + from storm systems and quantify the intensity of rainfall and flood impacts + from tropical cyclones and other storm systems. \acronym{IMERG} is a daily + precipitation dataset available from 2015 to present within the latitudes 70 + and -70 degrees. } \details{ \bold{operation}: supported operations are: From 5874ef19ca42059d7da9c4a4632e0f98192b0e4a Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Thu, 23 Sep 2021 10:21:54 +0800 Subject: [PATCH 33/93] Adds `%notin%` and provides informative message on error When a user requests data for CHIRTS that are outside the available years, the function now returns an informative message. --- R/get_chirts.R | 245 ++++++++++++++++++++++------------------- R/internal_functions.R | 15 +++ 2 files changed, 147 insertions(+), 113 deletions(-) diff --git a/R/get_chirts.R b/R/get_chirts.R index d1961a9..3fa3e7e 100644 --- a/R/get_chirts.R +++ b/R/get_chirts.R @@ -1,23 +1,23 @@ #' Get CHIRTS temperature data data -#' +#' #' Get daily maximum and minimum temperature data from the "Climate Hazards #' Group". CHIRTS-daily is a global 2-m temperature product that combines the #' monthly CHIRTSmax data set with the ERA5 reanalysis to produce routinely #' updated data to support the monitoring of temperature extreme. Data is #' currently available from 1983 to 2016. Soon available to near-present. #' -#' @inheritParams get_chirps +#' @inheritParams get_chirps #' @param object an object of class \code{\link[base]{data.frame}} (or any other #' object that can be coerced to a \code{data.frame}), -#' \code{\link[terra]{SpatVector}}, or \code{\link[terra]{SpatRaster}} +#' \code{\link[terra]{SpatVector}}, or \code{\link[terra]{SpatRaster}} #' @param var character, A valid variable from the options: \dQuote{Tmax}, #' \dQuote{Tmin}, \dQuote{RHum} and \dQuote{HeatIndex} #' @param ... further arguments passed to \code{\link[terra]{terra}} -#' @return A SpatRaster object if \code{as.raster=TRUE}, else \code{matrix}, +#' @return A SpatRaster object if \code{as.raster=TRUE}, else \code{matrix}, #' \code{list}, or \code{data.frame} #' @details -#' -#' Variable description from +#' +#' Variable description from #' \url{https://data.chc.ucsb.edu/products/CHIRTSdaily/aaa.Readme.txt} #' \describe{ #' \item{Tmax}{Daily average maximum air temperature at 2 m above ground} @@ -25,160 +25,170 @@ #' \item{RHum}{Daily average relative humidity} #' \item{HeatIndex}{Daily average heat index} #' } -#' @section Additional arguments: +#' @section Additional arguments: #' \bold{interval}: supported intervals are \dQuote{daily}, \dQuote{pentad}, #' \dQuote{dekad}, \dQuote{monthly}, \dQuote{2-monthly}, \dQuote{3-monthly}, #' and \dQuote{annual}. Currently hard coded to \dQuote{daily}. -#' +#' #' @examplesIf interactive() #' library("chirps") #' library("terra") -#' +#' #' # Case 1: input a data frame return a data frame in the long format #' dates <- c("2010-12-15","2010-12-31") #' lonlat <- data.frame(lon = c(-55.0281,-54.9857), #' lat = c(-2.8094, -2.8756)) -#' +#' #' temp1 <- get_chirts(lonlat, dates, var = "Tmax") -#' +#' #' # Case 2: input a data frame return a matrix #' temp2 <- get_chirts(lonlat, dates, "Tmax", as.matrix = TRUE) -#' +#' #' # Case 3: input a raster and return raster #' f <- system.file("ex/lux.shp", package="terra") #' v <- vect(f) #' temp3 <- get_chirts(v, dates, var = "Tmax", as.raster = TRUE) -#' +#' #' # Case 4: input a raster and return raster #' temp4 <- get_chirts(v, dates, var = "Tmax", as.matrix = TRUE) #' #' @importFrom terra crop extract rast #' @export get_chirts <- function(object, dates, var, ...) { - UseMethod("get_chirts") } #' @rdname get_chirts #' @export -get_chirts.default <- function(object, dates, var, as.matrix = FALSE, ...){ - - dots <- list(...) - as.raster <- dots[["as.raster"]] - if (!isTRUE(as.raster)) as.raster <- FALSE - - object <- as.data.frame(object) - - .validate_lonlat(object, xlim = c(-180, 180), ylim = c(-60, 70)) - - # get CHIRTS GeoTiff files - rr <- .get_CHIRTS_tiles_CHC(dates, var, ...) - - if (isTRUE(as.raster)) { - result <- terra::crop(rr, y = object) - return(result) - }else{ - as.raster <- FALSE - } - - if (isTRUE(as.matrix)) { - result <- terra::extract(rr, y = object, ...) - result$ID <- NULL - return(result) - }else{ - as.matrix <- FALSE - } - - if (all(isFALSE(as.matrix), isFALSE(as.raster))) { - result <- terra::extract(rr, y = object, ...) - result$ID <- NULL - result <- c(t(result)) - days <- seq.Date(as.Date(dates[1]), as.Date(dates[2]), by = "day") - span <- length(days) +get_chirts.default <- + function(object, dates, var, as.matrix = FALSE, ...) { + dots <- list(...) + as.raster <- dots[["as.raster"]] + if (!isTRUE(as.raster)) + as.raster <- FALSE + + object <- as.data.frame(object) + + .validate_lonlat(object, xlim = c(-180, 180), ylim = c(-60, 70)) - result <- data.frame(id = as.integer(rep(rownames(object), each = span)), - lon = as.numeric(rep(object[,1], each = span)), - lat = as.numeric(rep(object[,2], each = span)), - date = rep(days, each = nrow(object)), - chirts = as.numeric(result)) + # get CHIRTS GeoTiff files + rr <- .get_CHIRTS_tiles_CHC(dates, var, ...) - class(result) <- c("chirps_df", class(result)) + if (isTRUE(as.raster)) { + result <- terra::crop(rr, y = object) + return(result) + } else{ + as.raster <- FALSE + } - return(result) + if (isTRUE(as.matrix)) { + result <- terra::extract(rr, y = object, ...) + result$ID <- NULL + return(result) + } else{ + as.matrix <- FALSE + } + + if (all(isFALSE(as.matrix), isFALSE(as.raster))) { + result <- terra::extract(rr, y = object, ...) + result$ID <- NULL + result <- c(t(result)) + days <- + seq.Date(as.Date(dates[1]), as.Date(dates[2]), by = "day") + span <- length(days) + + result <- + data.frame( + id = as.integer(rep(rownames(object), each = span)), + lon = as.numeric(rep(object[, 1], each = span)), + lat = as.numeric(rep(object[, 2], each = span)), + date = rep(days, each = nrow(object)), + chirts = as.numeric(result) + ) + + class(result) <- c("chirps_df", class(result)) + + return(result) + + } } - -} #' @rdname get_chirts #' @method get_chirts SpatVector #' @export -get_chirts.SpatVector <- function(object, dates, var, as.raster = TRUE, ...){ - - dots <- list(...) - as.matrix <- dots[["as.matrix"]] - - # get CHIRTS GeoTiff files - rr <- .get_CHIRTS_tiles_CHC(dates, var, ...) - - if (isTRUE(as.matrix)) { - result <- terra::extract(rr, y = object, ...) - result$ID <- NULL - return(result) - }else{ - as.matrix <- FALSE - } - - if (isTRUE(as.raster)) { - result <- terra::crop(rr, y = object) - return(result) - }else{ - as.raster <- FALSE - } - - if (all(isFALSE(as.matrix), isFALSE(as.raster))) { - days <- seq.Date(as.Date(dates[1]), as.Date(dates[2]), by = "day") - span <- length(days) - result <- terra::extract(rr, y = object, ...) - ids <- result$ID - result$ID <- NULL - result <- c(t(result)) +get_chirts.SpatVector <- + function(object, dates, var, as.raster = TRUE, ...) { + dots <- list(...) + as.matrix <- dots[["as.matrix"]] + + # get CHIRTS GeoTiff files + rr <- .get_CHIRTS_tiles_CHC(dates, var, ...) - result <- data.frame(id = as.integer(rep(ids, each = span)), - lon = NA, - lat = NA, - date = rep(days, each = length(ids)), - chirts = as.numeric(result)) + if (isTRUE(as.matrix)) { + result <- terra::extract(rr, y = object, ...) + result$ID <- NULL + return(result) + } else{ + as.matrix <- FALSE + } - class(result) <- c("chirps_df", class(result)) + if (isTRUE(as.raster)) { + result <- terra::crop(rr, y = object) + return(result) + } else{ + as.raster <- FALSE + } - return(result) + if (all(isFALSE(as.matrix), isFALSE(as.raster))) { + days <- seq.Date(as.Date(dates[1]), as.Date(dates[2]), by = "day") + span <- length(days) + result <- terra::extract(rr, y = object, ...) + ids <- result$ID + result$ID <- NULL + result <- c(t(result)) + + result <- data.frame( + id = as.integer(rep(ids, each = span)), + lon = NA, + lat = NA, + date = rep(days, each = length(ids)), + chirts = as.numeric(result) + ) + + class(result) <- c("chirps_df", class(result)) + + return(result) + + } } - -} #' @rdname get_chirts #' @method get_chirts SpatRaster #' @export -get_chirts.SpatRaster <- function(object, dates, var, as.raster = TRUE, ...){ - - UseMethod("get_chirts", object = "SpatVector") - -} +get_chirts.SpatRaster <- + function(object, dates, var, as.raster = TRUE, ...) { + UseMethod("get_chirts", object = "SpatVector") + + } #' @noRd -.get_CHIRTS_tiles_CHC <- function(dates, var, resolution = 0.05, - coverage = "global", interval = "daily", - format = "tifs", ...){ - +.get_CHIRTS_tiles_CHC <- function(dates, + var, + resolution = 0.05, + coverage = "global", + interval = "daily", + format = "tifs", + ...) { stopifnot(var %in% c("HeatIndex", "RHum", "Tmax", "Tmin")) # setup file names - seqdate <- seq.Date(as.Date(dates[1]), as.Date(dates[2]), by = "day") + seqdate <- + seq.Date(as.Date(dates[1]), as.Date(dates[2]), by = "day") years <- format(seqdate, format = "%Y") # create RH variable for filenames as it's not "RHUM" in the filename but # it is in the directory name @@ -189,17 +199,26 @@ get_chirts.SpatRaster <- function(object, dates, var, as.raster = TRUE, ...){ # year range yrange <- seq(1983, 2016, 1) - stopifnot(unique(years) %in% yrange) - - dates <- gsub("-","\\.", seqdate) - fnames <- file.path(years, paste0(file_name_var, ".", dates, ".tif")) + if (unique(years) %notin% yrange) { + stop(call. = FALSE, + "CHIRTS data is currently available from 1983 to 2016.", + "Soon available to near-present.") + } + + dates <- gsub("-", "\\.", seqdate) + fnames <- + file.path(years, paste0(file_name_var, ".", dates, ".tif")) resolution <- gsub("0\\.", "p", resolution) - u <- file.path("https://data.chc.ucsb.edu/products/CHIRTSdaily/v1.0", - paste0(coverage, "_", format, "_", resolution), var, fnames) + u <- + file.path( + "https://data.chc.ucsb.edu/products/CHIRTSdaily/v1.0", + paste0(coverage, "_", format, "_", resolution), + var, + fnames + ) u1 <- file.path("/vsicurl", u) r <- terra::rast(u1) return(r) } - diff --git a/R/internal_functions.R b/R/internal_functions.R index 7ba91f5..c23a83d 100644 --- a/R/internal_functions.R +++ b/R/internal_functions.R @@ -444,3 +444,18 @@ return(gjson) } + +#' Add %notin% function +#' +#' Negates `%in%` for easier (mis)matching. +#' +#' @param x A character string to match. +#' @param table A table containing values to match `x` against. +#' +#' @return A logical vector, indicating if a mismatch was located for any +#' element of `x`: thus the values are `TRUE` or `FALSE` and never `NA`. +#' @keywords internal +#' @noRd +`%notin%` <- function(x, table) { + match(x, table, nomatch = 0L) == 0L +} From c09d14239743b83c1fa0dfcf5ab0ceec3e283fbe Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Thu, 23 Sep 2021 10:45:36 +0800 Subject: [PATCH 34/93] Add new test for get_chirts() --- tests/testthat/test-get_chirts.R | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/testthat/test-get_chirts.R diff --git a/tests/testthat/test-get_chirts.R b/tests/testthat/test-get_chirts.R new file mode 100644 index 0000000..a4d7b23 --- /dev/null +++ b/tests/testthat/test-get_chirts.R @@ -0,0 +1,14 @@ + +# test_data.rda contains lat/lon and date values for the following tests +load(test_path("test_data.rda")) + +# Test get_chirts() default method ----- +test_that("get_chirts() returns proper values", { + x <- get_chirts(object = lonlat, + dates = dates, + var = "Tmax") + + expect_named(x, c("id", "lon", "lat", "date", "chirts")) + expect_equal(nrow(x), 10) + expect_s3_class(x, c("chirts", "chirts_df", "data.frame")) +}) From c004584f6b32d635205b5f04afb8074b70cdb286 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Thu, 23 Sep 2021 10:52:02 +0800 Subject: [PATCH 35/93] update documentation files --- man/get_chirts.Rd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/man/get_chirts.Rd b/man/get_chirts.Rd index 20a0c84..4e87072 100644 --- a/man/get_chirts.Rd +++ b/man/get_chirts.Rd @@ -34,7 +34,7 @@ object that can be coerced to a \code{data.frame}), \code{\link[terra]{SpatRaster}}} } \value{ -A SpatRaster object if \code{as.raster=TRUE}, else \code{matrix}, +A SpatRaster object if \code{as.raster=TRUE}, else \code{matrix}, \code{list}, or \code{data.frame} } \description{ @@ -45,7 +45,7 @@ Get daily maximum and minimum temperature data from the "Climate Hazards currently available from 1983 to 2016. Soon available to near-present. } \details{ -Variable description from +Variable description from \url{https://data.chc.ucsb.edu/products/CHIRTSdaily/aaa.Readme.txt} \describe{ \item{Tmax}{Daily average maximum air temperature at 2 m above ground} @@ -55,7 +55,7 @@ Variable description from } } \section{Additional arguments}{ - + \bold{interval}: supported intervals are \dQuote{daily}, \dQuote{pentad}, \dQuote{dekad}, \dQuote{monthly}, \dQuote{2-monthly}, \dQuote{3-monthly}, and \dQuote{annual}. Currently hard coded to \dQuote{daily}. From 13f7617cf5afff4b512dbe67ad5050159033b5c4 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 24 Oct 2021 20:40:20 +0800 Subject: [PATCH 36/93] Add spelling checklist --- inst/WORDLIST | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 inst/WORDLIST diff --git a/inst/WORDLIST b/inst/WORDLIST new file mode 100644 index 0000000..a79c8e4 --- /dev/null +++ b/inst/WORDLIST @@ -0,0 +1,68 @@ +Aguilar +Bari +CHC +CHIRTS +CHIRTSmax +ClimateSERV +DD +Dayanandan +ESI +GPM +GoC +HeatIndex +IMERG +JCLI +Kehel +Landsfeld +MLDS +MLWS +Multisatellite +NCOL +NROW +Omics +Pkg +RHum +Rx +SDII +SERVIR +SpatRaster +SpatVector +TMAX +Tapajos +Tapajós +Tmax +Tmin +Vitolo +YYYY +Zwart +center +chc +codecov +dekad +df +dist +doi +edu +esi +geojson +geosjon +imerg +lonlat +nQuadSegs +ncol +nrow +org +pkg +rOpenSci +ropensci +sdata +sfc +th +tibble +timeseries +ucsb +www +xmax +xmin +ymax +ymin From 0d4558c7ced5c0dc0819c06282f8efd536cf94b9 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Wed, 27 Oct 2021 08:06:12 +0800 Subject: [PATCH 37/93] Add space in error message about CHIRTS availability:wq --- R/get_chirts.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/get_chirts.R b/R/get_chirts.R index 3fa3e7e..e6184d0 100644 --- a/R/get_chirts.R +++ b/R/get_chirts.R @@ -201,7 +201,7 @@ get_chirts.SpatRaster <- yrange <- seq(1983, 2016, 1) if (unique(years) %notin% yrange) { stop(call. = FALSE, - "CHIRTS data is currently available from 1983 to 2016.", + "CHIRTS data is currently available from 1983 to 2016. ", "Soon available to near-present.") } From b110fb905575dd698cab3d101f73b1795be86781 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Wed, 16 Mar 2022 11:07:33 +0800 Subject: [PATCH 38/93] Update tic.yml --- .github/workflows/tic.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml index 9bd8787..0cd09b6 100644 --- a/.github/workflows/tic.yml +++ b/.github/workflows/tic.yml @@ -1,9 +1,15 @@ ## tic GitHub Actions template: linux-macos-windows-deploy -## revision date: 2021-06-27 +## revision date: 2022-03-01 on: workflow_dispatch: push: + branches: + - main + - master pull_request: + branches: + - main + - master # for now, CRON jobs only run on the default branch of the repo (i.e. usually on master) schedule: # * is a special character in YAML so you have to quote this string @@ -23,7 +29,7 @@ jobs: config: # use a different tic template type if you do not want to build on all listed platforms - { os: windows-latest, r: "release" } - - { os: macOS-latest, r: "release", pkgdown: "false", latex: "true" } + - { os: macOS-latest, r: "release", pkgdown: "true", latex: "true" } - { os: ubuntu-latest, r: "devel" } - { os: ubuntu-latest, r: "release" } @@ -44,21 +50,17 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} Ncpus: 4 - # LaTeX. Installation time: - # Linux: ~ 1 min - # macOS: ~ 1 min 30s - # Windows: never finishes - - uses: r-lib/actions/setup-tinytex@master + - uses: r-lib/actions/setup-tinytex@v2 if: matrix.config.latex == 'true' - - uses: r-lib/actions/setup-pandoc@master + - uses: r-lib/actions/setup-pandoc@v2 # set date/week for use in cache creation # https://github.community/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970 @@ -84,7 +86,7 @@ jobs: - name: "[Stage] Prepare" run: | Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')" - Rscript -e "if (getRversion() < '3.2' && !requireNamespace('curl')) install.packages('curl', type = 'source')" + Rscript -e "if (!requireNamespace('curl')) install.packages('curl', type = 'source')" - name: "[Stage] [macOS] Install libgit2" if: runner.os == 'macOS' From 1b2a2a0a6f341410cbf8112a8eb111a1a24ee295 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Wed, 16 Mar 2022 11:45:17 +0800 Subject: [PATCH 39/93] Disable pkgdown --- .github/workflows/tic.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml index 0cd09b6..0a92206 100644 --- a/.github/workflows/tic.yml +++ b/.github/workflows/tic.yml @@ -16,7 +16,7 @@ on: - cron: "0 4 * * *" name: tic - +x jobs: all: runs-on: ${{ matrix.config.os }} @@ -29,7 +29,7 @@ jobs: config: # use a different tic template type if you do not want to build on all listed platforms - { os: windows-latest, r: "release" } - - { os: macOS-latest, r: "release", pkgdown: "true", latex: "true" } + - { os: macOS-latest, r: "release", pkgdown: "false", latex: "true" } - { os: ubuntu-latest, r: "devel" } - { os: ubuntu-latest, r: "release" } From 78515a0550687d1133a12e8be82598c8ff80c8e7 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 3 Apr 2022 16:04:05 +0800 Subject: [PATCH 40/93] Update DESCRIPTION --- DESCRIPTION | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index a4550d7..52d5f2c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -45,7 +45,9 @@ Suggests: knitr, markdown, rmarkdown, - testthat (>= 2.1.0) + testthat (>= 3.0.0), + vcr (>= 0.6.0) Language: en-GB RoxygenNote: 7.1.2 VignetteBuilder: knitr +Config/testthat/edition: 3 From b0752cb8311d66d5aff3e7f9db5abd69050c8147 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 3 Apr 2022 20:14:09 +0800 Subject: [PATCH 41/93] Remove VCR --- DESCRIPTION | 3 +- tests/fixtures/CHIRPS_default.yml | 428 -------------- tests/fixtures/CHIRPS_sf_method_return_df.yml | 428 -------------- tests/fixtures/CHIRPS_sf_method_return_sf.yml | 555 ------------------ tests/fixtures/ESI_default.yml | 537 ----------------- .../fixtures/ESI_geojson_method_return_df.yml | 537 ----------------- .../ESI_geojson_method_return_geojson.yml | 537 ----------------- tests/fixtures/ESI_sf_method_return_df.yml | 537 ----------------- tests/fixtures/ESI_sf_method_return_sf.yml | 537 ----------------- tests/testthat.R | 5 +- tests/testthat/setup-chirps.R | 5 - tests/testthat/test-get_chirps.R | 74 ++- tests/testthat/test-get_esi.R | 10 - 13 files changed, 38 insertions(+), 4155 deletions(-) delete mode 100644 tests/fixtures/CHIRPS_default.yml delete mode 100644 tests/fixtures/CHIRPS_sf_method_return_df.yml delete mode 100644 tests/fixtures/CHIRPS_sf_method_return_sf.yml delete mode 100644 tests/fixtures/ESI_default.yml delete mode 100644 tests/fixtures/ESI_geojson_method_return_df.yml delete mode 100644 tests/fixtures/ESI_geojson_method_return_geojson.yml delete mode 100644 tests/fixtures/ESI_sf_method_return_df.yml delete mode 100644 tests/fixtures/ESI_sf_method_return_sf.yml delete mode 100644 tests/testthat/setup-chirps.R diff --git a/DESCRIPTION b/DESCRIPTION index 52d5f2c..621ed91 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -45,8 +45,7 @@ Suggests: knitr, markdown, rmarkdown, - testthat (>= 3.0.0), - vcr (>= 0.6.0) + testthat (>= 3.0.0) Language: en-GB RoxygenNote: 7.1.2 VignetteBuilder: knitr diff --git a/tests/fixtures/CHIRPS_default.yml b/tests/fixtures/CHIRPS_default.yml deleted file mode 100644 index f1a4c42..0000000 --- a/tests/fixtures/CHIRPS_default.yml +++ /dev/null @@ -1,428 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:49:58 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:49:59 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["473fea4f-9433-4cd6-8115-9fea398d45e5"]) - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:00 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:01 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["280628e3-5e2d-426b-b615-aa04ef829b65"]) - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:50:02 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:03 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:04 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:50:05 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=280628e3-5e2d-426b-b615-aa04ef829b65 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:05 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=280628e3-5e2d-426b-b615-aa04ef829b65 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:06 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:07 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:08 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:09 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/fixtures/CHIRPS_sf_method_return_df.yml b/tests/fixtures/CHIRPS_sf_method_return_df.yml deleted file mode 100644 index f1a4c42..0000000 --- a/tests/fixtures/CHIRPS_sf_method_return_df.yml +++ /dev/null @@ -1,428 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:49:58 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:49:59 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["473fea4f-9433-4cd6-8115-9fea398d45e5"]) - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:00 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:01 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["280628e3-5e2d-426b-b615-aa04ef829b65"]) - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:50:02 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:03 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:04 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:50:05 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=280628e3-5e2d-426b-b615-aa04ef829b65 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:05 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=280628e3-5e2d-426b-b615-aa04ef829b65 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:06 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:07 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:08 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=473fea4f-9433-4cd6-8115-9fea398d45e5 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:50:09 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:50:09 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/fixtures/CHIRPS_sf_method_return_sf.yml b/tests/fixtures/CHIRPS_sf_method_return_sf.yml deleted file mode 100644 index 5619db2..0000000 --- a/tests/fixtures/CHIRPS_sf_method_return_sf.yml +++ /dev/null @@ -1,555 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:11 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=0&begintime=01%2F01%2F2000&endtime=01%2F05%2F2000&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:12 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["bebb6c49-441a-4fda-821f-e2aca6eb0173"]) - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:13 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=0&begintime=01%2F01%2F2000&endtime=01%2F05%2F2000&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:13 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["9960326e-bdf9-46c0-892f-9338bf8a9aca"]) - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Mon, 20 Sep 2021 08:19:14 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=bebb6c49-441a-4fda-821f-e2aca6eb0173 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:15 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=bebb6c49-441a-4fda-821f-e2aca6eb0173 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:15 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Mon, 20 Sep 2021 08:19:16 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=9960326e-bdf9-46c0-892f-9338bf8a9aca - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:17 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=9960326e-bdf9-46c0-892f-9338bf8a9aca - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:18 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:19 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=bebb6c49-441a-4fda-821f-e2aca6eb0173 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:19 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "5df19ff6-b5b8-430e-8a66-a6ead5456062", - "epochTime": "946684800", "value": {"avg": 9.255108833312988}}, {"date": "1/2/2000", - "workid": "2bc72233-92a2-400a-b46f-4edfe4c74abf", "epochTime": "946771200", - "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "0a830f16-1a8c-44f6-8c9a-f8e69a64b7d3", - "epochTime": "946857600", "value": {"avg": 0.0}}, {"date": "1/4/2000", "workid": - "fddcf677-f408-49ab-9436-ab946b3ca498", "epochTime": "946944000", "value": - {"avg": 0.0}}, {"date": "1/5/2000", "workid": "2bc78c85-9d2e-4ae4-9610-2ff6d3dea923", - "epochTime": "947030400", "value": {"avg": 18.510217666625977}}]}' - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=bebb6c49-441a-4fda-821f-e2aca6eb0173 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:20 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "5df19ff6-b5b8-430e-8a66-a6ead5456062", - "epochTime": "946684800", "value": {"avg": 9.255108833312988}}, {"date": "1/2/2000", - "workid": "2bc72233-92a2-400a-b46f-4edfe4c74abf", "epochTime": "946771200", - "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "0a830f16-1a8c-44f6-8c9a-f8e69a64b7d3", - "epochTime": "946857600", "value": {"avg": 0.0}}, {"date": "1/4/2000", "workid": - "fddcf677-f408-49ab-9436-ab946b3ca498", "epochTime": "946944000", "value": - {"avg": 0.0}}, {"date": "1/5/2000", "workid": "2bc78c85-9d2e-4ae4-9610-2ff6d3dea923", - "epochTime": "947030400", "value": {"avg": 18.510217666625977}}]}' - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:21 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=9960326e-bdf9-46c0-892f-9338bf8a9aca - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:22 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "99ede304-6933-4bf9-92bb-ed502f1a768d", - "epochTime": "946684800", "value": {"avg": 38.354225158691406}}, {"date": - "1/2/2000", "workid": "d2615254-f34f-4205-96c1-868448ee9e23", "epochTime": - "946771200", "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "bd93cf54-6197-4435-917f-ed4fba5aff13", - "epochTime": "946857600", "value": {"avg": 38.354225158691406}}, {"date": - "1/4/2000", "workid": "1bed0525-25de-4b94-bd94-2507a54113c8", "epochTime": - "946944000", "value": {"avg": 0.0}}, {"date": "1/5/2000", "workid": "ef9a7c32-d5f2-4ed2-a664-9ca942618897", - "epochTime": "947030400", "value": {"avg": 0.0}}]}' - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=9960326e-bdf9-46c0-892f-9338bf8a9aca - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Mon, 20 Sep 2021 08:19:22 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2000", "workid": "99ede304-6933-4bf9-92bb-ed502f1a768d", - "epochTime": "946684800", "value": {"avg": 38.354225158691406}}, {"date": - "1/2/2000", "workid": "d2615254-f34f-4205-96c1-868448ee9e23", "epochTime": - "946771200", "value": {"avg": 0.0}}, {"date": "1/3/2000", "workid": "bd93cf54-6197-4435-917f-ed4fba5aff13", - "epochTime": "946857600", "value": {"avg": 38.354225158691406}}, {"date": - "1/4/2000", "workid": "1bed0525-25de-4b94-bd94-2507a54113c8", "epochTime": - "946944000", "value": {"avg": 0.0}}, {"date": "1/5/2000", "workid": "ef9a7c32-d5f2-4ed2-a664-9ca942618897", - "epochTime": "947030400", "value": {"avg": 0.0}}]}' - recorded_at: 2021-09-20 08:19:22 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/fixtures/ESI_default.yml b/tests/fixtures/ESI_default.yml deleted file mode 100644 index 98b11c4..0000000 --- a/tests/fixtures/ESI_default.yml +++ /dev/null @@ -1,537 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:48:49 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:48:50 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["ed082837-8ee5-40f0-b7b9-e29ac516ee08"]) - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:48:51 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:48:52 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["f8d371c3-0b21-419e-8e59-cea916e9f2c3"]) - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:48:52 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=ed082837-8ee5-40f0-b7b9-e29ac516ee08 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:48:53 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=ed082837-8ee5-40f0-b7b9-e29ac516ee08 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:48:54 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:48:55 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=f8d371c3-0b21-419e-8e59-cea916e9f2c3 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:48:56 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=f8d371c3-0b21-419e-8e59-cea916e9f2c3 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:48:57 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:48:58 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=ed082837-8ee5-40f0-b7b9-e29ac516ee08 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:48:58 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": []}' - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=ed082837-8ee5-40f0-b7b9-e29ac516ee08 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:48:59 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": []}' - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:49:00 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=f8d371c3-0b21-419e-8e59-cea916e9f2c3 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:49:01 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2002", "workid": "0f179b78-fb88-4e60-8002-f3a702a76d4c", - "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "f737b659-f0ec-48b2-8d5c-7476d1d6d4a6", "epochTime": - "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "f5142762-8434-4ef5-b12c-5079fae9c841", "epochTime": "1011225600", - "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=f8d371c3-0b21-419e-8e59-cea916e9f2c3 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:49:02 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2002", "workid": "0f179b78-fb88-4e60-8002-f3a702a76d4c", - "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "f737b659-f0ec-48b2-8d5c-7476d1d6d4a6", "epochTime": - "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "f5142762-8434-4ef5-b12c-5079fae9c841", "epochTime": "1011225600", - "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2021-09-19 02:49:02 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/fixtures/ESI_geojson_method_return_df.yml b/tests/fixtures/ESI_geojson_method_return_df.yml deleted file mode 100644 index 9d236bc..0000000 --- a/tests/fixtures/ESI_geojson_method_return_df.yml +++ /dev/null @@ -1,537 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:45 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:46 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["70dc5a46-bf7f-4870-b9ca-9b3d14302773"]) - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:47 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:47 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["8b2b8978-072c-4814-9f52-f288366e9b4e"]) - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:40:49 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=70dc5a46-bf7f-4870-b9ca-9b3d14302773 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:49 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=70dc5a46-bf7f-4870-b9ca-9b3d14302773 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:50 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:40:51 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=8b2b8978-072c-4814-9f52-f288366e9b4e - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:52 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=8b2b8978-072c-4814-9f52-f288366e9b4e - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:53 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:54 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=70dc5a46-bf7f-4870-b9ca-9b3d14302773 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:54 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": []}' - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=70dc5a46-bf7f-4870-b9ca-9b3d14302773 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:55 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": []}' - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:56 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=8b2b8978-072c-4814-9f52-f288366e9b4e - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:57 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2002", "workid": "9f13fb1d-9ee5-46ae-a7b0-8b8447d5b426", - "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "b9445fb6-9375-41c0-8108-1ab09d68e4fa", "epochTime": - "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "160af5b1-1167-46ff-a06b-fead63411448", "epochTime": "1011225600", - "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=8b2b8978-072c-4814-9f52-f288366e9b4e - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:58 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2002", "workid": "9f13fb1d-9ee5-46ae-a7b0-8b8447d5b426", - "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "b9445fb6-9375-41c0-8108-1ab09d68e4fa", "epochTime": - "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "160af5b1-1167-46ff-a06b-fead63411448", "epochTime": "1011225600", - "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2021-09-19 02:40:58 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/fixtures/ESI_geojson_method_return_geojson.yml b/tests/fixtures/ESI_geojson_method_return_geojson.yml deleted file mode 100644 index 191dc06..0000000 --- a/tests/fixtures/ESI_geojson_method_return_geojson.yml +++ /dev/null @@ -1,537 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:59 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:41:00 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["ba4b03a6-4cd8-4417-ba87-01c73bb80c6a"]) - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:41:01 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:41:02 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["eb385ec6-bce9-4855-bffe-30748f32c496"]) - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:41:03 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=ba4b03a6-4cd8-4417-ba87-01c73bb80c6a - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:41:04 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=ba4b03a6-4cd8-4417-ba87-01c73bb80c6a - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:41:04 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:41:05 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=eb385ec6-bce9-4855-bffe-30748f32c496 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:41:06 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=eb385ec6-bce9-4855-bffe-30748f32c496 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:41:07 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:41:08 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=ba4b03a6-4cd8-4417-ba87-01c73bb80c6a - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:41:08 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": []}' - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=ba4b03a6-4cd8-4417-ba87-01c73bb80c6a - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:41:09 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": []}' - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:41:10 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=eb385ec6-bce9-4855-bffe-30748f32c496 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:41:11 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2002", "workid": "c437a2bb-e64e-4b3a-9171-1b1f24240651", - "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "2be45146-3114-45e2-afa6-13c93f6a1192", "epochTime": - "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "6139c7d1-16b4-490a-919a-2a50915fb458", "epochTime": "1011225600", - "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=eb385ec6-bce9-4855-bffe-30748f32c496 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:41:12 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2002", "workid": "c437a2bb-e64e-4b3a-9171-1b1f24240651", - "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "2be45146-3114-45e2-afa6-13c93f6a1192", "epochTime": - "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "6139c7d1-16b4-490a-919a-2a50915fb458", "epochTime": "1011225600", - "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2021-09-19 02:41:12 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/fixtures/ESI_sf_method_return_df.yml b/tests/fixtures/ESI_sf_method_return_df.yml deleted file mode 100644 index 8b32621..0000000 --- a/tests/fixtures/ESI_sf_method_return_df.yml +++ /dev/null @@ -1,537 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:17 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:17 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["3ad0c088-7ba7-4330-84fb-0a990a86720e"]) - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:19 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:19 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["5f2cb51d-03ee-4ec8-a3b1-438e878f9c65"]) - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:40:20 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=3ad0c088-7ba7-4330-84fb-0a990a86720e - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:21 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=3ad0c088-7ba7-4330-84fb-0a990a86720e - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:22 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:40:23 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=5f2cb51d-03ee-4ec8-a3b1-438e878f9c65 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:24 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=5f2cb51d-03ee-4ec8-a3b1-438e878f9c65 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:24 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:25 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=3ad0c088-7ba7-4330-84fb-0a990a86720e - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:26 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": []}' - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=3ad0c088-7ba7-4330-84fb-0a990a86720e - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:27 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": []}' - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:28 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=5f2cb51d-03ee-4ec8-a3b1-438e878f9c65 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:29 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2002", "workid": "3dc72ca5-6b67-490f-afc4-4c9c5e2939d8", - "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "7c783c6c-db55-4c92-b686-c49d2592a719", "epochTime": - "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "00191d53-161e-459d-acba-2500b153dd11", "epochTime": "1011225600", - "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=5f2cb51d-03ee-4ec8-a3b1-438e878f9c65 - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:30 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2002", "workid": "3dc72ca5-6b67-490f-afc4-4c9c5e2939d8", - "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "7c783c6c-db55-4c92-b686-c49d2592a719", "epochTime": - "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "00191d53-161e-459d-acba-2500b153dd11", "epochTime": "1011225600", - "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2021-09-19 02:40:30 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/fixtures/ESI_sf_method_return_sf.yml b/tests/fixtures/ESI_sf_method_return_sf.yml deleted file mode 100644 index e0b0c0c..0000000 --- a/tests/fixtures/ESI_sf_method_return_sf.yml +++ /dev/null @@ -1,537 +0,0 @@ -http_interactions: -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:30 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-60.03946%2C-3.031387%5D%2C%5B-60.039462928932188%2C-3.031394071067812%5D%2C%5B-60.03947%2C-3.031397%5D%2C%5B-60.039477071067815%2C-3.031394071067812%5D%2C%5B-60.03948%2C-3.031387%5D%2C%5B-60.039477071067815%2C-3.031379928932188%5D%2C%5B-60.03947%2C-3.031377%5D%2C%5B-60.039462928932188%2C-3.031379928932188%5D%2C%5B-60.03946%2C-3.031387%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:31 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["ec2cfa8b-19f3-41d2-afe4-2aa26b6b063a"]) - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:32 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '["Datatype not supported", "Error with begintime", "Error with endtime", - "Error with intervaltype", "problem decoding geometry ", "Error with operationtype"]' - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/submitDataRequest/?datatype=29&begintime=01%2F01%2F2002&endtime=01%2F31%2F2002&intervaltype=0&operationtype=5&callback=successCallback&dateType_Category=default&isZip_CurrentDataType=false&geometry=%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B-54.7838728%2C-2.4221716%5D%2C%5B-54.783875728932188%2C-2.422178671067812%5D%2C%5B-54.7838828%2C-2.4221816%5D%2C%5B-54.783889871067814%2C-2.422178671067812%5D%2C%5B-54.7838928%2C-2.4221716%5D%2C%5B-54.783889871067814%2C-2.422164528932188%5D%2C%5B-54.7838828%2C-2.4221616%5D%2C%5B-54.783875728932188%2C-2.422164528932188%5D%2C%5B-54.7838728%2C-2.4221716%5D%5D%5D%7D%7D - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:33 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '57' - connection: close - content-type: application/json - body: - encoding: UTF-8 - file: no - string: successCallback(["b37aab58-7c39-45bf-9cc4-7f8eb58cbb3d"]) - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:40:34 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=ec2cfa8b-19f3-41d2-afe4-2aa26b6b063a - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:35 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=ec2cfa8b-19f3-41d2-afe4-2aa26b6b063a - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:36 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '500' - message: Internal Server Error - explanation: Server got itself in trouble - headers: - status: HTTP/1.1 500 Internal Server Error - date: Sun, 19 Sep 2021 02:40:37 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie - content-length: '27' - connection: close - content-type: text/html - body: - encoding: UTF-8 - file: no - string:

Server Error (500)

- recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=b37aab58-7c39-45bf-9cc4-7f8eb58cbb3d - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:38 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataRequestProgress/?id=b37aab58-7c39-45bf-9cc4-7f8eb58cbb3d - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:38 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '[100.0]' - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:40 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=ec2cfa8b-19f3-41d2-afe4-2aa26b6b063a - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:40 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": []}' - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=ec2cfa8b-19f3-41d2-afe4-2aa26b6b063a - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:41 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": []}' - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/ - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:42 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: need to send id - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=b37aab58-7c39-45bf-9cc4-7f8eb58cbb3d - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:43 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2002", "workid": "6933b49c-23ec-4fb7-b18b-9f1c3f0caba1", - "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "3b3ae7ef-69a7-4272-aea7-98622caa4a63", "epochTime": - "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "f38ebdec-a12e-47da-bb14-ccdf9ee38abc", "epochTime": "1011225600", - "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 -- request: - method: get - uri: https://climateserv.servirglobal.net/chirps/getDataFromRequest/?id=b37aab58-7c39-45bf-9cc4-7f8eb58cbb3d - body: - encoding: '' - string: '' - headers: - User-Agent: libcurl/7.64.1 r-curl/4.3.2 crul/1.1.0 - Accept-Encoding: gzip, deflate - Accept: application/json, text/xml, application/xml, */* - response: - status: - status_code: '200' - message: OK - explanation: Request fulfilled, document follows - headers: - status: HTTP/1.1 200 OK - date: Sun, 19 Sep 2021 02:40:44 GMT - server: Apache/2.4.18 (Ubuntu) - strict-transport-security: max-age=63072000; includeSubdomains - x-frame-options: DENY - x-content-type-options: nosniff - vary: Cookie,Accept-Encoding - content-encoding: gzip - connection: close - transfer-encoding: chunked - content-type: text/html; charset=utf-8 - body: - encoding: UTF-8 - file: no - string: '{"data": [{"date": "1/1/2002", "workid": "6933b49c-23ec-4fb7-b18b-9f1c3f0caba1", - "epochTime": "1009843200", "value": {"avg": -1.8911585807800293}}, {"date": - "1/9/2002", "workid": "3b3ae7ef-69a7-4272-aea7-98622caa4a63", "epochTime": - "1010534400", "value": {"avg": -1.9161806106567383}}, {"date": "1/17/2002", - "workid": "f38ebdec-a12e-47da-bb14-ccdf9ee38abc", "epochTime": "1011225600", - "value": {"avg": -2.1174285411834717}}]}' - recorded_at: 2021-09-19 02:40:44 GMT - recorded_with: vcr/1.0.2, webmockr/0.8.0 diff --git a/tests/testthat.R b/tests/testthat.R index 6f81d6e..97ebfec 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,5 +1,4 @@ -library("testthat") -library("chirps") -library("sf") +library(testthat) +library(chirps) test_check("chirps") diff --git a/tests/testthat/setup-chirps.R b/tests/testthat/setup-chirps.R deleted file mode 100644 index 1c8e3e7..0000000 --- a/tests/testthat/setup-chirps.R +++ /dev/null @@ -1,5 +0,0 @@ -library("vcr") # *Required* as vcr is set up on loading -invisible(vcr::vcr_configure( - dir = vcr::vcr_test_path("fixtures") -)) -vcr::check_cassette_names() diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index 5edbae2..7494986 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -1,47 +1,43 @@ - -# test_data.rda contains lat/lon and date values for the following tests load(test_path("test_data.rda")) # Test get_chirps() default method ----- -test_that("get_chirps() returns proper values", { - vcr::use_cassette("CHIRPS_default", { - x <- get_chirps(object = lonlat, - dates = dates) - }) - expect_named(x, c("id", "lon", "lat", "date", "chirps")) - expect_equal(nrow(x), 10) - expect_s3_class(x, c("chirps", "chirps_df", "data.frame")) -}) +test_that("get_chirps() returns proper values", + { + x_df <- + get_chirps(data.frame(lonlat), + dates = dates, + server = "ClimateSERV") + expect_equal(x_df, chirps_df) + expect_named(x_df, names(chirps_df)) + expect_equal(nrow(x_df), nrow(chirps_df)) + expect_s3_class(x_df, class(chirps_df)) + }) -# Test sf return data frame method ----- -coords <- st_as_sf(lonlat, coords = c("lon", "lat")) -test_that("get_chirps() sf method return df", { - vcr::use_cassette("CHIRPS_sf_method_return_df", { - x <- get_chirps(object = coords, - dates = dates) - }) - expect_named(x, c("id", "lon", "lat", "date", "chirps")) - expect_equal(nrow(x), 10) - expect_s3_class(x, c("chirps", "chirps_df", "data.frame")) -}) -# Test sf return `sf` method ----- -test_that("get_chirps() sf method return sf", { - vcr::use_cassette("CHIRPS_sf_method_return_sf", { - x <- get_chirps(object = coords, +# Test get_chirps() 'sf' return data frame method ----- +test_that("get_chirps() sf method return df", { + library("sf") + coords <- st_as_sf(lonlat, coords = c("lon", "lat")) + x_sf <- get_chirps(object = coords, dates = dates, - as.sf = TRUE, server = "ClimateSERV") - }) - expect_named(x, - c( - "day_10957", - "day_10958", - "day_10959", - "day_10960", - "day_10961", - "geometry" - )) - expect_equal(nrow(x), 2) - expect_s3_class(x, c("sf", "data.frame")) + expect_equal(x_sf$chirps, chirps_sf$chirps, tolerance = 0.001) + expect_named(x_sf, names(chirps_sf)) + expect_equal(nrow(x_sf), nrow(chirps_sf)) + expect_s3_class(x_sf, class(chirps_sf)) }) + +# get chirps with geojson method +# geojson <- as.geojson(coords) +# +# test_that("geojson method", { +# vcr::use_cassette("geojson_method", { +# z <- suppressWarnings(get_chirps(geojson, dates, server = "ClimateSERV")) +# +# z <- round(z$chirps, 2) +# +# equal <- all(z == chirps$chirps) +# +# expect_true(equal) +# }) +# }) diff --git a/tests/testthat/test-get_esi.R b/tests/testthat/test-get_esi.R index aab9d4c..7259cc4 100644 --- a/tests/testthat/test-get_esi.R +++ b/tests/testthat/test-get_esi.R @@ -4,9 +4,7 @@ load(test_path("test_data.rda")) # Test get_esi() ----- test_that("get_esi() returns proper values", { - vcr::use_cassette("ESI_default", { x <- get_esi(lonlat, dates = c("2002-01-01", "2002-01-31")) - }) expect_named(x, c("id", "lon", "lat", "date", "esi")) expect_equal(nrow(x), 4) expect_s3_class(x, c("chirps_df", "data.frame")) @@ -15,9 +13,7 @@ test_that("get_esi() returns proper values", { # Test sf data frame method ----- coords <- st_as_sf(lonlat, coords = c("lon", "lat")) test_that("get_esi() sf method return df", { - vcr::use_cassette("ESI_sf_method_return_df", { y <- get_esi(coords, dates = c("2002-01-01", "2002-01-31")) - }) expect_named(y, c("id", "lon", "lat", "date", "esi")) expect_equal(nrow(y), 3) expect_s3_class(y, c("chirps_df", "data.frame")) @@ -25,11 +21,9 @@ test_that("get_esi() sf method return df", { # Test sf `sf` method ----- test_that("get_esi() sf method return sf", { - vcr::use_cassette("ESI_sf_method_return_sf", { y <- get_esi(coords, dates = c("2002-01-01", "2002-01-31"), as.sf = TRUE) - }) expect_named(y, c("day_11688", "day_11696", "day_11704", "geometry")) expect_equal(nrow(y), 2) expect_s3_class(y, c("sf", "data.frame")) @@ -38,11 +32,9 @@ test_that("get_esi() sf method return sf", { # Test geojson data frame method ----- geojson <- as.geojson(lonlat) test_that("get_esi() geojson method return df", { - vcr::use_cassette("ESI_geojson_method_return_df", { z <- suppressWarnings(get_esi(geojson, dates = c("2002-01-01", "2002-01-31"))) - }) expect_named(z, c("id", "lon", "lat", "date", "esi")) expect_equal(nrow(z), 3) expect_s3_class(z, c("chirps_df", "data.frame")) @@ -50,14 +42,12 @@ test_that("get_esi() geojson method return df", { # Test geojson `geojson` method ----- test_that("get_esi() geojson method return geojson", { - vcr::use_cassette("ESI_geojson_method_return_geojson", { z <- suppressWarnings(get_esi( geojson, dates = c("2002-01-01", "2002-01-31"), as.geojson = TRUE )) - }) expect_named(z, c("1", "2")) expect_equal(length(z), 2) expect_s3_class(z, c("geojson", "json", "character")) From a7b4630f8dca2d27bcce3c3303688aa2b0e4f91a Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 3 Apr 2022 20:14:16 +0800 Subject: [PATCH 42/93] Update test data --- tests/testthat/test_data.rda | Bin 493 -> 360 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/testthat/test_data.rda b/tests/testthat/test_data.rda index 6f8f0637c16faf1adf8672c26fc8268c37a49ed9..0212f109d93103d7246f5eb005fcb0f87dbb234f 100644 GIT binary patch literal 360 zcmV-u0hj(CiwFP!000000}FDAFy@NjVqjokW?*4tW?*IoG8tGyL)>&N7#LWXfE-2! z76wir&6%8$SyWIQpOOYtEDTZw#JoVv1y+QKnXq6!kop6Dth`at(=-Xv-YH?OZJ*8& zqT%LpIJjTFqQOm&W=@#h@GC8u5DoMv*j$IBX$_!YaX6aJ0HvY)3@ASX$|p`8TEMa< z=Oh*v0~rEHf-EkHC8IotqAA_^i)@rU#{dz=#X@;_*d{{sMfLpmZZ G1^@uPq?0oM literal 493 zcmV-uOT$1A9ydwRNJa4O!IOfmX|>=nVAX>lC_ah`8uPG) z*p?XdS_*pg=0ya5hR1?*dO{= z6L1T{=EhQP9)Kq(3;+*9$TMoSW;IVxbIel*E{k0BGysT?p)Oue#=_Q2{Zu#68jO0U zJ}OFu8T^WpB>hB+F=RG|%*BwBkA&Y9R8u)&&j!vIifT73+;wq{xCZ2j^YOd2w{u7# zx!AtkoBX(!7p5PPo&r1~_b8OE=pymux=kGFDWRT{W+B)WeI1VJBt{bszOEeWEO?HB zd|9#eNR3&I8g)~#BSwa-##x>ja$_Pb{Ba!TGsPcKQ*0$~Sa>DLCp-;&VquDI<#JL1 zzZg=AbrSW`>q|llNII)Rc4zl$s{>ej|F<;AFbiHXb@pPPBYMt2X=GE_Ri&n+_wA^kH|d=bqxFOA~h|gcc@=l je9n@4COSxb@^spV=DudIhfqqJH|Tx?$PdwA=LG-&vj*r~ From 8d44678118e1e1febb8e6d66baace7943ea16b8c Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 3 Apr 2022 20:14:22 +0800 Subject: [PATCH 43/93] Redoc package --- man/as.geojson.Rd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/man/as.geojson.Rd b/man/as.geojson.Rd index 23f1dd1..2ff9a3b 100644 --- a/man/as.geojson.Rd +++ b/man/as.geojson.Rd @@ -6,11 +6,11 @@ \alias{as.geojson.sf} \title{Methods to coerce geographical coordinates into a geojson polygon} \usage{ -as.geojson(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) +as.geojson(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) -\method{as.geojson}{default}(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) +\method{as.geojson}{default}(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) -\method{as.geojson}{sf}(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) +\method{as.geojson}{sf}(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) } \arguments{ \item{lonlat}{a data.frame or matrix with geographical coordinates lonlat, in From 5986f264ba1f4a14ab799ea1f4f2ae08cb3e68f5 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 3 Apr 2022 20:29:57 +0800 Subject: [PATCH 44/93] Reset tic and use update-tic --- .github/workflows/update-tic.yml | 53 ++++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/update-tic.yml diff --git a/.github/workflows/update-tic.yml b/.github/workflows/update-tic.yml new file mode 100644 index 0000000..20f1303 --- /dev/null +++ b/.github/workflows/update-tic.yml @@ -0,0 +1,53 @@ +on: + workflow_dispatch: + schedule: + # * is a special character in YAML so you have to quote this string + - cron: "0 4 * * *" + +name: Update tic + +jobs: + update-tic: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - { os: ubuntu-latest, r: "release" } + + env: + # use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + + - uses: r-lib/actions/setup-r@master + with: + r-version: ${{ matrix.config.r }} + Ncpus: 4 + + - name: "[Stage] Dependencies" + run: | + sudo apt install libcurl4-openssl-dev libsodium-dev libharfbuzz-dev libfribidi-dev libgit2-dev + Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')" + Rscript -e "remotes::install_github('ropensci/tic', dependencies = TRUE)" + + - name: "[Stage] Update YAMLs" + run: | + Rscript -e "tic::update_yml()" + + - name: "[Stage] Create Pull Request" + uses: peter-evans/create-pull-request@v3 + with: + author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> + token: ${{ secrets.TIC_UPDATE }} + title: "Update tic templates [ci-skip]" + commit-message: "update tic templates" + body: "{tic} templates can be updated :rocket: :robot:" + branch: update-tic diff --git a/.gitignore b/.gitignore index efa1e45..122dbe9 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ doc Meta /doc/ /Meta/ +docs/ From 21bf1bd100e7166a130048b2c9c1a232893c4046 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Mon, 4 Apr 2022 06:16:39 +0800 Subject: [PATCH 45/93] fix bug in tic.yml --- .github/workflows/tic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml index 72dc471..6651e46 100644 --- a/.github/workflows/tic.yml +++ b/.github/workflows/tic.yml @@ -16,7 +16,7 @@ on: - cron: "0 4 * * *" name: tic -x + jobs: all: runs-on: ${{ matrix.config.os }} From 9111cbd5b1804e8c2049b3417fd224915c085cae Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 4 Apr 2022 06:21:09 +0800 Subject: [PATCH 46/93] Fix incomplete line --- .github/workflows/tic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml index 3d25c90..39c76be 100644 --- a/.github/workflows/tic.yml +++ b/.github/workflows/tic.yml @@ -136,4 +136,4 @@ jobs: run: Rscript -e "tic::deploy()" - name: "[Stage] After Deploy" - run: Rscript -e "tic::after_deploy()" \ No newline at end of file + run: Rscript -e "tic::after_deploy()" From 5fd304140d0267ca351a380efeb0a41bffca5dce Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Mon, 4 Apr 2022 06:22:53 +0800 Subject: [PATCH 47/93] trigger tic on devel as well. No pkgdown build --- .github/workflows/tic.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml index 39c76be..a96ec17 100644 --- a/.github/workflows/tic.yml +++ b/.github/workflows/tic.yml @@ -6,10 +6,12 @@ on: branches: - main - master + - devel pull_request: branches: - main - master + - devel # for now, CRON jobs only run on the default branch of the repo (i.e. usually on master) schedule: # * is a special character in YAML so you have to quote this string @@ -29,7 +31,7 @@ jobs: config: # use a different tic template type if you do not want to build on all listed platforms - { os: windows-latest, r: "release" } - - { os: macOS-latest, r: "release", pkgdown: "true", latex: "true" } + - { os: macOS-latest, r: "release", pkgdown: "false", latex: "true" } - { os: ubuntu-latest, r: "devel" } - { os: ubuntu-latest, r: "release" } From 6eaf63c1ef42142c64bab5ed21f5b4eee96f7aba Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 16 Apr 2022 12:58:14 +0800 Subject: [PATCH 48/93] Update tic.yml --- .github/workflows/tic.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml index a96ec17..91eeaf3 100644 --- a/.github/workflows/tic.yml +++ b/.github/workflows/tic.yml @@ -84,6 +84,12 @@ jobs: if: runner.os == 'Linux' run: sudo apt install libcurl4-openssl-dev libgit2-dev + # for some strange Windows reason this step and the next one need to be decoupled + - name: "[Stage] Prepare" + run: | + Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')" + Rscript -e "if (!requireNamespace('curl')) install.packages('curl', type = 'source')" + - name: "[Stage] [macOS] Install libgit2" if: runner.os == 'macOS' run: brew install libgit2 @@ -108,14 +114,14 @@ jobs: - name: "[Stage] Install" if: matrix.config.os != 'macOS-latest' || matrix.config.r != 'devel' - run: Rscript -e "install.packages('tic', repos = structure(c(ropensci = 'https://ropensci.r-universe.dev', CRAN = 'https://cloud.r-project.org')))" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()" + run: Rscript -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()" # macOS devel needs its own stage because we need to work with an option to suppress the usage of binaries - name: "[Stage] Prepare & Install (macOS-devel)" if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'devel' run: | echo -e 'options(Ncpus = 4, pkgType = "source", repos = structure(c(CRAN = "https://cloud.r-project.org/")))' > $HOME/.Rprofile - Rscript -e "install.packages('tic', repos = structure(c(ropensci = 'https://ropensci.r-universe.dev', CRAN = 'https://cloud.r-project.org')))" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()" + Rscript -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()" - name: "[Stage] Script" run: Rscript -e 'tic::script()' From 57774e01e1a9046702d617a5cb825b911c3b88d6 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 16 Apr 2022 13:25:18 +0800 Subject: [PATCH 49/93] Update as.geojson.Rd --- man/as.geojson.Rd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/man/as.geojson.Rd b/man/as.geojson.Rd index 2ff9a3b..23f1dd1 100644 --- a/man/as.geojson.Rd +++ b/man/as.geojson.Rd @@ -6,11 +6,11 @@ \alias{as.geojson.sf} \title{Methods to coerce geographical coordinates into a geojson polygon} \usage{ -as.geojson(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) +as.geojson(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) -\method{as.geojson}{default}(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) +\method{as.geojson}{default}(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) -\method{as.geojson}{sf}(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) +\method{as.geojson}{sf}(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) } \arguments{ \item{lonlat}{a data.frame or matrix with geographical coordinates lonlat, in From c05692868984d348184bec6867e105c09fa69b7b Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 17 Apr 2022 11:49:15 +0800 Subject: [PATCH 50/93] Update tic.yml --- man/as.geojson.Rd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/man/as.geojson.Rd b/man/as.geojson.Rd index 23f1dd1..2ff9a3b 100644 --- a/man/as.geojson.Rd +++ b/man/as.geojson.Rd @@ -6,11 +6,11 @@ \alias{as.geojson.sf} \title{Methods to coerce geographical coordinates into a geojson polygon} \usage{ -as.geojson(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) +as.geojson(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) -\method{as.geojson}{default}(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) +\method{as.geojson}{default}(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) -\method{as.geojson}{sf}(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) +\method{as.geojson}{sf}(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) } \arguments{ \item{lonlat}{a data.frame or matrix with geographical coordinates lonlat, in From deacd484eaef9614a20710eccf27603f26700f96 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 17 Apr 2022 11:49:40 +0800 Subject: [PATCH 51/93] Update Rd file --- man/as.geojson.Rd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/man/as.geojson.Rd b/man/as.geojson.Rd index 2ff9a3b..23f1dd1 100644 --- a/man/as.geojson.Rd +++ b/man/as.geojson.Rd @@ -6,11 +6,11 @@ \alias{as.geojson.sf} \title{Methods to coerce geographical coordinates into a geojson polygon} \usage{ -as.geojson(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) +as.geojson(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) -\method{as.geojson}{default}(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) +\method{as.geojson}{default}(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) -\method{as.geojson}{sf}(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) +\method{as.geojson}{sf}(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) } \arguments{ \item{lonlat}{a data.frame or matrix with geographical coordinates lonlat, in From cb91c7a26fe285fccf26091234b2326bf1fae8a5 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 17 Apr 2022 15:43:21 +0800 Subject: [PATCH 52/93] Ensure that chirps_df is of class "chirps" --- tests/testthat/test_data.rda | Bin 360 -> 976 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/testthat/test_data.rda b/tests/testthat/test_data.rda index 0212f109d93103d7246f5eb005fcb0f87dbb234f..c75560b436a2cd445e05e02537755f631c21af51 100644 GIT binary patch literal 976 zcmV;>126m^iwFP!000001MOEqkJ?5Qp0&+pAxc%Lf57r7kqiPGcA+OWi{qdYK)^P% z2yGpE3|5SX*xu}tQ%?N}z4XuYl4~#R59n{`A%`47X0XS`#*{=+bIOR}%{)JU^XAQa zZ=MIOv0NAz001oDj#$9v@DSuKM~{ki05}FujsOSpnCA7lj7;a=DX z?RF-ke?#Q|=;rSIJo)XxLHdL7qw?#&e;%R{?nzVq>+kz_4^sA*-(SBo^+OczbA#J_ zW4Oc(2r z_Bt2cl&EgR+ZbZP^?Lm_Fixh6delWZ@X0Rve;#>cmM?h98#@%jeKApJg`u$LxR~)z z)GzwIc6UUN-ZN)`wqMac3ymhQDA9aH`;ushq;bc&f{UfU0zs-c3c@CtSC%f+EziO^ zFo@HmIKC2stnPYY$T1)p>UpIcwC<5uU0;zFrl?0*_nke02E) z^N?#Byb6&4eM{$uE6;}uzS4-~NK-nUc7NDww_=P_`K(@%&qS$FFG;mCNs?=)a{LBq z9i^*|9$$9bqlvJ9z6%AhGM!EXq5h!#M8WH;E`-jFrOySi9KU|vRXa-XrU7SI1V1g6 zD`(Z3EH$KBrO~L$GKIPrPM~dDOAlFwW{c8v3uoNM`<~I=;hV+suMNoG?`Zx5L3EJo z&yz~`1}$YUsZ5jHPtqrAVdTu{%E-YhL(TKE7M4C|;mhHMNBcF>k_{p-Y1B} z{if5vX;~UJ3=I~`SzgntoxOSP@42)BC*O%9?%6YR8%8RZ&X?Jd8>zrijN64p>kMwS zHNIVFw=o}&_uQv}4pcWLy~Vs|>Q||ppvUq%`oslLR;d%rPOuk|@L2^I+!|~ZDqwT> zCX&N7#LWXfE-2! z76wir&6%8$SyWIQpOOYtEDTZw#JoVv1y+QKnXq6!kop6Dth`at(=-Xv-YH?OZJ*8& zqT%LpIJjTFqQOm&W=@#h@GC8u5DoMv*j$IBX$_!YaX6aJ0HvY)3@ASX$|p`8TEMa< z=Oh*v0~rEHf-EkHC8IotqAA_^i)@rU#{dz=#X@;_*d{{sMfLpmZZ G1^@uPq?0oM From fa10c1a8ae7bfcb9c830af443326b04adb0ca2c0 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 17 Apr 2022 15:43:30 +0800 Subject: [PATCH 53/93] Reformat code --- tests/testthat/test-get_chirps.R | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index 7494986..b787313 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -3,10 +3,10 @@ load(test_path("test_data.rda")) # Test get_chirps() default method ----- test_that("get_chirps() returns proper values", { - x_df <- - get_chirps(data.frame(lonlat), - dates = dates, - server = "ClimateSERV") + x_df <- + get_chirps(data.frame(lonlat), + dates = dates, + server = "ClimateSERV") expect_equal(x_df, chirps_df) expect_named(x_df, names(chirps_df)) expect_equal(nrow(x_df), nrow(chirps_df)) @@ -18,9 +18,9 @@ test_that("get_chirps() returns proper values", test_that("get_chirps() sf method return df", { library("sf") coords <- st_as_sf(lonlat, coords = c("lon", "lat")) - x_sf <- get_chirps(object = coords, - dates = dates, - server = "ClimateSERV") + x_sf <- get_chirps(object = coords, + dates = dates, + server = "ClimateSERV") expect_equal(x_sf$chirps, chirps_sf$chirps, tolerance = 0.001) expect_named(x_sf, names(chirps_sf)) expect_equal(nrow(x_sf), nrow(chirps_sf)) @@ -29,15 +29,15 @@ test_that("get_chirps() sf method return df", { # get chirps with geojson method # geojson <- as.geojson(coords) -# +# # test_that("geojson method", { # vcr::use_cassette("geojson_method", { # z <- suppressWarnings(get_chirps(geojson, dates, server = "ClimateSERV")) -# +# # z <- round(z$chirps, 2) -# +# # equal <- all(z == chirps$chirps) -# +# # expect_true(equal) # }) # }) From e9b60eb421e7e134a9206631f277032377c37add Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 17 Apr 2022 15:43:49 +0800 Subject: [PATCH 54/93] Update tests to use new built-in data --- tests/testthat/test-precip_indices.R | 114 ++++++++++++++++++--------- 1 file changed, 76 insertions(+), 38 deletions(-) diff --git a/tests/testthat/test-precip_indices.R b/tests/testthat/test-precip_indices.R index c425ec1..e6b4a1e 100644 --- a/tests/testthat/test-precip_indices.R +++ b/tests/testthat/test-precip_indices.R @@ -3,58 +3,96 @@ load(test_path("test_data.rda")) # Test the default behaviour -values <- c(3, 1, 1, 0, - 18.51, 27.77, 18.51, 18.51, - 27.77, 13.88, 2, 1, 0, 2, - 38.35, 76.71, 0, 0, 76.71, 38.35) +values <- + c( + 4.00000, + 1.00000, + 0.00000, + 1.00000, + 20.17695, + 20.17695, + 20.17695, + 20.17695, + 20.17695, + 20.17695, + 2.00000, + 1.00000, + 0.00000, + 2.00000, + 38.35423, + 76.70845, + 0.00000, + 0.00000, + 76.70845, + 38.35423 + ) test_that("timespan FALSE", { - - p <- precip_indices(precip, timeseries = FALSE) - - v <- round(p$value, 2) - - equal <- all(v == values) - - expect_true(equal) - + p <- precip_indices(chirps_df, timeseries = FALSE) + expect_equal(p$value, values, tolerance = 0.01) }) # The function can handle timeseries intervals # here it will return just one interval since we have only 5 days -values2 <- c(3, 1, 0, 0, 9.26, 9.26, 9.26, 9.26, 9.26, - 9.26, 1, 1, 0, 2, 38.35, 76.71, 0, 0, 76.71, 38.35) +values2 <- + c( + 4.00000, + 0.00000, + 0.00000, + 0.00000, + 0.00000, + 0.00000, + 0.00000, + 0.00000, + 0.00000, + 0.00000, + 1.00000, + 1.00000, + 0.00000, + 2.00000, + 38.35423, + 76.70845, + 0.00000, + 0.00000, + 76.70845, + 38.35423 + ) test_that("timespan TRUE", { - - p <- precip_indices(precip, timeseries = TRUE, intervals = 4) - - v <- round(p$value, 2) - - equal <- all(v == values2) - - expect_true(equal) - + p <- precip_indices(chirps_df, timeseries = TRUE, intervals = 4) + expect_equal(p$value, values2, tolerance = 0.001) }) # The function can handle NAs -values3 <- c(2, 1, 1, 0, 18.51, 27.77, 18.51, 18.51, - 27.77, 9.26, 2, 1, 0, 2, 38.35, 76.71, 0, 0, 76.71, 25.57) +values3 <- + c( + 2.00000, + 1.00000, + 0.00000, + 1.00000, + 20.17695, + 20.17695, + 20.17695, + 20.17695, + 20.17695, + 10.08848, + 2.00000, + 1.00000, + 0.00000, + 2.00000, + 38.35423, + 76.70845, + 0.00000, + 0.00000, + 76.70845, + 25.56948 + ) test_that("accepts NAs", { - dt <- precip - - dt[c(2, 7), "chirps"] <- NA - - p <- precip_indices(dt) - - v <- round(p$value, 2) - - equal <- all(v == values3) - - expect_true(equal) - + chirps_df[c(2, 7), "chirps"] <- NA + p <- precip_indices(chirps_df) + expect_equal(p$value, values3, tolerance = 0.001) }) # Get an error with non chirps data From 177be5843dc6b3ce23a0a063b3a329e760fa7bf6 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 17 Apr 2022 16:16:05 +0800 Subject: [PATCH 55/93] Replace -9999.00 with NA --- R/get_esi.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/get_esi.R b/R/get_esi.R index 62da950..31f631b 100644 --- a/R/get_esi.R +++ b/R/get_esi.R @@ -107,6 +107,8 @@ get_esi.default <- function(object, dates, operation = 5, period = 1, result <- as.data.frame(result, stringsAsFactors = FALSE) + result[result == -9999] <- NA + class(result) <- c("chirps_df", class(result)) return(result) From f13dc50d6d21ffc4f2a88d5d6d363421713d05e6 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 17 Apr 2022 16:16:24 +0800 Subject: [PATCH 56/93] Check against a chirps data.frame for names --- tests/testthat/test-get_chirps.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index b787313..eeeb3df 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -22,9 +22,9 @@ test_that("get_chirps() sf method return df", { dates = dates, server = "ClimateSERV") expect_equal(x_sf$chirps, chirps_sf$chirps, tolerance = 0.001) - expect_named(x_sf, names(chirps_sf)) - expect_equal(nrow(x_sf), nrow(chirps_sf)) - expect_s3_class(x_sf, class(chirps_sf)) + expect_named(x_sf, names(chirps_df)) + expect_equal(nrow(x_sf), nrow(chirps_df)) + expect_s3_class(x_sf, class(chirps_df)) }) # get chirps with geojson method From ec8082ba1144c5424f9f28be15bca03674dc387e Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 17 Apr 2022 16:23:39 +0800 Subject: [PATCH 57/93] Fix bug where start date can't equal start date of data set --- R/internal_functions.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/internal_functions.R b/R/internal_functions.R index 9ab22f7..2f605e7 100644 --- a/R/internal_functions.R +++ b/R/internal_functions.R @@ -335,7 +335,7 @@ cond1 <- as.integer(xmax - xmin) >= 0 # no older than past date - cond2 <- xmin > past + cond2 <- xmin >= past # no later then present date cond3 <- xmax < present From f4a0d07f9cfda354bbc678cb2ed8f657864bc605 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 17 Apr 2022 16:16:05 +0800 Subject: [PATCH 58/93] Revert "Replace -9999.00 with NA" This reverts commit 177be5843dc6b3ce23a0a063b3a329e760fa7bf6. --- R/get_esi.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/R/get_esi.R b/R/get_esi.R index 31f631b..62da950 100644 --- a/R/get_esi.R +++ b/R/get_esi.R @@ -107,8 +107,6 @@ get_esi.default <- function(object, dates, operation = 5, period = 1, result <- as.data.frame(result, stringsAsFactors = FALSE) - result[result == -9999] <- NA - class(result) <- c("chirps_df", class(result)) return(result) From 2f2d85b8596b9ba7c5e77f7a1d4c40f3ae35cb27 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Sun, 17 Apr 2022 18:17:35 +0800 Subject: [PATCH 59/93] replace -9999 with NA --- R/GET.R | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/R/GET.R b/R/GET.R index 8b7eb19..ea3ea42 100644 --- a/R/GET.R +++ b/R/GET.R @@ -1,36 +1,38 @@ #' General function to get data from ClimateSERV API #' #' @param gjson a list with geojson strings -#' @param dates a character of start and end dates in that order in +#' @param dates a character of start and end dates in that order in #' the format MM/DD/YYYY #' @param operation an integer that represents which type of statistical #' operation to perform on the dataset #' @param datatype an integer, the unique \code{datatype} number for the dataset #' which this request operates on #' @return A \code{data.frame} with values -#' @details -#' operation: supported operations are max = 0, min = 1, median = 2, +#' @details +#' operation: supported operations are max = 0, min = 1, median = 2, #' sum = 4, average = 5 -#' -#' datatype: supported datatypes are Global CHIRPS = 0, +#' +#' datatype: supported datatypes are Global CHIRPS = 0, #' Global ESI 4 Week = 29 #' datatype codes are described at #' -#' +#' #' @examples #' example("tapajos", package = "chirps") -#' +#' #' dates <- c("05/01/2017", "01/31/2018") -#' +#' #' operation <- 5 -#' +#' #' datatype <- 29 -#' +#' #' chirps:::.GET(gjson, dates, operation, datatype) -#' +#' #'@noRd -.GET <- function(gjson, dates, operation = NULL, datatype = NULL) { - +.GET <- function(gjson, + dates, + operation = NULL, + datatype = NULL) { message("Fetching data from ClimateSERV \n") begindate <- dates[1] @@ -38,7 +40,6 @@ # submit data request and get ids ids <- lapply(gjson, function(x) { - i <- .send_request( datatype = datatype, begintime = begindate, @@ -55,26 +56,23 @@ # check request progress and wait # until the request is done by the server request_progress <- seq_along(ids) == FALSE - + nids <- max(seq_along(ids)) message("Getting your request...\n") while (isFALSE(all(request_progress))) { - request_progress <- lapply(ids, function(x) { - p <- .get_request_progress(x) - + }) - + request_progress <- unlist(request_progress) - + } # get data from request result <- lapply(ids, function(x) { - d <- .get_data_from_request(id = x) return(d) @@ -83,8 +81,7 @@ # define ids ids <- NULL - for(i in seq_along(result)) { - + for (i in seq_along(result)) { nr <- dim(result[[i]])[[1]] ids <- c(ids, rep(i, nr)) @@ -97,10 +94,11 @@ if (nr == 0) { stop("Failed to get valid values, - try to increase the buffer area with 'dist' \n") + try to increase the buffer area with 'dist' \n", + call. = FALSE) } - # add ids + # add ids result$id <- ids # transform dates to the original format as input @@ -115,9 +113,11 @@ result <- result[, c("id", "date", "value")] - result <- result[order(result$date), ] + result <- result[order(result$date),] + + result <- result[order(result$id),] - result <- result[order(result$id), ] + result[result == -9999] <- NA class(result) <- union("chirps_df", class(result)) From 7e9af99ac8a8afa6132ceaff1b52a5a4fc252c89 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 18 Apr 2022 13:04:40 +0800 Subject: [PATCH 60/93] Remove VCR --- DESCRIPTION | 1 - 1 file changed, 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 621ed91..046b148 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -40,7 +40,6 @@ Imports: stats, terra (>= 1.2-10) Suggests: - vcr (>= 0.6.0), climatrends, knitr, markdown, From ebd6687a1cb85ad279ad64cabf3d94cf8e306b20 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 18 Apr 2022 13:05:57 +0800 Subject: [PATCH 61/93] Correct as.geojson() call, there are no extra params --- R/get_esi.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/get_esi.R b/R/get_esi.R index 62da950..b12fff3 100644 --- a/R/get_esi.R +++ b/R/get_esi.R @@ -171,10 +171,11 @@ get_esi.sf <- function(object, dates, operation = 5, period = 1, .validate_lonlat(lonlat, xlim = c(-180, 180), ylim = c(-50, 50)) # validate and reformat dates - dates_inter <- .reformat_dates(dates, availability = c("2001-01-01", "0")) + dates_inter <- + .reformat_dates(dates, availability = c("2001-01-01", "0")) # get geojson strings from data.frame - gj <- as.geojson(object, ...) + gj <- as.geojson(object) class(gj) <- "character" From 2e06c6e065041b0dcd5536d830034448f97c97a2 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 18 Apr 2022 13:14:47 +0800 Subject: [PATCH 62/93] Clean up errant # nocov start --- R/internal_functions.R | 1 - 1 file changed, 1 deletion(-) diff --git a/R/internal_functions.R b/R/internal_functions.R index 2f605e7..586393e 100644 --- a/R/internal_functions.R +++ b/R/internal_functions.R @@ -150,7 +150,6 @@ httr::accept_json(), terminate_on = c(403, 404)) - # nocov start p <- httr::content(p, as = "text", encoding = "UTF-8") if (p == -1) { #nocov start From e5d50d10b94faf0c0eb64cd725605dab4c39debd Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 18 Apr 2022 13:15:47 +0800 Subject: [PATCH 63/93] reformat code --- R/get_chirps.R | 142 ++++++++++++++++++++++++++----------------------- 1 file changed, 75 insertions(+), 67 deletions(-) diff --git a/R/get_chirps.R b/R/get_chirps.R index c4888cd..b2b2f73 100644 --- a/R/get_chirps.R +++ b/R/get_chirps.R @@ -1,42 +1,42 @@ #' Get CHIRPS precipitation data -#' -#' Get daily precipitation data from the "Climate Hazards Group". Two server -#' sources are available. The first, "CHC" (default) is recommended for -#' multiple data-points, while "ClimateSERV" is recommended when -#' few data-points are required (~ 50). -#' +#' +#' Get daily precipitation data from the "Climate Hazards Group". Two server +#' sources are available. The first, "CHC" (default) is recommended for +#' multiple data-points, while "ClimateSERV" is recommended when few +#' data-points are required (~ 50). +#' #' @param object input, an object of class \code{\link[base]{data.frame}} (or #' any other object that can be coerced to \code{data.frame}), #' \code{\link[terra]{SpatVector}}, \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" or +#' @param server a character that represents 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} #' @param as.raster logical, returns an object of class #' \code{\link[terra]{SpatRaster}} #' @param as.matrix logical, returns an object of class \code{matrix} -#' @param ... additional arguments passed to \code{\link[terra]{terra}} +#' @param ... additional arguments passed to \code{\link[terra]{terra}} #' or \code{\link[sf]{sf}} methods -#' See details -#' +#' See details +#' #' @details -#' Data description at +#' Data description at #' \url{https://data.chc.ucsb.edu/products/CHIRPS-2.0/README-CHIRPS.txt} -#' +#' #' \strong{Additional arguments when using server = "CHC"} -#' +#' #' \bold{resolution}: numeric, resolution of CHIRPS tiles either 0.05 (default) #' or 0.25 degrees -#' +#' #' \strong{Additional arguments when using server = "ClimateSERV"} -#' +#' #' \bold{dist}: numeric, buffer distance for each \code{object} coordinate -#' +#' #' \bold{nQuadSegs}: integer, number of segments per buffer quadrant -#' +#' #' \bold{operation}: supported operations for ClimateSERV are: #' \tabular{rll}{ #' \bold{operation} \tab \tab \bold{value}\cr @@ -46,7 +46,7 @@ #' sum \tab = \tab 4\cr #' average \tab = \tab 5 (\emph{default value})\cr #' } -#' +#' #' @return A matrix, raster or a data frame of \acronym{CHIRPS} data: #' \describe{ #' \item{id}{the index for the rows in \code{object}} @@ -55,52 +55,51 @@ #' \item{lat}{the latitude as provided in \code{object}} #' \item{chirps}{the \acronym{CHIRPS} value in mm} #' } -#' @references -#' +#' @references +#' #' Funk C. et al. (2015). Scientific Data, 2, 150066. #' \cr\doi{10.1038/sdata.2015.66} -#' -#' @note \code{get_chirps()} may return some warning messages given by +#' +#' @note \code{get_chirps()} may return some warning messages given by #' \code{\link[sf]{sf}}, please look \CRANpkg{sf} documentation for possible #' issues. -#' +#' #' @examplesIf interactive() #' library("chirps") #' library("terra") -#' +#' #' # Case 1: return as a data.frame #' dates <- c("2017-12-15","2017-12-31") #' lonlat <- data.frame(lon = c(-55.0281,-54.9857), lat = c(-2.8094, -2.8756)) -#' +#' #' r1 <- get_chirps(lonlat, dates, server = "CHC") -#' +#' #' # Case 2: return a matrix #' r2 <- get_chirps(lonlat, dates, server = "CHC", as.matrix = TRUE) -#' +#' #' # Case 3: input SpatVector and return raster #' f <- system.file("ex/lux.shp", package = "terra") #' v <- vect(f) #' r3 <- get_chirps(v, dates, server = "CHC", as.raster = TRUE) -#' +#' #' # Case 4: input SpatExtent and return a raster within the extent #' area <- ext(c(-66, -64, -6, -4)) -#' +#' #' dates <- c("2017-12-15", "2017-12-31") -#' +#' #' r4 <- get_chirps(area, dates, server = "CHC") -#' +#' #' # Case 5: using the server "ClimateSERV" #' r5 <- get_chirps(lonlat, dates, server = "ClimateSERV") -#' +#' #' # Case 6: from "ClimateSERV" and return as a matrix #' r6 <- get_chirps(lonlat, dates, server = "ClimateSERV", as.matrix = TRUE) -#' -#' +#' +#' #' @importFrom sf st_centroid read_sf st_geometry_type #' @importFrom terra crop extract rast #' @export get_chirps <- function(object, dates, server, ...) { - if (isFALSE(any(server %in% c("CHC", "ClimateSERV")))) { stop("Unknown server, please choose 'CHC' or 'ClimateSERV' \n") } @@ -111,22 +110,20 @@ get_chirps <- function(object, dates, server, ...) { #' @rdname get_chirps #' @export -get_chirps.default <- function(object, dates, server, +get_chirps.default <- function(object, dates, server, as.matrix = FALSE, ...) { - - object <- as.data.frame(object) dots <- list(...) as.raster <- dots[["as.raster"]] - + # validate lonlat to check if they are within the CHIRPS range lat -50, 50 .validate_lonlat(object, xlim = c(-180, 180), ylim = c(-50, 50)) if (server == "ClimateSERV") { - # validate dates - dates_inter <- .reformat_dates(dates, availability = c("1981-01-01", "0")) + dates_inter <- + .reformat_dates(dates, availability = c("1981-01-01", "0")) # get geojson strings from data.frame gj <- as.geojson(object, ...) @@ -140,10 +137,12 @@ get_chirps.default <- function(object, dates, server, operation <- 5 } - result <- .GET(gjson = gj, - dates = dates_inter, - operation = operation, - datatype = 0) + result <- .GET( + gjson = gj, + dates = dates_inter, + operation = operation, + datatype = 0 + ) names(result)[names(result) == "value"] <- "chirps" @@ -166,7 +165,8 @@ get_chirps.default <- function(object, dates, server, }) rr <- do.call(rbind, rr) - newnames <- paste0("chirps-v2.0.", gsub("-","\\.", result[[1]]$date)) + newnames <- + paste0("chirps-v2.0.", gsub("-", "\\.", result[[1]]$date)) result <- as.matrix(rr) @@ -187,8 +187,8 @@ get_chirps.default <- function(object, dates, server, if (isTRUE(as.raster)) { result <- terra::crop(rr, y = object) - return(result) - }else{ + return(result) + } else{ as.raster <- FALSE } @@ -196,7 +196,7 @@ get_chirps.default <- function(object, dates, server, result <- terra::extract(rr, y = object, ...) result$ID <- NULL return(result) - }else{ + } else{ as.matrix <- FALSE } @@ -205,11 +205,14 @@ get_chirps.default <- function(object, dates, server, result$ID <- NULL result <- c(t(result)) - result <- data.frame(id = as.integer(rep(rownames(object), each = span)), - lon = as.numeric(rep(object[,1], each = span)), - lat = as.numeric(rep(object[,2], each = span)), - date = rep(days, times = nrow(object)), - chirps = as.numeric(result)) + result <- + data.frame( + id = as.integer(rep(rownames(object), each = span)), + lon = as.numeric(rep(object[, 1], each = span)), + lat = as.numeric(rep(object[, 2], each = span)), + date = rep(days, times = nrow(object)), + chirps = as.numeric(result) + ) class(result) <- c("chirps", "chirps_df", class(result)) @@ -224,8 +227,11 @@ get_chirps.default <- function(object, dates, server, #' @rdname get_chirps #' @method get_chirps SpatVector #' @export -get_chirps.SpatVector <- function(object, dates, server = "CHC", - as.raster = TRUE, ...) { +get_chirps.SpatVector <- function(object, + dates, + server = "CHC", + as.raster = TRUE, + ...) { dots <- list(...) as.matrix <- dots[["as.matrix"]] @@ -251,29 +257,31 @@ get_chirps.SpatVector <- function(object, dates, server = "CHC", result$ID <- NULL result <- c(t(result)) - result <- data.frame(id = as.integer(rep(ids, each = span)), - lon = NA, - lat = NA, - date = rep(days, each = length(ids)), - chirps = as.numeric(result)) + result <- data.frame( + id = as.integer(rep(ids, each = span)), + lon = NA, + lat = NA, + date = rep(days, each = length(ids)), + chirps = as.numeric(result) + ) class(result) <- c("chirps", "chirps_df", class(result)) return(result) } - - } #' @rdname get_chirps #' @method get_chirps SpatRaster #' @export -get_chirps.SpatRaster <- function(object, dates, server = "CHC", - as.matrix = TRUE, as.raster = FALSE, ...) { - +get_chirps.SpatRaster <- function(object, + dates, + server = "CHC", + as.matrix = TRUE, + as.raster = FALSE, + ...) { UseMethod("get_chirps", object = "SpatVector") - } From 1cfb099d94e1b61aed5a3d372ea49b745f4bcc92 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 18 Apr 2022 15:01:48 +0800 Subject: [PATCH 64/93] Fix bug where gjson objects were not allowed --- R/get_imerg.R | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/R/get_imerg.R b/R/get_imerg.R index 0214a8d..3696a6f 100644 --- a/R/get_imerg.R +++ b/R/get_imerg.R @@ -207,30 +207,26 @@ get_imerg.sf <- function(object, dates, operation = 5, as.sf = FALSE, ...) { get_imerg.geojson <- function(object, dates, operation = 5, - as.geojson = FALSE, ...) { - - # check for the geometry tag - if (isFALSE(grepl("geometry", object[[1]]))) { - stop("geometry tag is missing in the geojson object with no default \n") - } + as.geojson = FALSE, + ...) { type <- c("type\":\"Point", "type\":\"Polygon") - # check for supported types + # check for supported types supp_type <- c(all(grepl(type[[1]], object)), all(grepl(type[[2]], object))) if (isFALSE(any(supp_type))) { - stop("The geojson geometry type is not supported. - Please provide a geojson of geometry type 'Point' or 'Polygon'\n") + stop( + "The geojson geometry type is not supported. + Please provide a geojson of geometry type 'Point' or 'Polygon'\n" + ) } # if type Point if (all(grepl(type[[1]], object))) { - # get matrix with lonlat to validate later - lonlat <- lapply(object, function (x) { - + lonlat <- lapply(object, function(x) { # read as sf x <- sf::read_sf(x) From 01998d5069d424fd0a6ef7fb652752fc0cdf0a6b Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 18 Apr 2022 15:01:55 +0800 Subject: [PATCH 65/93] Reformat code --- R/get_imerg.R | 249 ++++++++++++++++++++++++++------------------------ 1 file changed, 128 insertions(+), 121 deletions(-) diff --git a/R/get_imerg.R b/R/get_imerg.R index 3696a6f..a089cfc 100644 --- a/R/get_imerg.R +++ b/R/get_imerg.R @@ -1,17 +1,17 @@ #' Get Integrated Multisatellite Retrievals for GPM (IMERG) data -#' +#' #' The IMERG dataset provides near-real time global observations of rainfall at #' 10km resolution, which can be used to estimate total rainfall accumulation #' from storm systems and quantify the intensity of rainfall and flood impacts #' from tropical cyclones and other storm systems. \acronym{IMERG} is a daily #' precipitation dataset available from 2015 to present within the latitudes 70 #' and -70 degrees. -#' +#' #' @inheritParams get_chirps #' @param operation optional, an integer that represents which type of #' statistical operation to perform on the dataset #' @details -#' \bold{operation}: supported operations are: +#' \bold{operation}: supported operations are: #' \tabular{rll}{ #' \bold{operation} \tab \tab \bold{value}\cr #' max \tab = \tab 0\cr @@ -20,32 +20,31 @@ #' sum \tab = \tab 4\cr #' average \tab = \tab 5 (\emph{default value})\cr #' } -#' +#' #' \bold{dist}: numeric, buffer distance for each \code{object} coordinate -#' +#' #' \bold{nQuadSegs}: integer, number of segments per buffer quadrant -#' +#' #' @return A data frame of \acronym{imerg} data: #' \item{id}{the index for the rows in \code{object}} #' \item{dates}{the dates from which imerg was requested} #' \item{lon}{the longitude as provided in \code{object}} #' \item{lat}{the latitude as provided in \code{object}} #' \item{imerg}{the IMERG value} -#' +#' #' @examplesIf interactive() #' lonlat <- data.frame(lon = c(-55.0281,-54.9857), #' lat = c(-2.8094, -2.8756)) -#' +#' #' dates <- c("2017-12-15", "2017-12-31") -#' +#' #' dt <- get_imerg(lonlat, dates) -#' +#' #' dt #' #' @importFrom sf st_centroid read_sf st_geometry_type #' @export get_imerg <- function(object, dates, operation = 5, ...) { - UseMethod("get_imerg") } @@ -53,14 +52,14 @@ get_imerg <- function(object, dates, operation = 5, ...) { #' @rdname get_imerg #' @export get_imerg.default <- function(object, dates, operation = 5, ...) { - object <- as.data.frame(object) # validate lonlat to check if they are within the IMERG range lat -60, 60 .validate_lonlat(object, xlim = c(-180, 180), ylim = c(-70, 70)) # validate dates - dates_inter <- .reformat_dates(dates, availability = c("2015-01-01", "0")) + dates_inter <- + .reformat_dates(dates, availability = c("2015-01-01", "0")) # get geojson strings from data.frame gj <- as.geojson(object, ...) @@ -69,10 +68,12 @@ get_imerg.default <- function(object, dates, operation = 5, ...) { gj <- split(gj, seq_along(gj)) - result <- .GET(gjson = gj, - dates = dates_inter, - operation = operation, - datatype = 26) + result <- .GET( + gjson = gj, + dates = dates_inter, + operation = operation, + datatype = 26 + ) names(result)[names(result) == "value"] <- "imerg" @@ -95,111 +96,119 @@ get_imerg.default <- function(object, dates, operation = 5, ...) { #' @rdname get_imerg #' @method get_imerg sf #' @export -get_imerg.sf <- function(object, dates, operation = 5, as.sf = FALSE, ...) { - - # check geometry type - type <- c("POINT", "POLYGON") - - # check for supported types - supp_type <- c(all(grepl(type[[1]], sf::st_geometry_type(object))), - all(grepl(type[[2]], sf::st_geometry_type(object)))) - - if (isFALSE(any(supp_type))) { - stop("The sf geometry type is not supported. - Please provide a sf object of geometry type 'POINT' or 'POLYGON'\n") - } - - type <- type[which(supp_type)] - - nr <- dim(object)[[1]] - - # find the sf_column - index <- attr(object, "sf_column") - - # get the sf column - lonlat <- object[[index]] - - if (isTRUE(type == "POINT")) { - - # unlist the sf_column - lonlat <- unlist(object[[index]]) - - } - - if (isTRUE(type == "POLYGON")) { - - # set centroid to validade lonlat - lonlat <- sf::st_centroid(lonlat) - - # unlist the sf_column - lonlat <- unlist(lonlat) - - } - - lonlat <- matrix(lonlat, - nrow = nr, - ncol = 2, - byrow = TRUE, - dimnames = list(seq_len(nr), c("lon","lat"))) - - lonlat <- as.data.frame(lonlat) - - # validate lonlat to check if they are within the imerg range - .validate_lonlat(lonlat, xlim = c(-180, 180), ylim = c(-70, 70)) - - # validate and reformat dates - dates_inter <- .reformat_dates(dates, availability = c("2015-01-01", "0")) - - # get geojson strings from data.frame - gj <- as.geojson(object, ...) - - class(gj) <- "character" - - gj <- split(gj, seq_along(gj)) - - result <- .GET(gjson = gj, - dates = dates_inter, - operation = operation, - datatype = 26) - - if (isTRUE(as.sf)) { - - result$date <- as.integer(result$date) - result$date <- paste0("day_",result$date) +get_imerg.sf <- + function(object, + dates, + operation = 5, + as.sf = FALSE, + ...) { + # check geometry type + type <- c("POINT", "POLYGON") + + # check for supported types + supp_type <- + c(all(grepl(type[[1]], sf::st_geometry_type(object))), + all(grepl(type[[2]], sf::st_geometry_type(object)))) + + if (isFALSE(any(supp_type))) { + stop( + "The sf geometry type is not supported. + Please provide a sf object of geometry type 'POINT' or 'POLYGON'\n" + ) + } + + type <- type[which(supp_type)] + + nr <- dim(object)[[1]] + + # find the sf_column + index <- attr(object, "sf_column") + + # get the sf column + lonlat <- object[[index]] + + if (isTRUE(type == "POINT")) { + # unlist the sf_column + lonlat <- unlist(object[[index]]) + + } - result <- split(result, result$date) + if (isTRUE(type == "POLYGON")) { + # set centroid to validade lonlat + lonlat <- sf::st_centroid(lonlat) + + # unlist the sf_column + lonlat <- unlist(lonlat) + + } + + lonlat <- matrix( + lonlat, + nrow = nr, + ncol = 2, + byrow = TRUE, + dimnames = list(seq_len(nr), c("lon", "lat")) + ) - result <- lapply(result, function(x) { - x <- x[order(x$id), ] - x <- x[, "value"] - }) + lonlat <- as.data.frame(lonlat) - result <- do.call("cbind", result) + # validate lonlat to check if they are within the imerg range + .validate_lonlat(lonlat, xlim = c(-180, 180), ylim = c(-70, 70)) - result <- cbind(object, result) + # validate and reformat dates + dates_inter <- + .reformat_dates(dates, availability = c("2015-01-01", "0")) - } - - if (isFALSE(as.sf)) { + # get geojson strings from data.frame + gj <- as.geojson(object, ...) - lonlat$id <- rownames(lonlat) + class(gj) <- "character" - result <- merge(result, lonlat, by = "id") + gj <- split(gj, seq_along(gj)) - names(result)[3:5] <- c("imerg", "lon", "lat") + result <- .GET( + gjson = gj, + dates = dates_inter, + operation = operation, + datatype = 26 + ) - result <- result[, c("id", "lon", "lat", "date", "imerg")] + if (isTRUE(as.sf)) { + result$date <- as.integer(result$date) + result$date <- paste0("day_", result$date) + + result <- split(result, result$date) + + result <- lapply(result, function(x) { + x <- x[order(x$id),] + x <- x[, "value"] + }) + + result <- do.call("cbind", result) + + result <- cbind(object, result) + + } - result <- as.data.frame(result, stringsAsFactors = FALSE) + if (isFALSE(as.sf)) { + lonlat$id <- rownames(lonlat) + + result <- merge(result, lonlat, by = "id") + + names(result)[3:5] <- c("imerg", "lon", "lat") + + result <- result[, c("id", "lon", "lat", "date", "imerg")] + + result <- as.data.frame(result, stringsAsFactors = FALSE) + + class(result) <- union(c("chirps_df", "chirps"), class(result)) + + + } - class(result) <- union(c("chirps_df", "chirps"), class(result)) - + return(result) } - - return(result) - -} #' @rdname get_imerg #' @method get_imerg geojson @@ -250,11 +259,9 @@ get_imerg.geojson <- function(object, # if Polygon if (all(grepl(type[[2]], object))) { - # take the centroid from geojson Polygons # to validate lonlat coordinates - lonlat <- lapply(object, function (x) { - + lonlat <- lapply(object, function(x) { x <- sf::read_sf(x) x <- sf::st_centroid(x$geometry) @@ -275,23 +282,24 @@ get_imerg.geojson <- function(object, .validate_lonlat(lonlat, xlim = c(-180, 180), ylim = c(-70, 70)) # validate dates - dates_inter <- .reformat_dates(dates, availability = c("2015-01-01", "0")) + dates_inter <- + .reformat_dates(dates, availability = c("2015-01-01", "0")) - result <- .GET(gjson = gjson, - dates = dates_inter, - operation = operation, - datatype = 26) + result <- .GET( + gjson = gjson, + dates = dates_inter, + operation = operation, + datatype = 26 + ) if (isTRUE(as.geojson)) { - result <- split(result, result$id) object <- split(object, seq_along(object)) # add geojson properties result <- mapply(function(X, Y) { - .add_geojson_properties(geometry = X, properties = Y, name = "imerg") @@ -304,7 +312,6 @@ get_imerg.geojson <- function(object, } if (isFALSE(as.geojson)) { - lonlat$id <- rownames(lonlat) result <- merge(result, lonlat, by = "id") @@ -316,7 +323,7 @@ get_imerg.geojson <- function(object, result <- as.data.frame(result, stringsAsFactors = FALSE) class(result) <- union(c("chirps_df", "chirps"), class(result)) - + } return(result) From 51f5d24572dd822e7c7531e146c1ed68496f789b Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 18 Apr 2022 15:02:43 +0800 Subject: [PATCH 66/93] Reformat code --- R/as.geojson.R | 64 ++++---- R/get_chirps.R | 171 ++++++++++---------- R/get_esi.R | 419 +++++++++++++++++++++++++------------------------ 3 files changed, 339 insertions(+), 315 deletions(-) diff --git a/R/as.geojson.R b/R/as.geojson.R index 182ede6..ec92a72 100644 --- a/R/as.geojson.R +++ b/R/as.geojson.R @@ -1,56 +1,57 @@ #' Methods to coerce geographical coordinates into a geojson polygon #' -#' Take single points from geographical coordinates and coerce into a -#' geojson of geometry 'Polygon' +#' Take single points from geographical coordinates and coerce into a geojson of +#' geometry 'Polygon' #' -#' @param lonlat a data.frame or matrix with geographical coordinates lonlat, in -#' that order, or an object of class 'sf' with geometry type 'POINT' or -#' 'POLYGON' +#' @param lonlat a \code{data.frame} or matrix with geographical coordinates +#' 'lonlat', in that order, or an object of class \code{\link[sf]{sf}} with +#' geometry type 'POINT' or 'POLYGON' #' @param dist numeric, buffer distance for all \code{lonlat} #' @param nQuadSegs integer, number of segments per quadrant #' @param ... further arguments passed to \code{\link[sf]{sf}} methods #' @return An object of class 'geosjon' for each row in \code{lonlat} #' @family utility functions -#' +#' #' @examplesIf interactive() #' # Default S3 Method #' # random geographic points within bbox(10, 12, 45, 47) #' library("sf") -#' +#' #' set.seed(123) #' lonlat <- data.frame(lon = runif(1, 10, 12), #' lat = runif(1, 45, 47)) -#' +#' #' gjson <- as.geojson(lonlat) -#' +#' #' ################# -#' +#' #' # S3 Method for objects of class 'sf' #' # random geographic points within bbox(10, 12, 45, 47) #' library("sf") -#' +#' #' set.seed(123) #' lonlat <- data.frame(lon = runif(5, 10, 12), #' lat = runif(5, 45, 47)) -#' +#' #' lonlat <- st_as_sf(lonlat, coords = c("lon","lat")) -#' +#' #' gjson <- as.geojson(lonlat) #' #' @importFrom sf st_point st_sfc st_buffer st_write st_as_sf #' @export -as.geojson <- function(lonlat, +as.geojson <- function(lonlat, dist = 0.00001, - nQuadSegs = 2L, ...) { + nQuadSegs = 2L, + ...) { UseMethod("as.geojson") } #' @rdname as.geojson -#' @export +#' @export as.geojson.default <- function(lonlat, dist = 0.00001, - nQuadSegs = 2L, ...){ - + nQuadSegs = 2L, + ...) { n <- dim(lonlat)[[1]] # lonlat into matrix @@ -87,7 +88,7 @@ as.geojson.default <- function(lonlat, gj <- gj[index] - # remove spaces and extra commas + # remove spaces and extra commas gj <- lapply(gj, function(x) { x <- strsplit(x, "},")[[1]][2] x <- gsub(" ", "", x) @@ -110,17 +111,21 @@ as.geojson.default <- function(lonlat, #' @export as.geojson.sf <- function(lonlat, dist = 0.00001, - nQuadSegs = 2L, ...){ + nQuadSegs = 2L, + ...) { # check geometry type type <- c("POINT", "POLYGON") - # check for supported types - supp_type <- c(all(grepl(type[[1]], sf::st_geometry_type(lonlat))), - all(grepl(type[[2]], sf::st_geometry_type(lonlat)))) + # check for supported types + supp_type <- + c(all(grepl(type[[1]], sf::st_geometry_type(lonlat))), + all(grepl(type[[2]], sf::st_geometry_type(lonlat)))) if (!any(supp_type)) { - stop("The sf geometry type is not supported. - Please provide a sf object of geometry type 'POINT' or 'POLYGON'\n") + stop( + "The sf geometry type is not supported. + Please provide a sf object of geometry type 'POINT' or 'POLYGON'\n" + ) } type <- type[which(supp_type)] @@ -131,15 +136,14 @@ as.geojson.sf <- function(lonlat, # set the buffer around the points lonlatb <- sf::st_buffer(lonlat, dist = dist, - nQuadSegs = nQuadSegs, + nQuadSegs = nQuadSegs, ...) # transform into a sf object - lonlatb <- sf::st_as_sf(lonlatb) + lonlatb <- sf::st_as_sf(lonlatb) } if (type == "POLYGON") { - lonlatb <- lonlat } @@ -157,7 +161,7 @@ as.geojson.sf <- function(lonlat, gj <- gj[index] - # remove spaces and extra commas + # remove spaces and extra commas gj <- lapply(gj, function(x) { x <- strsplit(x, "},")[[1]][2] x <- gsub(" ", "", x) @@ -172,5 +176,5 @@ as.geojson.sf <- function(lonlat, class(result) <- c("geojson", "json", class(result)) return(result) - + } diff --git a/R/get_chirps.R b/R/get_chirps.R index b2b2f73..cf71a66 100644 --- a/R/get_chirps.R +++ b/R/get_chirps.R @@ -101,7 +101,8 @@ #' @export get_chirps <- function(object, dates, server, ...) { if (isFALSE(any(server %in% c("CHC", "ClimateSERV")))) { - stop("Unknown server, please choose 'CHC' or 'ClimateSERV' \n") + stop("Unknown server, please choose 'CHC' or 'ClimateSERV'\n", + call. = FALSE) } UseMethod("get_chirps") @@ -289,22 +290,24 @@ get_chirps.SpatRaster <- function(object, #' @rdname get_chirps #' @method get_chirps sf #' @export -get_chirps.sf <- function(object, dates, server, - as.sf = FALSE, +get_chirps.sf <- function(object, dates, server, + as.sf = FALSE, ...) { - # check geometry type type <- c("POINT", "POLYGON") dots <- list(...) - # check for supported types - supp_type <- c(all(grepl(type[[1]], sf::st_geometry_type(object))), - all(grepl(type[[2]], sf::st_geometry_type(object)))) - + # check for supported types + supp_type <- + c(all(grepl(type[[1]], sf::st_geometry_type(object))), + all(grepl(type[[2]], sf::st_geometry_type(object)))) + if (!any(supp_type)) { - stop("The sf geometry type is not supported. - Please provide a sf object of geometry type 'POINT' or 'POLYGON'\n") + stop( + "The sf geometry type is not supported. + Please provide a sf object of geometry type 'POINT' or 'POLYGON'\n" + ) } type <- type[which(supp_type)] @@ -315,16 +318,14 @@ get_chirps.sf <- function(object, dates, server, index <- attr(object, "sf_column") if (type == "POINT") { - # get the sf column - lonlat <- object[[index]] + lonlat <- object[[index]] # unlist the sf_column lonlat <- unlist(object[[index]]) } if (type == "POLYGON") { - # set centroid to validade lonlat lonlat <- sf::st_centroid(object) @@ -335,11 +336,13 @@ get_chirps.sf <- function(object, dates, server, } - lonlat <- matrix(lonlat, - nrow = nr, - ncol = 2, - byrow = TRUE, - dimnames = list(seq_len(nr), c("lon","lat"))) + lonlat <- matrix( + lonlat, + nrow = nr, + ncol = 2, + byrow = TRUE, + dimnames = list(seq_len(nr), c("lon", "lat")) + ) lonlat <- as.data.frame(lonlat) @@ -348,7 +351,8 @@ get_chirps.sf <- function(object, dates, server, if (server == "ClimateSERV") { # validate and reformat dates - dates_inter <- .reformat_dates(dates, availability = c("1981-01-01", "0")) + dates_inter <- + .reformat_dates(dates, availability = c("1981-01-01", "0")) operation <- dots[["operation"]] if (is.null(operation)) { @@ -362,10 +366,12 @@ get_chirps.sf <- function(object, dates, server, gj <- split(gj, seq_along(gj)) - result <- .GET(gjson = gj, - dates = dates_inter, - operation = operation, - datatype = 0) + result <- .GET( + gjson = gj, + dates = dates_inter, + operation = operation, + datatype = 0 + ) lonlat$id <- rownames(lonlat) @@ -392,33 +398,35 @@ get_chirps.sf <- function(object, dates, server, result$ID <- NULL result <- c(t(result)) - result <- data.frame(id = as.integer(rep(rownames(lonlat), each = span)), - lon = as.numeric(rep(lonlat[,1], each = span)), - lat = as.numeric(rep(lonlat[,2], each = span)), - date = rep(days, each = nrow(lonlat)), - chirps = as.numeric(result)) + result <- + data.frame( + id = as.integer(rep(rownames(lonlat), each = span)), + lon = as.numeric(rep(lonlat[, 1], each = span)), + lat = as.numeric(rep(lonlat[, 2], each = span)), + date = rep(days, each = nrow(lonlat)), + chirps = as.numeric(result) + ) class(result) <- c("chirps", "chirps_df", class(result)) - + } if (isTRUE(as.sf)) { - result$date <- as.integer(result$date) - result$date <- paste0("day_",result$date) + result$date <- paste0("day_", result$date) result <- split(result, result$date) result <- lapply(result, function(x) { - x <- x[order(x$id), ] - x <- x[, "chirps"] + x <- x[order(x$id),] + x <- x[, "chirps"] }) result <- do.call("cbind", result) result <- cbind(object, result) - } + } return(result) @@ -427,43 +435,39 @@ get_chirps.sf <- function(object, dates, server, #' @rdname get_chirps #' @method get_chirps geojson #' @export -get_chirps.geojson <- function(object, dates, server, +get_chirps.geojson <- function(object, + dates, + server, as.geojson = FALSE, ...) { - - # check for the geometry tag - if (isFALSE(grepl("geometry", object[[1]]))) { - stop("geometry tag is missing in the geojson object\n") - } - dots <- list(...) type <- c("type\":\"Point", "type\":\"Polygon") - # check for supported types + # check for supported types supp_type <- c(all(grepl(type[[1]], object)), all(grepl(type[[2]], object))) if (isFALSE(any(supp_type))) { - stop("The geojson geometry type is not supported. - Please provide a geojson of geometry type 'Point' or 'Polygon'\n") + stop( + "The geojson geometry type is not supported. + Please provide a geojson of geometry type 'Point' or 'Polygon'\n" + ) } # if type Point if (all(grepl(type[[1]], object))) { - # get matrix with lonlat to validate later - lonlat <- lapply(object, function (x) { - + lonlat <- lapply(object, function(x) { # read as sf x <- sf::read_sf(x) # find the sf_column index <- attr(x, "sf_column") - + # unlist the sf_column x <- unlist(x[[index]]) - + }) # put all together @@ -475,11 +479,9 @@ get_chirps.geojson <- function(object, dates, server, # if Polygon if (all(grepl(type[[2]], object))) { - # take the centroid from geojson Polygons # to validate lonlat coordinates - lonlat <- lapply(object, function (x) { - + lonlat <- lapply(object, function(x) { x <- sf::read_sf(x) x <- sf::st_centroid(x$geometry) @@ -499,7 +501,8 @@ get_chirps.geojson <- function(object, dates, server, if (server == "ClimateSERV") { # validate and reformat dates - dates_inter <- .reformat_dates(dates, availability = c("1981-01-01", "0")) + dates_inter <- + .reformat_dates(dates, availability = c("1981-01-01", "0")) operation <- dots[["operation"]] if (is.null(operation)) { @@ -511,10 +514,12 @@ get_chirps.geojson <- function(object, dates, server, class(gj) <- "character" - result <- .GET(gjson = gj, - dates = dates_inter, - operation = operation, - datatype = 0) + result <- .GET( + gjson = gj, + dates = dates_inter, + operation = operation, + datatype = 0 + ) lonlat$id <- rownames(lonlat) @@ -541,11 +546,14 @@ get_chirps.geojson <- function(object, dates, server, result$ID <- NULL result <- c(t(result)) - result <- data.frame(id = as.integer(rep(rownames(lonlat), each = span)), - lon = as.numeric(rep(lonlat[,1], each = span)), - lat = as.numeric(rep(lonlat[,2], each = span)), - date = rep(days, each = nrow(lonlat)), - chirps = as.numeric(result)) + result <- + data.frame( + id = as.integer(rep(rownames(lonlat), each = span)), + lon = as.numeric(rep(lonlat[, 1], each = span)), + lat = as.numeric(rep(lonlat[, 2], each = span)), + date = rep(days, each = nrow(lonlat)), + chirps = as.numeric(result) + ) class(result) <- c("chirps", "chirps_df", class(result)) @@ -553,14 +561,12 @@ get_chirps.geojson <- function(object, dates, server, if (isTRUE(as.geojson)) { - result <- split(result, result$id) object <- split(object, seq_along(object)) # add geojson properties result <- mapply(function(X, Y) { - .add_geojson_properties(geometry = X, properties = Y, name = "chirps") @@ -580,16 +586,17 @@ get_chirps.geojson <- function(object, dates, server, #' @rdname get_chirps #' @method get_chirps SpatExtent #' @export -get_chirps.SpatExtent <- function(object, dates, server = "CHC", - as.raster = TRUE, ...) { - +get_chirps.SpatExtent <- function(object, + dates, + server = "CHC", + as.raster = TRUE, + ...) { # get CHIRTS GeoTiff files rr <- .get_CHIRPS_tiles_CHC(dates, ...) result <- terra::crop(rr, y = object) - + if (isFALSE(as.raster)) { - result <- as.matrix(result) } @@ -599,22 +606,24 @@ get_chirps.SpatExtent <- function(object, dates, server = "CHC", } #' @noRd -.get_CHIRPS_tiles_CHC <- function(dates, resolution = 0.05, +.get_CHIRPS_tiles_CHC <- function(dates, + resolution = 0.05, coverage = "global", interval = "daily", format = "cogs", - ...){ + ...) { message("Fetching data as GeoTIFF files from CHC server \n") # setup file names .validate_dates(dates) - seqdate <- seq.Date(as.Date(dates[1]), as.Date(dates[2]), by = "day") + seqdate <- + seq.Date(as.Date(dates[1]), as.Date(dates[2]), by = "day") years <- format(seqdate, format = "%Y") - dates <- gsub("-","\\.",seqdate) + dates <- gsub("-", "\\.", seqdate) fnames <- file.path(years, paste0("chirps-v2.0.", dates, ".cog")) # check for resolution - if(!missing("resolution")){ - if(!resolution %in% c(.05, .25)){ + if (!missing("resolution")) { + if (!resolution %in% c(.05, .25)) { stop("Resolution must be .05 deg or .25 deg") } } else { @@ -623,12 +632,14 @@ get_chirps.SpatExtent <- function(object, dates, server = "CHC", } resolution <- gsub("p0.", "p", paste0("p", resolution)) - u <- file.path("https://data.chc.ucsb.edu/products/CHIRPS-2.0", - paste0(coverage, "_", interval), format, resolution, fnames) + u <- file.path( + "https://data.chc.ucsb.edu/products/CHIRPS-2.0", + paste0(coverage, "_", interval), + format, + resolution, + fnames + ) u1 <- file.path("/vsicurl", u) r <- terra::rast(u1) return(r) } - - - diff --git a/R/get_esi.R b/R/get_esi.R index b12fff3..77e04d7 100644 --- a/R/get_esi.R +++ b/R/get_esi.R @@ -1,17 +1,17 @@ #' Get evaporative stress index (ESI) data -#' -#' Get evaporative stress index (\acronym{ESI}) from \acronym{SERVIR} Global -#' via ClimateSERV \acronym{API} Client. \acronym{ESI} is available every four -#' (or twelve) weeks from 2001 to present. +#' +#' Get evaporative stress index (\acronym{ESI}) from \acronym{SERVIR} Global via +#' ClimateSERV \acronym{API} Client. \acronym{ESI} is available every four +#' (or twelve) weeks from 2001 to present. #' The dataset may contain cloudy data which is returned as \code{NA}s. #' ClimateSERV works with 'geojson' of type 'Polygon'. The input \code{object} -#' is then transformed into polygons with a small buffer area around the point. -#' +#' is then transformed into polygons with a small buffer area around the point. +#' #' @inheritParams get_chirps #' @param period an integer value for the period of ESI data, four weeks #' period = 1, twelve weeks = 2 #' @param operation optional, an integer that represents which type of -#' statistical operation to perform on the dataset +#' statistical operation to perform on the dataset #' @details #' \bold{operation}: supported operations are: #' \tabular{rll}{ @@ -22,114 +22,129 @@ #' sum \tab = \tab 4\cr #' average \tab = \tab 5 (\emph{default value})\cr #' } -#' +#' #' \bold{dist}: numeric, buffer distance for each \code{object} coordinate -#' +#' #' \bold{nQuadSegs}: integer, number of segments per buffer quadrant -#' +#' #' @return A data frame of \acronym{ESI} data: #' \item{id}{the index for the rows in \code{object}} #' \item{dates}{the dates from which ESI was requested} #' \item{lon}{the longitude as provided in \code{object}} #' \item{lat}{the latitude as provided in \code{object}} #' \item{esi}{the ESI value} -#' -#' @note \code{get_esi()} may return some warning messages given by -#' \code{\link[sf]{sf}}, please check the \CRANpkg{sf} documentation for +#' +#' @note \code{get_esi()} may return some warning messages given by +#' \code{\link[sf]{sf}}, please check the \CRANpkg{sf} documentation for #' possible issues. -#' +#' #' @examplesIf interactive() -#' +#' #' lonlat <- data.frame(lon = c(-55.0281,-54.9857), #' lat = c(-2.8094, -2.8756)) -#' +#' #' dates <- c("2017-12-15","2018-06-20") -#' -#' # by default the function set a very small buffer around the points -#' # which can return NAs due to cloudiness in ESI data -#' +#' +#' # by default the function sets a very small buffer around the points which +#' # can return NAs due to cloudiness in ESI data +#' #' dt <- get_esi(lonlat, dates = dates) -#' +#' #' # the argument dist passed through sf increase the buffer area -#' +#' #' dt <- get_esi(lonlat, dates = dates, dist = 0.1) #' #' @importFrom sf st_centroid read_sf st_geometry_type #' @export -get_esi <- function(object, dates, operation = 5, period = 1, +get_esi <- function(object, + dates, + operation = 5, + period = 1, ...) { - UseMethod("get_esi") } #' @rdname get_esi #' @export -get_esi.default <- function(object, dates, operation = 5, period = 1, - ...) { - - object <- as.data.frame(object) - - # validate lonlat to check if they are within the CHIRPS range lat -50, 50 - .validate_lonlat(object, xlim = c(-180, 180), ylim = c(-50, 50)) - - # validate dates - dates_inter <- .reformat_dates(dates, availability = c("2001-01-01", "0")) - - # get geojson strings from data.frame - gj <- as.geojson(object, ...) - - class(gj) <- "character" - - gj <- split(gj, seq_along(gj)) - - if (period == 1) { - datatype <- 29 - } - if (period == 2) { - datatype <- 33 +get_esi.default <- + function(object, + dates, + operation = 5, + period = 1, + ...) { + object <- as.data.frame(object) + + # validate lonlat to check if they are within the CHIRPS range lat -50, 50 + .validate_lonlat(object, xlim = c(-180, 180), ylim = c(-50, 50)) + + # validate dates + dates_inter <- + .reformat_dates(dates, availability = c("2001-01-01", "0")) + + # get geojson strings from data.frame + gj <- as.geojson(object, ...) + + class(gj) <- "character" + + gj <- split(gj, seq_along(gj)) + + if (period == 1) { + datatype <- 29 + } + if (period == 2) { + datatype <- 33 + } + + result <- .GET( + gjson = gj, + dates = dates_inter, + operation = operation, + datatype = datatype + ) + + names(result)[names(result) == "value"] <- "esi" + + object$id <- rownames(object) + + result <- merge(result, object, by = "id", all.y = TRUE) + + names(result)[3:5] <- c("esi", "lon", "lat") + + result <- result[, c("id", "lon", "lat", "date", "esi")] + + result <- as.data.frame(result, stringsAsFactors = FALSE) + + class(result) <- c("chirps_df", class(result)) + + return(result) + } - - result <- .GET(gjson = gj, - dates = dates_inter, - operation = operation, - datatype = datatype) - - names(result)[names(result) == "value"] <- "esi" - - object$id <- rownames(object) - - result <- merge(result, object, by = "id", all.y = TRUE) - - names(result)[3:5] <- c("esi", "lon", "lat") - - result <- result[, c("id", "lon", "lat", "date", "esi")] - - result <- as.data.frame(result, stringsAsFactors = FALSE) - - class(result) <- c("chirps_df", class(result)) - - return(result) - -} #' @rdname get_esi #' @method get_esi sf #' @export -get_esi.sf <- function(object, dates, operation = 5, period = 1, +get_esi.sf <- function(object, + dates, + operation = 5, + period = 1, as.sf = FALSE, ...) { - + # check geometry type type <- c("POINT", "POLYGON") - # check for supported types - supp_type <- c(all(grepl(type[[1]], sf::st_geometry_type(object))), - all(grepl(type[[2]], sf::st_geometry_type(object)))) + # check for supported types + supp_type <- + c(all(grepl(type[[1]], sf::st_geometry_type(object))), + all(grepl(type[[2]], sf::st_geometry_type(object)))) if (isFALSE(any(supp_type))) { - stop("The sf geometry type is not supported. - Please provide a sf object of geometry type 'POINT' or 'POLYGON'\n") + stop( + "The `sf` geometry type is not supported. + Please provide an `sf` object of geometry type 'POINT' or 'POLYGON'\n", + call. = FALSE + ) } type <- type[which(supp_type)] @@ -143,14 +158,12 @@ get_esi.sf <- function(object, dates, operation = 5, period = 1, lonlat <- object[[index]] if (isTRUE(type == "POINT")) { - # unlist the sf_column lonlat <- unlist(object[[index]]) } if (isTRUE(type == "POLYGON")) { - # set centroid to validade lonlat lonlat <- sf::st_centroid(lonlat) @@ -159,11 +172,13 @@ get_esi.sf <- function(object, dates, operation = 5, period = 1, } - lonlat <- matrix(lonlat, - nrow = nr, - ncol = 2, - byrow = TRUE, - dimnames = list(seq_len(nr), c("lon","lat"))) + lonlat <- matrix( + lonlat, + nrow = nr, + ncol = 2, + byrow = TRUE, + dimnames = list(seq_len(nr), c("lon", "lat")) + ) lonlat <- as.data.frame(lonlat) @@ -189,21 +204,22 @@ get_esi.sf <- function(object, dates, operation = 5, period = 1, datatype <- 33 } - result <- .GET(gjson = gj, - dates = dates_inter, - operation = operation, - datatype = datatype) + result <- .GET( + gjson = gj, + dates = dates_inter, + operation = operation, + datatype = datatype + ) if (isTRUE(as.sf)) { - result$date <- as.integer(result$date) - result$date <- paste0("day_",result$date) + result$date <- paste0("day_", result$date) result <- split(result, result$date) result <- lapply(result, function(x) { - x <- x[order(x$id), ] - x <- x[, "value"] + x <- x[order(x$id),] + x <- x[, "value"] }) result <- do.call("cbind", result) @@ -213,7 +229,6 @@ get_esi.sf <- function(object, dates, operation = 5, period = 1, } if (isFALSE(as.sf)) { - lonlat$id <- rownames(lonlat) result <- merge(result, lonlat, by = "id") @@ -225,142 +240,136 @@ get_esi.sf <- function(object, dates, operation = 5, period = 1, result <- as.data.frame(result, stringsAsFactors = FALSE) class(result) <- c("chirps_df", class(result)) - - } return(result) - } #' @rdname get_esi #' @method get_esi geojson #' @export -get_esi.geojson <- function(object, dates, operation = 5, period = 1, - as.geojson = FALSE, - ...) { - - # check for the geometry tag - if (isFALSE(grepl("geometry", object[[1]]))) { - stop("geometry tag is missing in the geojson object with no default \n") - } - - type <- c("type\":\"Point", "type\":\"Polygon") - - # check for supported types - supp_type <- c(all(grepl(type[[1]], object)), - all(grepl(type[[2]], object))) - - if (isFALSE(any(supp_type))) { - stop("The geojson geometry type is not supported. - Please provide a geojson of geometry type 'Point' or 'Polygon'\n") - } - - # if type Point - if (all(grepl(type[[1]], object))) { - - # get matrix with lonlat to validate later - lonlat <- lapply(object, function(x) { +get_esi.geojson <- + function(object, + dates, + operation = 5, + period = 1, + as.geojson = FALSE, + ...) { + + type <- c("type\":\"Point", "type\":\"Polygon") + + # check for supported types + supp_type <- c(all(grepl(type[[1]], object)), + all(grepl(type[[2]], object))) + + if (isFALSE(any(supp_type))) { + stop( + "The geojson geometry type is not supported. + Please provide a geojson of geometry type 'Point' or 'Polygon'\n" + ) + } + + # if type Point + if (all(grepl(type[[1]], object))) { + # get matrix with lonlat to validate later + lonlat <- lapply(object, function(x) { + # read as sf + x <- sf::read_sf(x) + + # find the sf_column + index <- attr(x, "sf_column") + + # unlist the sf_column + x <- unlist(x[[index]]) + + }) - # read as sf - x <- sf::read_sf(x) + # put all together + lonlat <- do.call("rbind", lonlat) - # find the sf_column - index <- attr(x, "sf_column") + lonlat <- as.data.frame(lonlat) - # unlist the sf_column - x <- unlist(x[[index]]) + # lonlat into a geojson Polygon + gjson <- as.geojson(lonlat, ...) - }) - - # put all together - lonlat <- do.call("rbind", lonlat) - - lonlat <- as.data.frame(lonlat) - - # lonlat into a geojson Polygon - gjson <- as.geojson(lonlat, ...) - - } - - # if Polygon - if (all(grepl(type[[2]], object))) { - - # take the centroid from geojson Polygons - # to validate lonlat coordinates - lonlat <- lapply(object, function(x) { + } + + # if Polygon + if (all(grepl(type[[2]], object))) { + # take the centroid from geojson Polygons + # to validate lonlat coordinates + lonlat <- lapply(object, function(x) { + x <- sf::read_sf(x) + + x <- sf::st_centroid(x$geometry) + + x <- unlist(x) + }) - x <- sf::read_sf(x) + # put all together + lonlat <- do.call("rbind", lonlat) - x <- sf::st_centroid(x$geometry) + lonlat <- as.data.frame(lonlat) - x <- unlist(x) - }) - - # put all together - lonlat <- do.call("rbind", lonlat) + gjson <- split(object, seq_along(object)) + + } - lonlat <- as.data.frame(lonlat) + # validate lonlat to check if they are within the CHIRPS range lat -50, 50 + .validate_lonlat(lonlat, xlim = c(-180, 180), ylim = c(-50, 50)) - gjson <- split(object, seq_along(object)) + # validate dates + dates_inter <- + .reformat_dates(dates, availability = c("2001-01-01", "0")) - } - - # validate lonlat to check if they are within the CHIRPS range lat -50, 50 - .validate_lonlat(lonlat, xlim = c(-180, 180), ylim = c(-50, 50)) - - # validate dates - dates_inter <- .reformat_dates(dates, availability = c("2001-01-01", "0")) - - if (period == 1) { - datatype <- 29 - } - if (period == 2) { - datatype <- 33 - } - - result <- .GET(gjson = gjson, - dates = dates_inter, - operation = operation, - datatype = datatype) - - - if (isTRUE(as.geojson)) { + if (period == 1) { + datatype <- 29 + } + if (period == 2) { + datatype <- 33 + } - result <- split(result, result$id) + result <- .GET( + gjson = gjson, + dates = dates_inter, + operation = operation, + datatype = datatype + ) - object <- split(object, seq_along(object)) - # add geojson properties - result <- mapply(function(X, Y) { + if (isTRUE(as.geojson)) { + result <- split(result, result$id) - .add_geojson_properties(geometry = X, - properties = Y, - name = "esi") + object <- split(object, seq_along(object)) - }, X = object, Y = result[]) - - class(result) <- c("geojson", "json", class(result)) - - - } - - if (isFALSE(as.geojson)) { - - lonlat$id <- rownames(lonlat) - - result <- merge(result, lonlat, by = "id") - - names(result)[3:5] <- c("esi", "lon", "lat") + # add geojson properties + result <- mapply(function(X, Y) { + .add_geojson_properties(geometry = X, + properties = Y, + name = "esi") + + }, X = object, Y = result[]) + + class(result) <- c("geojson", "json", class(result)) + + + } - result <- result[, c("id", "lon", "lat", "date", "esi")] + if (isFALSE(as.geojson)) { + lonlat$id <- rownames(lonlat) + + result <- merge(result, lonlat, by = "id") + + names(result)[3:5] <- c("esi", "lon", "lat") + + result <- result[, c("id", "lon", "lat", "date", "esi")] + + result <- as.data.frame(result, stringsAsFactors = FALSE) + + class(result) <- c("chirps_df", class(result)) + + } - result <- as.data.frame(result, stringsAsFactors = FALSE) + return(result) - class(result) <- c("chirps_df", class(result)) - } - - return(result) - -} From d3c3915f5e446f2bb978bc2868089b914957d602 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 18 Apr 2022 15:03:02 +0800 Subject: [PATCH 67/93] Improved tests for get_chirts() --- tests/testthat/test-get_chirts.R | 41 ++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/tests/testthat/test-get_chirts.R b/tests/testthat/test-get_chirts.R index a4d7b23..4175041 100644 --- a/tests/testthat/test-get_chirts.R +++ b/tests/testthat/test-get_chirts.R @@ -1,14 +1,35 @@ -# test_data.rda contains lat/lon and date values for the following tests -load(test_path("test_data.rda")) +# setup values for testing all +lonlat <- + structure(list( + lon = c(-60.03947, -54.7838828), + lat = c(-3.031387, + -2.4221716) + ), + class = "data.frame", + row.names = c(NA, -2L)) +dates <- c("2000-01-01", "2000-01-05") +chirts_values <- + c( + 29.4855480194092, + 29.5689563751221, + 29.5717449188232, + 32.0975608825684, + 29.1689014434814, + 29.5432586669922, + 29.4775066375732, + 28.201681137085, + 29.9562358856201, + 30.5279235839844 + ) # Test get_chirts() default method ----- test_that("get_chirts() returns proper values", { - x <- get_chirts(object = lonlat, - dates = dates, - var = "Tmax") - - expect_named(x, c("id", "lon", "lat", "date", "chirts")) - expect_equal(nrow(x), 10) - expect_s3_class(x, c("chirts", "chirts_df", "data.frame")) -}) + x <- get_chirts(object = lonlat, + dates = dates, + var = "Tmax") + expect_equal(x$chirts, chirts_values, tolerance = 0.01) + expect_named(x, c("id", "lon", "lat", "date", "chirts")) + expect_equal(nrow(x), 10) + expect_s3_class(x, c("chirts", "chirts_df", "data.frame")) + }) From d802f1da7bb7a3ac2e0a8c6db588c6f4c09bb5aa Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 18 Apr 2022 15:03:17 +0800 Subject: [PATCH 68/93] improved tests for get_esi() --- tests/testthat/test-get_esi.R | 53 ++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/tests/testthat/test-get_esi.R b/tests/testthat/test-get_esi.R index 7259cc4..68e5269 100644 --- a/tests/testthat/test-get_esi.R +++ b/tests/testthat/test-get_esi.R @@ -1,53 +1,60 @@ -# test_data.rda contains lat/lon and date values for the following tests -load(test_path("test_data.rda")) +# setup for tests +esi_lonlat <- data.frame(lon = c(-55.0281, -54.9857), + lat = c(-2.8094, -2.8756)) +esi_dates <- c("2017-12-15", "2018-06-20") +esi_values <- c(NA, NA, 0.85, 0.54) # Test get_esi() ----- test_that("get_esi() returns proper values", { - x <- get_esi(lonlat, dates = c("2002-01-01", "2002-01-31")) + x <- get_esi(esi_lonlat, esi_dates) expect_named(x, c("id", "lon", "lat", "date", "esi")) expect_equal(nrow(x), 4) expect_s3_class(x, c("chirps_df", "data.frame")) + expect_equal(x$esi, esi_values, tolerance = 0.01) }) # Test sf data frame method ----- -coords <- st_as_sf(lonlat, coords = c("lon", "lat")) -test_that("get_esi() sf method return df", { - y <- get_esi(coords, dates = c("2002-01-01", "2002-01-31")) +coords <- sf::st_as_sf(esi_lonlat, coords = c("lon", "lat")) + +test_that("get_esi() sf method return_df", { + y <- get_esi(coords, esi_dates) expect_named(y, c("id", "lon", "lat", "date", "esi")) - expect_equal(nrow(y), 3) + expect_equal(nrow(y), 4) expect_s3_class(y, c("chirps_df", "data.frame")) + expect_equal(y$esi, esi_values, tolerance = 0.01) }) + # Test sf `sf` method ----- -test_that("get_esi() sf method return sf", { - y <- get_esi(coords, - dates = c("2002-01-01", "2002-01-31"), - as.sf = TRUE) - expect_named(y, c("day_11688", "day_11696", "day_11704", "geometry")) +test_that("get_esi() sf method return sf when 'sf' == TRUE", { + y <- get_esi(coords, + esi_dates, + as.sf = TRUE) + expect_named(y, c("day_17518", "day_17525", "geometry")) expect_equal(nrow(y), 2) expect_s3_class(y, c("sf", "data.frame")) }) + # Test geojson data frame method ----- -geojson <- as.geojson(lonlat) +gjson <- as.geojson(esi_lonlat) + test_that("get_esi() geojson method return df", { - z <- - suppressWarnings(get_esi(geojson, - dates = c("2002-01-01", "2002-01-31"))) + z <- + get_esi(gjson, + dates = c("2002-01-01", "2002-01-31")) expect_named(z, c("id", "lon", "lat", "date", "esi")) - expect_equal(nrow(z), 3) + expect_equal(nrow(z), 10) expect_s3_class(z, c("chirps_df", "data.frame")) }) # Test geojson `geojson` method ----- test_that("get_esi() geojson method return geojson", { - z <- - suppressWarnings(get_esi( - geojson, - dates = c("2002-01-01", "2002-01-31"), - as.geojson = TRUE - )) + z <- + get_esi(gjson, + dates = c("2002-01-01", "2002-01-31"), + as.geojson = TRUE) expect_named(z, c("1", "2")) expect_equal(length(z), 2) expect_s3_class(z, c("geojson", "json", "character")) From 5628f2fe10041cdf54b9ceee26170586929e5b99 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 18 Apr 2022 15:03:26 +0800 Subject: [PATCH 69/93] add tests for get_imerg() --- tests/testthat/test-get_imerg.R | 79 +++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 tests/testthat/test-get_imerg.R diff --git a/tests/testthat/test-get_imerg.R b/tests/testthat/test-get_imerg.R new file mode 100644 index 0000000..70c4a2b --- /dev/null +++ b/tests/testthat/test-get_imerg.R @@ -0,0 +1,79 @@ + +# setup for tests, expected values for all + +imerg_lonlat <- data.frame(lon = c(-55.0281, -54.9857), + lat = c(-2.8094, -2.8756)) +imerg_dates <- c("2017-12-15", "2017-12-31") +imerg_values <- + c( + 3.70000004768372, + 0.699999988079071, + 29.2000007629395, + 12.6999998092651, + 20.6000003814697, + 1, + 0.600000023841858, + 0.900000035762787, + 2.10000014305115, + 3.90000009536743, + 3, + 8.60000038146973, + 88.0999984741211, + 14, + 0.300000011920929, + 16.7000007629395, + 11.4000005722046, + 2.60000014305115, + 0.5, + 32.5, + 7.5, + 18.2000007629395, + 0.900000035762787, + 0.300000011920929, + 0.5, + 3, + 2.5, + 2.70000004768372, + 11.4000005722046, + 74.5, + 17.3999996185303, + 0.300000011920929, + 15.4000005722046, + 8.40000057220459 + ) +imerg_names <- c("id", "lon", "lat", "date", "imerg") + +# Test get_imerg() default method ----- +test_that("get_imerg() returns proper values", + { + x_df <- get_imerg(imerg_lonlat, + dates = imerg_dates, + server = "ClimateSERV") + expect_equal(x_df$imerg, imerg_values, tolerance = 0.01) + expect_named(x_df, imerg_names) + expect_equal(nrow(x_df), 34) + expect_s3_class(x_df, "chirps_df") + }) + + +# Test get_imerg() 'sf' return data frame method ----- +test_that("get_imerg() sf method return df", { + library("sf") + coords <- st_as_sf(imerg_lonlat, coords = c("lon", "lat")) + x_sf <- get_imerg(object = coords, + dates = imerg_dates, + server = "ClimateSERV") + expect_equal(x_sf$imerg, imerg_values, tolerance = 0.01) + expect_named(x_sf, imerg_names) + expect_equal(nrow(x_sf), 34) + expect_s3_class(x_sf, "chirps_df") +}) + +# get chirps with geojson method +test_that("geojson method", { + gjson <- as.geojson(imerg_lonlat) + x_gjson <- get_imerg(gjson, + imerg_dates, + server = "ClimateSERV") + expect_equal(x_gjson$imerg, imerg_values, tolerance = 0.01) +}) From e706dcd632201ac396bf860d44bdd88b5cc9a13d Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 18 Apr 2022 15:03:40 +0800 Subject: [PATCH 70/93] Remove test_data.rda, too hard to keep in sync --- tests/testthat/test_data.rda | Bin 976 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tests/testthat/test_data.rda diff --git a/tests/testthat/test_data.rda b/tests/testthat/test_data.rda deleted file mode 100644 index c75560b436a2cd445e05e02537755f631c21af51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 976 zcmV;>126m^iwFP!000001MOEqkJ?5Qp0&+pAxc%Lf57r7kqiPGcA+OWi{qdYK)^P% z2yGpE3|5SX*xu}tQ%?N}z4XuYl4~#R59n{`A%`47X0XS`#*{=+bIOR}%{)JU^XAQa zZ=MIOv0NAz001oDj#$9v@DSuKM~{ki05}FujsOSpnCA7lj7;a=DX z?RF-ke?#Q|=;rSIJo)XxLHdL7qw?#&e;%R{?nzVq>+kz_4^sA*-(SBo^+OczbA#J_ zW4Oc(2r z_Bt2cl&EgR+ZbZP^?Lm_Fixh6delWZ@X0Rve;#>cmM?h98#@%jeKApJg`u$LxR~)z z)GzwIc6UUN-ZN)`wqMac3ymhQDA9aH`;ushq;bc&f{UfU0zs-c3c@CtSC%f+EziO^ zFo@HmIKC2stnPYY$T1)p>UpIcwC<5uU0;zFrl?0*_nke02E) z^N?#Byb6&4eM{$uE6;}uzS4-~NK-nUc7NDww_=P_`K(@%&qS$FFG;mCNs?=)a{LBq z9i^*|9$$9bqlvJ9z6%AhGM!EXq5h!#M8WH;E`-jFrOySi9KU|vRXa-XrU7SI1V1g6 zD`(Z3EH$KBrO~L$GKIPrPM~dDOAlFwW{c8v3uoNM`<~I=;hV+suMNoG?`Zx5L3EJo z&yz~`1}$YUsZ5jHPtqrAVdTu{%E-YhL(TKE7M4C|;mhHMNBcF>k_{p-Y1B} z{if5vX;~UJ3=I~`SzgntoxOSP@42)BC*O%9?%6YR8%8RZ&X?Jd8>zrijN64p>kMwS zHNIVFw=o}&_uQv}4pcWLy~Vs|>Q||ppvUq%`oslLR;d%rPOuk|@L2^I+!|~ZDqwT> zCX Date: Mon, 18 Apr 2022 15:03:55 +0800 Subject: [PATCH 71/93] improved tests for precip_indices() --- tests/testthat/test-precip_indices.R | 76 ++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 5 deletions(-) diff --git a/tests/testthat/test-precip_indices.R b/tests/testthat/test-precip_indices.R index e6b4a1e..c705c60 100644 --- a/tests/testthat/test-precip_indices.R +++ b/tests/testthat/test-precip_indices.R @@ -1,6 +1,74 @@ -# test_data.rda contains lat/lon and date values for the following tests -load(test_path("test_data.rda")) +# setup values for testing all +lonlat <- + structure(list( + lon = c(-60.03947, -54.7838828), + lat = c(-3.031387, + -2.4221716) + ), + class = "data.frame", + row.names = c(NA, -2L)) +dates <- c("2000-01-01", "2000-01-05") +chirps_df <- + structure( + list( + id = c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L), + lon = c( + -60.03947, + -60.03947, + -60.03947, + -60.03947, + -60.03947, + -54.7838828, + -54.7838828, + -54.7838828, + -54.7838828, + -54.7838828 + ), + lat = c( + -3.031387, + -3.031387, + -3.031387, + -3.031387, + -3.031387, + -2.4221716, + -2.4221716, + -2.4221716, + -2.4221716, + -2.4221716 + ), + date = structure( + c( + 10957, + 10958, + 10959, + 10960, + 10961, + 10957, + 10958, + 10959, + 10960, + 10961 + ), + class = "Date" + ), + chirps = c( + 0, + 0, + 0, + 0, + 20.1769542694092, + 38.3542251586914, + 0, + 38.3542251586914, + 0, + 0 + ) + ), + class = c("chirps", "chirps_df", "data.frame"), + row.names = c(NA, + -10L) + ) # Test the default behaviour values <- @@ -89,7 +157,6 @@ values3 <- ) test_that("accepts NAs", { - chirps_df[c(2, 7), "chirps"] <- NA p <- precip_indices(chirps_df) expect_equal(p$value, values3, tolerance = 0.001) @@ -97,7 +164,6 @@ test_that("accepts NAs", { # Get an error with non chirps data test_that("non chirps data", { - expect_error(precip_indices(object = airquality)) - + }) From 194139beb5d2a651e18d0b69173f03c328578667 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 18 Apr 2022 15:04:07 +0800 Subject: [PATCH 72/93] Add .covrignore file --- .Rbuildignore | 2 ++ .covrignore | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 .covrignore diff --git a/.Rbuildignore b/.Rbuildignore index ed96c47..143c2cc 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -22,3 +22,5 @@ ^\.ccache$ ^\.github$ ^tic\.R$ +^.coverignore$ + diff --git a/.covrignore b/.covrignore new file mode 100644 index 0000000..a23edf9 --- /dev/null +++ b/.covrignore @@ -0,0 +1,2 @@ +^R/print\.R$ + From 0e5e2af246296de5d974b1f250c9007db620c7e9 Mon Sep 17 00:00:00 2001 From: Adam Sparks Date: Mon, 18 Apr 2022 15:04:22 +0800 Subject: [PATCH 73/93] redoc package --- man/as.geojson.Rd | 16 ++++++++-------- man/get_chirps.Rd | 16 ++++++++-------- man/get_esi.Rd | 6 +++--- man/get_imerg.Rd | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/man/as.geojson.Rd b/man/as.geojson.Rd index 23f1dd1..d7d4555 100644 --- a/man/as.geojson.Rd +++ b/man/as.geojson.Rd @@ -6,16 +6,16 @@ \alias{as.geojson.sf} \title{Methods to coerce geographical coordinates into a geojson polygon} \usage{ -as.geojson(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) +as.geojson(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) -\method{as.geojson}{default}(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) +\method{as.geojson}{default}(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) -\method{as.geojson}{sf}(lonlat, dist = 1e-05, nQuadSegs = 2L, ...) +\method{as.geojson}{sf}(lonlat, dist = 0.00001, nQuadSegs = 2L, ...) } \arguments{ -\item{lonlat}{a data.frame or matrix with geographical coordinates lonlat, in -that order, or an object of class 'sf' with geometry type 'POINT' or -'POLYGON'} +\item{lonlat}{a \code{data.frame} or matrix with geographical coordinates +'lonlat', in that order, or an object of class \code{\link[sf]{sf}} with +geometry type 'POINT' or 'POLYGON'} \item{dist}{numeric, buffer distance for all \code{lonlat}} @@ -27,8 +27,8 @@ that order, or an object of class 'sf' with geometry type 'POINT' or An object of class 'geosjon' for each row in \code{lonlat} } \description{ -Take single points from geographical coordinates and coerce into a -geojson of geometry 'Polygon' +Take single points from geographical coordinates and coerce into a geojson of + geometry 'Polygon' } \examples{ \dontshow{if (interactive()) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} diff --git a/man/get_chirps.Rd b/man/get_chirps.Rd index a16e678..9440e3a 100644 --- a/man/get_chirps.Rd +++ b/man/get_chirps.Rd @@ -40,10 +40,10 @@ any other object that can be coerced to \code{data.frame}), \item{dates}{a character of start and end dates in that order in the format "YYYY-MM-DD"} -\item{server}{a character that represent the server source "CHC" or +\item{server}{a character that represents the server source "CHC" or "ClimateSERV"} -\item{...}{additional arguments passed to \code{\link[terra]{terra}} +\item{...}{additional arguments passed to \code{\link[terra]{terra}} or \code{\link[sf]{sf}} methods See details} @@ -67,13 +67,13 @@ A matrix, raster or a data frame of \acronym{CHIRPS} data: } } \description{ -Get daily precipitation data from the "Climate Hazards Group". Two server - sources are available. The first, "CHC" (default) is recommended for - multiple data-points, while "ClimateSERV" is recommended when - few data-points are required (~ 50). +Get daily precipitation data from the "Climate Hazards Group". Two server + sources are available. The first, "CHC" (default) is recommended for + multiple data-points, while "ClimateSERV" is recommended when few + data-points are required (~ 50). } \details{ -Data description at +Data description at \url{https://data.chc.ucsb.edu/products/CHIRPS-2.0/README-CHIRPS.txt} \strong{Additional arguments when using server = "CHC"} @@ -98,7 +98,7 @@ Data description at } } \note{ -\code{get_chirps()} may return some warning messages given by +\code{get_chirps()} may return some warning messages given by \code{\link[sf]{sf}}, please look \CRANpkg{sf} documentation for possible issues. } diff --git a/man/get_esi.Rd b/man/get_esi.Rd index 34a177b..112a33c 100644 --- a/man/get_esi.Rd +++ b/man/get_esi.Rd @@ -30,7 +30,7 @@ statistical operation to perform on the dataset} \item{period}{an integer value for the period of ESI data, four weeks period = 1, twelve weeks = 2} -\item{...}{additional arguments passed to \code{\link[terra]{terra}} +\item{...}{additional arguments passed to \code{\link[terra]{terra}} or \code{\link[sf]{sf}} methods See details} @@ -70,8 +70,8 @@ ClimateSERV works with 'geojson' of type 'Polygon'. The input \code{object} \bold{nQuadSegs}: integer, number of segments per buffer quadrant } \note{ -\code{get_esi()} may return some warning messages given by -\code{\link[sf]{sf}}, please check the \CRANpkg{sf} documentation for +\code{get_esi()} may return some warning messages given by +\code{\link[sf]{sf}}, please check the \CRANpkg{sf} documentation for possible issues. } \examples{ diff --git a/man/get_imerg.Rd b/man/get_imerg.Rd index 70368f2..6a5fa91 100644 --- a/man/get_imerg.Rd +++ b/man/get_imerg.Rd @@ -27,7 +27,7 @@ any other object that can be coerced to \code{data.frame}), \item{operation}{optional, an integer that represents which type of statistical operation to perform on the dataset} -\item{...}{additional arguments passed to \code{\link[terra]{terra}} +\item{...}{additional arguments passed to \code{\link[terra]{terra}} or \code{\link[sf]{sf}} methods See details} From 41738e2c8530512548e32b5e382a3158a60cddef Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 21 Jan 2023 11:09:42 +0800 Subject: [PATCH 74/93] address Issue #46 fixes incorrect conditions when checking dates for `present` --- R/internal_functions.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/internal_functions.R b/R/internal_functions.R index 586393e..8f0208a 100644 --- a/R/internal_functions.R +++ b/R/internal_functions.R @@ -337,7 +337,7 @@ cond2 <- xmin >= past # no later then present date - cond3 <- xmax < present + cond3 <- xmax <= present if (!all(cond1, cond2, cond3)) { stop( From 7081321e9430fd929bcf7d440b9ead65832a29cd Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 10:02:55 +0800 Subject: [PATCH 75/93] ignore files --- .Rbuildignore | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 143c2cc..8d8b492 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -22,5 +22,6 @@ ^\.ccache$ ^\.github$ ^tic\.R$ -^.coverignore$ - +^\.covrignore$ +^package-lock\.json$ +^LICENSE\.md$ \ No newline at end of file From a5d2bf29bcc7673e4088a6b0e008ddee401794db Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 10:03:15 +0800 Subject: [PATCH 76/93] normalise DESCRIPTION file --- DESCRIPTION | 67 ++++++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4c1b79e..65b92c2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,38 +1,38 @@ -Package: chirps Type: Package +Package: chirps Title: API Client for CHIRPS and CHIRTS Version: 0.1.5 -Authors@R: c(person("Kauê", "de Sousa", - email = "desousa.kaue@gmail.com", role = c("aut", "cre"), - comment = c(ORCID = "0000-0002-7571-7845")), - person("Adam H.", "Sparks", role = c("aut"), - comment = c(ORCID = "0000-0002-0061-8359")), - person("Aniruddha", "Ghosh", role = c("aut"), - comment = c(ORCID = "0000-0003-3667-8019")), - person("Pete", "Peterson", role = "ctb", - comment = c("API Client implementation")), - person("William", "Ashmall", role = "ctb", - comment = c("API Client implementation")), - person("Jacob", "van Etten", role = c("ths"), - comment = c(ORCID = "0000-0001-7554-2558")), - person("Svein Ø.", "Solberg", role = c("ths"), - comment = c(ORCID = "0000-0002-4491-4483"))) +Authors@R: c( + person("Kauê", "de Sousa", , "desousa.kaue@gmail.com", role = c("aut", "cre"), + comment = c(ORCID = "0000-0002-7571-7845")), + person("Adam H.", "Sparks", role = "aut", + comment = c(ORCID = "0000-0002-0061-8359")), + person("Aniruddha", "Ghosh", role = "aut", + comment = c(ORCID = "0000-0003-3667-8019")), + person("Pete", "Peterson", role = "ctb", + comment = "API Client implementation"), + person("William", "Ashmall", role = "ctb", + comment = "API Client implementation"), + person("Jacob", "van Etten", role = "ths", + comment = c(ORCID = "0000-0001-7554-2558")), + person("Svein Ø.", "Solberg", role = "ths", + comment = c(ORCID = "0000-0002-4491-4483")) + ) +Description: API Client for the Climate Hazards Center 'CHIRPS' and + 'CHIRTS'. The 'CHIRPS' data is a quasi-global (50°S – 50°N) + high-resolution (0.05 arc-degrees) rainfall data set, which + incorporates satellite imagery and in-situ station data to create + gridded rainfall time series for trend analysis and seasonal drought + monitoring. 'CHIRTS' is a quasi-global (60°S – 70°N), high-resolution + data set of daily maximum and minimum temperatures. For more details + on 'CHIRPS' and 'CHIRTS' data please visit its official home page + . +License: MIT + file LICENSE URL: https://docs.ropensci.org/chirps/ BugReports: https://github.com/ropensci/chirps/issues -Description: API Client for the Climate Hazards Center 'CHIRPS' and 'CHIRTS'. - The 'CHIRPS' data is a quasi-global (50°S – 50°N) high-resolution - (0.05 arc-degrees) rainfall data set, which incorporates satellite imagery - and in-situ station data to create gridded rainfall time series for trend - analysis and seasonal drought monitoring. 'CHIRTS' is a quasi-global - (60°S – 70°N), high-resolution data set of daily maximum and minimum - temperatures. For more details on 'CHIRPS' and 'CHIRTS' data please visit - its official home page . -License: MIT + file LICENSE -Encoding: UTF-8 -LazyData: true Depends: - R (>= 3.5.0), - methods + methods, + R (>= 3.5.0) Imports: httr, jsonlite, @@ -45,7 +45,10 @@ Suggests: markdown, rmarkdown, testthat (>= 3.0.0) -Language: en-GB -RoxygenNote: 7.2.1 -VignetteBuilder: knitr +VignetteBuilder: + knitr Config/testthat/edition: 3 +Encoding: UTF-8 +Language: en-GB +LazyData: true +RoxygenNote: 7.3.2 From 08bc84e7ddf9f6a60d10fbd027ff7b3680f82616 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 10:03:30 +0800 Subject: [PATCH 77/93] Fix invalid DESC file --- LICENSE | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/LICENSE b/LICENSE index 130a1c4..73ae0dd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,2 @@ -MIT License - -Copyright (c) 2021 Kauê de Sousa - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +YEAR: 2024 +COPYRIGHT HOLDER: chirps authors \ No newline at end of file From af13af82df720da573e83377b542e552cd37ded7 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 10:03:39 +0800 Subject: [PATCH 78/93] add LICENSE.md --- LICENSE.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..94f31cb --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +# MIT License + +Copyright (c) 2024 chirps 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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file From 137570a70d08671169515d4f82909103678810f9 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 10:03:48 +0800 Subject: [PATCH 79/93] Redocument --- man/get_chirps.Rd | 11 +++-------- man/get_esi.Rd | 12 ++++++------ man/get_imerg.Rd | 2 +- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/man/get_chirps.Rd b/man/get_chirps.Rd index cba603c..dd56d82 100644 --- a/man/get_chirps.Rd +++ b/man/get_chirps.Rd @@ -25,18 +25,13 @@ get_chirps(object, dates, server, ...) ... ) -\method{get_chirps}{SpatExtent}( - object, - dates, - server = "CHC", - as.matrix = TRUE, - as.raster = FALSE, - ... -) +\method{get_chirps}{SpatExtent}(object, dates, server = "CHC", as.raster = TRUE, ...) \method{get_chirps}{sf}(object, dates, server, as.sf = FALSE, ...) \method{get_chirps}{geojson}(object, dates, server, as.geojson = FALSE, ...) + +\method{get_chirps}{SpatExtent}(object, dates, server = "CHC", as.raster = TRUE, ...) } \arguments{ \item{object}{input, an object of class \code{\link[base]{data.frame}} (or diff --git a/man/get_esi.Rd b/man/get_esi.Rd index 112a33c..2996549 100644 --- a/man/get_esi.Rd +++ b/man/get_esi.Rd @@ -47,12 +47,12 @@ A data frame of \acronym{ESI} data: \item{esi}{the ESI value} } \description{ -Get evaporative stress index (\acronym{ESI}) from \acronym{SERVIR} Global -via ClimateSERV \acronym{API} Client. \acronym{ESI} is available every four - (or twelve) weeks from 2001 to present. +Get evaporative stress index (\acronym{ESI}) from \acronym{SERVIR} Global via +ClimateSERV \acronym{API} Client. \acronym{ESI} is available every four +(or twelve) weeks from 2001 to present. The dataset may contain cloudy data which is returned as \code{NA}s. ClimateSERV works with 'geojson' of type 'Polygon'. The input \code{object} - is then transformed into polygons with a small buffer area around the point. +is then transformed into polygons with a small buffer area around the point. } \details{ \bold{operation}: supported operations are: @@ -82,8 +82,8 @@ lonlat <- data.frame(lon = c(-55.0281,-54.9857), dates <- c("2017-12-15","2018-06-20") -# by default the function set a very small buffer around the points -# which can return NAs due to cloudiness in ESI data +# by default the function sets a very small buffer around the points which +# can return NAs due to cloudiness in ESI data dt <- get_esi(lonlat, dates = dates) diff --git a/man/get_imerg.Rd b/man/get_imerg.Rd index 6a5fa91..0b60406 100644 --- a/man/get_imerg.Rd +++ b/man/get_imerg.Rd @@ -52,7 +52,7 @@ The IMERG dataset provides near-real time global observations of rainfall at and -70 degrees. } \details{ -\bold{operation}: supported operations are: +\bold{operation}: supported operations are: \tabular{rll}{ \bold{operation} \tab \tab \bold{value}\cr max \tab = \tab 0\cr From a9f8a908a2aad96063f786053032b41ed5c05bda Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 10:03:57 +0800 Subject: [PATCH 80/93] Update NEWS.md --- NEWS.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index aebb44e..edf90e8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,18 @@ chirps 0.1.4.001 (2022-01-15) ========================= -### ENHACEMENTS +### BUG FIXES + +* Fixes bug where the first and last dates requested are not available as per and + +* Fixes mismatched brackets in documentation + +* Fixes bug where geojson objects were not allowed, + +chirps 0.1.4.001 (2022-01-15) +========================= + +### ENHANCEMENTS * Methods for objects of class "SpatExtent" in `get_chirps()` and `get_chirts()` to return a raster within a given area From f2b8b9f1559e4698bdbfb7520ab5b69ee7302899 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 10:04:11 +0800 Subject: [PATCH 81/93] Update codemeta.json --- codemeta.json | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/codemeta.json b/codemeta.json index 74f1310..73891ef 100644 --- a/codemeta.json +++ b/codemeta.json @@ -4,7 +4,7 @@ "identifier": "chirps", "description": "API Client for the Climate Hazards Center 'CHIRPS' and 'CHIRTS'. The 'CHIRPS' data is a quasi-global (50°S – 50°N) high-resolution (0.05 arc-degrees) rainfall data set, which incorporates satellite imagery and in-situ station data to create gridded rainfall time series for trend analysis and seasonal drought monitoring. 'CHIRTS' is a quasi-global (60°S – 70°N), high-resolution data set of daily maximum and minimum temperatures. For more details on 'CHIRPS' and 'CHIRTS' data please visit its official home page .", "name": "chirps: API Client for CHIRPS and CHIRTS", - "codeRepository": "https://docs.ropensci.org/chirps/", + "codeRepository": "https://github.com/ropensci/chirps", "issueTracker": "https://github.com/ropensci/chirps/issues", "license": "https://spdx.org/licenses/MIT", "version": "0.1.5", @@ -13,7 +13,7 @@ "name": "R", "url": "https://r-project.org" }, - "runtimePlatform": "R version 4.2.1 (2022-06-23)", + "runtimePlatform": "R version 4.4.1 (2024-06-14)", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -127,7 +127,7 @@ "@type": "SoftwareApplication", "identifier": "testthat", "name": "testthat", - "version": ">= 2.1.0", + "version": ">= 3.0.0", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -135,32 +135,19 @@ "url": "https://cran.r-project.org" }, "sameAs": "https://CRAN.R-project.org/package=testthat" - }, - { - "@type": "SoftwareApplication", - "identifier": "vcr", - "name": "vcr", - "version": ">= 0.5", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=vcr" } ], "softwareRequirements": { "1": { "@type": "SoftwareApplication", - "identifier": "R", - "name": "R", - "version": ">= 3.5.0" + "identifier": "methods", + "name": "methods" }, "2": { "@type": "SoftwareApplication", - "identifier": "methods", - "name": "methods" + "identifier": "R", + "name": "R", + "version": ">= 3.5.0" }, "3": { "@type": "SoftwareApplication", @@ -218,7 +205,7 @@ }, "SystemRequirements": null }, - "fileSize": "3086.717KB", + "fileSize": "1559.103KB", "citation": [ { "@type": "ScholarlyArticle", @@ -267,5 +254,16 @@ } } } - ] + ], + "relatedLink": ["https://docs.ropensci.org/chirps/", "https://CRAN.R-project.org/package=chirps"], + "releaseNotes": "https://github.com/ropensci/chirps/blob/master/NEWS.md", + "readme": "https://github.com/ropensci/chirps/blob/master/README.md", + "contIntegration": ["https://codecov.io/gh/ropensci/chirps", "https://github.com/ropensci/chirps/actions"], + "developmentStatus": "https://www.repostatus.org/#active", + "review": { + "@type": "Review", + "url": "https://github.com/ropensci/software-review/issues/357", + "provider": "https://ropensci.org" + }, + "keywords": ["climatology", "precipitation-data", "rstats", "chirps"] } From 48b7ea4d5825f34fdb1e4498ea55929314feb054 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 10:06:52 +0800 Subject: [PATCH 82/93] Set up CI --- .github/.gitignore | 1 + .github/workflows/R-CMD-check.yaml | 52 ++++++++++++++++++++++++ .github/workflows/test-coverage.yaml | 61 ++++++++++++++++++++++++++++ README.md | 2 + 4 files changed, 116 insertions(+) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/R-CMD-check.yaml create mode 100644 .github/workflows/test-coverage.yaml diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..d46a617 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,52 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: R-CMD-check.yaml + +permissions: read-all + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + 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'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..9882260 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,61 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: test-coverage.yaml + +permissions: read-all + +jobs: + test-coverage: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - 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, any::xml2 + needs: coverage + + - name: Test coverage + run: | + 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 + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/README.md b/README.md index a8a5ac9..2f74c21 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ [![Project Status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![DOI](https://zenodo.org/badge/225693680.svg)](https://zenodo.org/badge/latestdoi/225693680) [![tic](https://github.com/ropensci/chirps/workflows/tic/badge.svg?branch=master)](https://github.com/ropensci/chirps/actions) +[![R-CMD-check](https://github.com/ropensci/chirps/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/chirps/actions/workflows/R-CMD-check.yaml) +[![Codecov test coverage](https://codecov.io/gh/ropensci/chirps/graph/badge.svg)](https://app.codecov.io/gh/ropensci/chirps) # *chirps*: API Client for CHIRPS and CHIRTS From 3ccd459b7200037ea81ca4073a30b2209eef768a Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 10:08:14 +0800 Subject: [PATCH 83/93] remove tic infrastructure --- .github/workflows/tic.yml | 147 ------------------------------- .github/workflows/update-tic.yml | 53 ----------- tic.R | 8 -- 3 files changed, 208 deletions(-) delete mode 100644 .github/workflows/tic.yml delete mode 100644 .github/workflows/update-tic.yml delete mode 100644 tic.R diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml deleted file mode 100644 index 91eeaf3..0000000 --- a/.github/workflows/tic.yml +++ /dev/null @@ -1,147 +0,0 @@ -## tic GitHub Actions template: linux-macos-windows-deploy -## revision date: 2022-03-01 -on: - workflow_dispatch: - push: - branches: - - main - - master - - devel - pull_request: - branches: - - main - - master - - devel - # for now, CRON jobs only run on the default branch of the repo (i.e. usually on master) - schedule: - # * is a special character in YAML so you have to quote this string - - cron: "0 4 * * *" - -name: tic - -jobs: - all: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - # use a different tic template type if you do not want to build on all listed platforms - - { os: windows-latest, r: "release" } - - { os: macOS-latest, r: "release", pkgdown: "false", latex: "true" } - - { os: ubuntu-latest, r: "devel" } - - { os: ubuntu-latest, r: "release" } - - env: - # otherwise remotes::fun() errors cause the build to fail. Example: Unavailability of binaries - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - CRAN: ${{ matrix.config.cran }} - # make sure to run `tic::use_ghactions_deploy()` to set up deployment - TIC_DEPLOY_KEY: ${{ secrets.TIC_DEPLOY_KEY }} - # prevent rgl issues because no X11 display is available - RGL_USE_NULL: true - # if you use bookdown or blogdown, replace "PKGDOWN" by the respective - # capitalized term. This also might need to be done in tic.R - BUILD_PKGDOWN: ${{ matrix.config.pkgdown }} - # macOS >= 10.15.4 linking - SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk - # use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes} - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v3 - - - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ matrix.config.r }} - Ncpus: 4 - - - uses: r-lib/actions/setup-tinytex@v2 - if: matrix.config.latex == 'true' - - - uses: r-lib/actions/setup-pandoc@v2 - - # set date/week for use in cache creation - # https://github.community/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970 - # - cache R packages daily - - name: "[Cache] Prepare daily timestamp for cache" - if: runner.os != 'Windows' - id: date - run: echo "::set-output name=date::$(date '+%d-%m')" - - - name: "[Cache] Cache R packages" - if: runner.os != 'Windows' - uses: pat-s/always-upload-cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}} - restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}} - - - name: "[Stage] [Linux] Install required system libs" - if: runner.os == 'Linux' - run: sudo apt install libcurl4-openssl-dev libgit2-dev - - # for some strange Windows reason this step and the next one need to be decoupled - - name: "[Stage] Prepare" - run: | - Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')" - Rscript -e "if (!requireNamespace('curl')) install.packages('curl', type = 'source')" - - - name: "[Stage] [macOS] Install libgit2" - if: runner.os == 'macOS' - run: brew install libgit2 - - - name: "[Stage] [macOS] Install system libs for pkgdown" - if: runner.os == 'macOS' && matrix.config.pkgdown != '' - run: brew install harfbuzz fribidi - - - name: "[Stage] [Linux] Install system libs for pkgdown" - if: runner.os == 'Linux' && matrix.config.pkgdown != '' - run: sudo apt install libharfbuzz-dev libfribidi-dev - - # Try to automatically check for system dependencies and install them - # Note: this might not catch all required system libs and manual action might be needed - - name: "[Stage] [Linux] Install linux system dependencies" - if: runner.os == 'Linux' - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - - - name: "[Stage] Install" - if: matrix.config.os != 'macOS-latest' || matrix.config.r != 'devel' - run: Rscript -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()" - - # macOS devel needs its own stage because we need to work with an option to suppress the usage of binaries - - name: "[Stage] Prepare & Install (macOS-devel)" - if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'devel' - run: | - echo -e 'options(Ncpus = 4, pkgType = "source", repos = structure(c(CRAN = "https://cloud.r-project.org/")))' > $HOME/.Rprofile - Rscript -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()" - - - name: "[Stage] Script" - run: Rscript -e 'tic::script()' - - - name: "[Stage] After Success" - if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'release' - run: Rscript -e "tic::after_success()" - - - name: "[Stage] Upload R CMD check artifacts" - if: failure() - uses: actions/upload-artifact@v2 - with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check - - name: "[Stage] Before Deploy" - run: | - Rscript -e "tic::before_deploy()" - - - name: "[Stage] Deploy" - run: Rscript -e "tic::deploy()" - - - name: "[Stage] After Deploy" - run: Rscript -e "tic::after_deploy()" diff --git a/.github/workflows/update-tic.yml b/.github/workflows/update-tic.yml deleted file mode 100644 index 20f1303..0000000 --- a/.github/workflows/update-tic.yml +++ /dev/null @@ -1,53 +0,0 @@ -on: - workflow_dispatch: - schedule: - # * is a special character in YAML so you have to quote this string - - cron: "0 4 * * *" - -name: Update tic - -jobs: - update-tic: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - - { os: ubuntu-latest, r: "release" } - - env: - # use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes} - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v2 - with: - persist-credentials: false - - - uses: r-lib/actions/setup-r@master - with: - r-version: ${{ matrix.config.r }} - Ncpus: 4 - - - name: "[Stage] Dependencies" - run: | - sudo apt install libcurl4-openssl-dev libsodium-dev libharfbuzz-dev libfribidi-dev libgit2-dev - Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')" - Rscript -e "remotes::install_github('ropensci/tic', dependencies = TRUE)" - - - name: "[Stage] Update YAMLs" - run: | - Rscript -e "tic::update_yml()" - - - name: "[Stage] Create Pull Request" - uses: peter-evans/create-pull-request@v3 - with: - author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> - token: ${{ secrets.TIC_UPDATE }} - title: "Update tic templates [ci-skip]" - commit-message: "update tic templates" - body: "{tic} templates can be updated :rocket: :robot:" - branch: update-tic diff --git a/tic.R b/tic.R deleted file mode 100644 index 492701d..0000000 --- a/tic.R +++ /dev/null @@ -1,8 +0,0 @@ -# installs dependencies, runs R CMD check, runs covr::codecov() -do_package_checks() - -if (ci_on_ghactions() && ci_has_env("BUILD_PKGDOWN")) { - # creates pkgdown site and pushes to gh-pages branch - # only for the runner with the "BUILD_PKGDOWN" env var set - do_pkgdown() -} From fbf49cce958c6756fe2c47ef538e67600e0bbbf4 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 11:12:37 +0800 Subject: [PATCH 84/93] remove tic badge --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 2f74c21..fac072d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ [![codecov](https://codecov.io/gh/ropensci/chirps/branch/master/graph/badge.svg)](https://codecov.io/gh/ropensci/chirps) [![Project Status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![DOI](https://zenodo.org/badge/225693680.svg)](https://zenodo.org/badge/latestdoi/225693680) -[![tic](https://github.com/ropensci/chirps/workflows/tic/badge.svg?branch=master)](https://github.com/ropensci/chirps/actions) [![R-CMD-check](https://github.com/ropensci/chirps/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/chirps/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/ropensci/chirps/graph/badge.svg)](https://app.codecov.io/gh/ropensci/chirps) From 5b4ce3a92aea1a47fe6ba9d536541b63ffd1001a Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 11:12:48 +0800 Subject: [PATCH 85/93] add missing test_data.rda --- tests/test_data.rda | Bin 0 -> 493 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/test_data.rda diff --git a/tests/test_data.rda b/tests/test_data.rda new file mode 100644 index 0000000000000000000000000000000000000000..6f8f0637c16faf1adf8672c26fc8268c37a49ed9 GIT binary patch literal 493 zcmV-uOT$1A9ydwRNJa4O!IOfmX|>=nVAX>lC_ah`8uPG) z*p?XdS_*pg=0ya5hR1?*dO{= z6L1T{=EhQP9)Kq(3;+*9$TMoSW;IVxbIel*E{k0BGysT?p)Oue#=_Q2{Zu#68jO0U zJ}OFu8T^WpB>hB+F=RG|%*BwBkA&Y9R8u)&&j!vIifT73+;wq{xCZ2j^YOd2w{u7# zx!AtkoBX(!7p5PPo&r1~_b8OE=pymux=kGFDWRT{W+B)WeI1VJBt{bszOEeWEO?HB zd|9#eNR3&I8g)~#BSwa-##x>ja$_Pb{Ba!TGsPcKQ*0$~Sa>DLCp-;&VquDI<#JL1 zzZg=AbrSW`>q|llNII)Rc4zl$s{>ej|F<;AFbiHXb@pPPBYMt2X=GE_Ri&n+_wA^kH|d=bqxFOA~h|gcc@=l je9n@4COSxb@^spV=DudIhfqqJH|Tx?$PdwA=LG-&vj*r~ literal 0 HcmV?d00001 From 7c6ae11224c05e179863cef7a03040906fc73f6f Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 12:04:46 +0800 Subject: [PATCH 86/93] add CRS to suppress error message --- R/as.geojson.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/as.geojson.R b/R/as.geojson.R index ec92a72..a1f40be 100644 --- a/R/as.geojson.R +++ b/R/as.geojson.R @@ -66,7 +66,8 @@ as.geojson.default <- function(lonlat, }) # and then into a geometry list column - lonlat <- sf::st_sfc(lonlat) + lonlat <- sf::st_sfc(lonlat, + crs = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0") # set the buffer around the points lonlatb <- sf::st_buffer(lonlat, @@ -74,7 +75,8 @@ as.geojson.default <- function(lonlat, nQuadSegs = nQuadSegs) # transform into a sf object - lonlatb <- sf::st_as_sf(lonlatb) + lonlatb <- sf::st_as_sf(x = lonlatb) + # write the geojson string tf <- tempfile(fileext = ".geojson") From 8e1cc236d9c9c4508a89ffb7b427735b65806893 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 12:31:47 +0800 Subject: [PATCH 87/93] Update tests, supress error messages, update data, etc. --- tests/test_data.rda | Bin 493 -> 0 bytes tests/testthat/test-get_chirps.R | 46 +++++++++++++------------------ tests/testthat/test-get_esi.R | 3 +- tests/testthat/test-get_imerg.R | 3 +- tests/testthat/test_data.rda | Bin 0 -> 341 bytes 5 files changed, 23 insertions(+), 29 deletions(-) delete mode 100644 tests/test_data.rda create mode 100644 tests/testthat/test_data.rda diff --git a/tests/test_data.rda b/tests/test_data.rda deleted file mode 100644 index 6f8f0637c16faf1adf8672c26fc8268c37a49ed9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 493 zcmV-uOT$1A9ydwRNJa4O!IOfmX|>=nVAX>lC_ah`8uPG) z*p?XdS_*pg=0ya5hR1?*dO{= z6L1T{=EhQP9)Kq(3;+*9$TMoSW;IVxbIel*E{k0BGysT?p)Oue#=_Q2{Zu#68jO0U zJ}OFu8T^WpB>hB+F=RG|%*BwBkA&Y9R8u)&&j!vIifT73+;wq{xCZ2j^YOd2w{u7# zx!AtkoBX(!7p5PPo&r1~_b8OE=pymux=kGFDWRT{W+B)WeI1VJBt{bszOEeWEO?HB zd|9#eNR3&I8g)~#BSwa-##x>ja$_Pb{Ba!TGsPcKQ*0$~Sa>DLCp-;&VquDI<#JL1 zzZg=AbrSW`>q|llNII)Rc4zl$s{>ej|F<;AFbiHXb@pPPBYMt2X=GE_Ri&n+_wA^kH|d=bqxFOA~h|gcc@=l je9n@4COSxb@^spV=DudIhfqqJH|Tx?$PdwA=LG-&vj*r~ diff --git a/tests/testthat/test-get_chirps.R b/tests/testthat/test-get_chirps.R index eeeb3df..608d14d 100644 --- a/tests/testthat/test-get_chirps.R +++ b/tests/testthat/test-get_chirps.R @@ -1,43 +1,35 @@ load(test_path("test_data.rda")) # Test get_chirps() default method ----- -test_that("get_chirps() returns proper values", - { - x_df <- - get_chirps(data.frame(lonlat), - dates = dates, - server = "ClimateSERV") - expect_equal(x_df, chirps_df) - expect_named(x_df, names(chirps_df)) - expect_equal(nrow(x_df), nrow(chirps_df)) - expect_s3_class(x_df, class(chirps_df)) - }) +test_that("get_chirps() returns proper values", { + x_df <- + get_chirps(data.frame(lonlat), dates = dates, server = "ClimateSERV") + expect_equal(x_df, chirps_df) + expect_named(x_df, names(chirps_df)) + expect_equal(nrow(x_df), nrow(chirps_df)) + expect_s3_class(x_df, class(chirps_df)) +}) # Test get_chirps() 'sf' return data frame method ----- test_that("get_chirps() sf method return df", { library("sf") - coords <- st_as_sf(lonlat, coords = c("lon", "lat")) - x_sf <- get_chirps(object = coords, + sf_coords <- st_as_sf(lonlat, coords = c("lon", "lat"), crs = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0") + x_sf <- get_chirps(object = sf_coords, dates = dates, server = "ClimateSERV") - expect_equal(x_sf$chirps, chirps_sf$chirps, tolerance = 0.001) + expect_equal(x_sf$chirps, chirps_df$chirps, tolerance = 0.001) expect_named(x_sf, names(chirps_df)) expect_equal(nrow(x_sf), nrow(chirps_df)) expect_s3_class(x_sf, class(chirps_df)) }) # get chirps with geojson method -# geojson <- as.geojson(coords) -# -# test_that("geojson method", { -# vcr::use_cassette("geojson_method", { -# z <- suppressWarnings(get_chirps(geojson, dates, server = "ClimateSERV")) -# -# z <- round(z$chirps, 2) -# -# equal <- all(z == chirps$chirps) -# -# expect_true(equal) -# }) -# }) +test_that("geojson method", { + geojson_coords <- as.geojson(lonlat) + x_gjson <- get_chirps(geojson_coords, dates, server = "ClimateSERV") + expect_equal(x_gjson$chirps, chirps_df$chirps, tolerance = 0.001) + expect_named(x_gjson, names(chirps_df)) + expect_equal(nrow(x_gjson), nrow(chirps_df)) + expect_s3_class(x_gjson, class(chirps_df)) +}) diff --git a/tests/testthat/test-get_esi.R b/tests/testthat/test-get_esi.R index 68e5269..4bce1ef 100644 --- a/tests/testthat/test-get_esi.R +++ b/tests/testthat/test-get_esi.R @@ -15,7 +15,8 @@ test_that("get_esi() returns proper values", { }) # Test sf data frame method ----- -coords <- sf::st_as_sf(esi_lonlat, coords = c("lon", "lat")) +coords <- sf::st_as_sf(esi_lonlat, coords = c("lon", "lat"), + crs = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0") test_that("get_esi() sf method return_df", { y <- get_esi(coords, esi_dates) diff --git a/tests/testthat/test-get_imerg.R b/tests/testthat/test-get_imerg.R index 70c4a2b..84214bc 100644 --- a/tests/testthat/test-get_imerg.R +++ b/tests/testthat/test-get_imerg.R @@ -59,7 +59,8 @@ test_that("get_imerg() returns proper values", # Test get_imerg() 'sf' return data frame method ----- test_that("get_imerg() sf method return df", { library("sf") - coords <- st_as_sf(imerg_lonlat, coords = c("lon", "lat")) + coords <- st_as_sf(imerg_lonlat, coords = c("lon", "lat"), + crs = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0") x_sf <- get_imerg(object = coords, dates = imerg_dates, server = "ClimateSERV") diff --git a/tests/testthat/test_data.rda b/tests/testthat/test_data.rda new file mode 100644 index 0000000000000000000000000000000000000000..9ba074b56bd7226ab7e237aff125d42368faa934 GIT binary patch literal 341 zcmV-b0jmBViwFP!000000}FDAFy@NjVqjokW?*4qWMF0mG8tGyL)>&N7#LWXfE-2! z76wir&6%8$SyWIQpOOYtEDTZw#JoVv1y+QKnXq6!kop6Dth`at(=-Xv-YH?OZJ*8& zqT%LpIJjTFqQOm&W=@#h@GC8u5DoMv*j$IBX$_!YaX6aJ0HvY)3@ASX$|p`8TEMa< z=Oh*v0~rEHf-EkHC8IotqAA_^i)@rU#mcb9mfo1q(-T}AEj>U?V}`k%35VZNeaMK*3oQT9 nT>KA Date: Sat, 19 Oct 2024 12:32:03 +0800 Subject: [PATCH 88/93] use newline before message for cleaner console messages --- R/GET.R | 4 ++-- R/get_chirps.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/GET.R b/R/GET.R index ea3ea42..b5fba65 100644 --- a/R/GET.R +++ b/R/GET.R @@ -33,7 +33,7 @@ dates, operation = NULL, datatype = NULL) { - message("Fetching data from ClimateSERV \n") + message("\nFetching data from ClimateSERV \n") begindate <- dates[1] enddate <- dates[2] @@ -59,7 +59,7 @@ nids <- max(seq_along(ids)) - message("Getting your request...\n") + message("\nGetting your request...\n") while (isFALSE(all(request_progress))) { request_progress <- lapply(ids, function(x) { diff --git a/R/get_chirps.R b/R/get_chirps.R index bf83c22..fc632a1 100644 --- a/R/get_chirps.R +++ b/R/get_chirps.R @@ -631,7 +631,7 @@ get_chirps.SpatExtent <- function(object, interval = "daily", format = "cogs", ...) { - message("Fetching data as GeoTIFF files from CHC server \n") + message("\nFetching data as GeoTIFF files from CHC server \n") # setup file names .validate_dates(dates) seqdate <- @@ -647,7 +647,7 @@ get_chirps.SpatExtent <- function(object, } } else { resolution <- .05 - message("Getting CHIRPS in a .05 deg resolution \n") + message("\nGetting CHIRPS in a .05 deg resolution \n") } resolution <- gsub("p0.", "p", paste0("p", resolution)) From 838d2d2e050ecdd06dc8a88854d8c3956caea908 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 12:32:29 +0800 Subject: [PATCH 89/93] specify CRS to supress message emitted by {sf} --- R/as.geojson.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/as.geojson.R b/R/as.geojson.R index a1f40be..9397c2a 100644 --- a/R/as.geojson.R +++ b/R/as.geojson.R @@ -142,7 +142,8 @@ as.geojson.sf <- function(lonlat, ...) # transform into a sf object - lonlatb <- sf::st_as_sf(lonlatb) + lonlatb <- sf::st_as_sf(lonlatb, + crs = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0") } if (type == "POLYGON") { From 19d3cc8b548b75122ff7f33f06d702da43997fcf Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 12:32:42 +0800 Subject: [PATCH 90/93] Update codemeta.json --- codemeta.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codemeta.json b/codemeta.json index 73891ef..2544d08 100644 --- a/codemeta.json +++ b/codemeta.json @@ -205,7 +205,7 @@ }, "SystemRequirements": null }, - "fileSize": "1559.103KB", + "fileSize": "1559.459KB", "citation": [ { "@type": "ScholarlyArticle", @@ -258,7 +258,7 @@ "relatedLink": ["https://docs.ropensci.org/chirps/", "https://CRAN.R-project.org/package=chirps"], "releaseNotes": "https://github.com/ropensci/chirps/blob/master/NEWS.md", "readme": "https://github.com/ropensci/chirps/blob/master/README.md", - "contIntegration": ["https://codecov.io/gh/ropensci/chirps", "https://github.com/ropensci/chirps/actions"], + "contIntegration": ["https://codecov.io/gh/ropensci/chirps", "https://github.com/ropensci/chirps/actions/workflows/R-CMD-check.yaml", "https://app.codecov.io/gh/ropensci/chirps"], "developmentStatus": "https://www.repostatus.org/#active", "review": { "@type": "Review", From da610ab8a8550e6eb449b97a65c00da197070f87 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 12:41:59 +0800 Subject: [PATCH 91/93] Fixes test for get_imerg() --- tests/testthat/test-get_imerg.R | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/testthat/test-get_imerg.R b/tests/testthat/test-get_imerg.R index 84214bc..8c0e504 100644 --- a/tests/testthat/test-get_imerg.R +++ b/tests/testthat/test-get_imerg.R @@ -47,8 +47,7 @@ imerg_names <- c("id", "lon", "lat", "date", "imerg") test_that("get_imerg() returns proper values", { x_df <- get_imerg(imerg_lonlat, - dates = imerg_dates, - server = "ClimateSERV") + dates = imerg_dates) expect_equal(x_df$imerg, imerg_values, tolerance = 0.01) expect_named(x_df, imerg_names) expect_equal(nrow(x_df), 34) @@ -62,8 +61,7 @@ test_that("get_imerg() sf method return df", { coords <- st_as_sf(imerg_lonlat, coords = c("lon", "lat"), crs = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0") x_sf <- get_imerg(object = coords, - dates = imerg_dates, - server = "ClimateSERV") + dates = imerg_dates) expect_equal(x_sf$imerg, imerg_values, tolerance = 0.01) expect_named(x_sf, imerg_names) expect_equal(nrow(x_sf), 34) @@ -74,7 +72,6 @@ test_that("get_imerg() sf method return df", { test_that("geojson method", { gjson <- as.geojson(imerg_lonlat) x_gjson <- get_imerg(gjson, - imerg_dates, - server = "ClimateSERV") + imerg_dates) expect_equal(x_gjson$imerg, imerg_values, tolerance = 0.01) }) From bb5e770b5dd6d82ae40c69e1a4d7736ca1076e83 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 13:14:26 +0800 Subject: [PATCH 92/93] upgrade tests --- tests/testthat/test-get_chirts.R | 19 +++++++-------- tests/testthat/test-get_imerg.R | 42 ++++++++++++++++++++------------ 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/tests/testthat/test-get_chirts.R b/tests/testthat/test-get_chirts.R index 4175041..beee3c4 100644 --- a/tests/testthat/test-get_chirts.R +++ b/tests/testthat/test-get_chirts.R @@ -3,8 +3,7 @@ lonlat <- structure(list( lon = c(-60.03947, -54.7838828), - lat = c(-3.031387, - -2.4221716) + lat = c(-3.031387, -2.4221716) ), class = "data.frame", row.names = c(NA, -2L)) @@ -25,11 +24,11 @@ chirts_values <- # Test get_chirts() default method ----- test_that("get_chirts() returns proper values", { - x <- get_chirts(object = lonlat, - dates = dates, - var = "Tmax") - expect_equal(x$chirts, chirts_values, tolerance = 0.01) - expect_named(x, c("id", "lon", "lat", "date", "chirts")) - expect_equal(nrow(x), 10) - expect_s3_class(x, c("chirts", "chirts_df", "data.frame")) - }) + x <- get_chirts(object = lonlat, + dates = dates, + var = "Tmax") + expect_equal(x$chirts, chirts_values, tolerance = 0.01) + expect_named(x, c("id", "lon", "lat", "date", "chirts")) + expect_equal(nrow(x), 10) + expect_s3_class(x, c("chirts", "chirts_df", "data.frame")) +}) diff --git a/tests/testthat/test-get_imerg.R b/tests/testthat/test-get_imerg.R index 8c0e504..a474bad 100644 --- a/tests/testthat/test-get_imerg.R +++ b/tests/testthat/test-get_imerg.R @@ -1,4 +1,5 @@ + # setup for tests, expected values for all imerg_lonlat <- data.frame(lon = c(-55.0281, -54.9857), @@ -44,34 +45,43 @@ imerg_values <- imerg_names <- c("id", "lon", "lat", "date", "imerg") # Test get_imerg() default method ----- -test_that("get_imerg() returns proper values", - { - x_df <- get_imerg(imerg_lonlat, - dates = imerg_dates) - expect_equal(x_df$imerg, imerg_values, tolerance = 0.01) - expect_named(x_df, imerg_names) - expect_equal(nrow(x_df), 34) - expect_s3_class(x_df, "chirps_df") - }) +test_that("get_imerg() returns proper values", { + x_df <- get_imerg(imerg_lonlat, dates = imerg_dates) + expect_equal(x_df$imerg, imerg_values, tolerance = 0.01) + expect_named(x_df, imerg_names) + expect_equal(nrow(x_df), 34) + expect_s3_class(x_df, "chirps_df") +}) +sf_coords <- st_as_sf(imerg_lonlat, + coords = c("lon", "lat"), + crs = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0") # Test get_imerg() 'sf' return data frame method ----- test_that("get_imerg() sf method return df", { library("sf") - coords <- st_as_sf(imerg_lonlat, coords = c("lon", "lat"), - crs = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0") - x_sf <- get_imerg(object = coords, - dates = imerg_dates) + x_sf <- get_imerg(object = sf_coords, dates = imerg_dates) expect_equal(x_sf$imerg, imerg_values, tolerance = 0.01) expect_named(x_sf, imerg_names) expect_equal(nrow(x_sf), 34) expect_s3_class(x_sf, "chirps_df") }) +# get_imerg with sf method +test_that("geojson method return sf", { + x_return_sf <- get_imerg(sf_coords, imerg_dates, as.sf = TRUE) + expect_s3_class(x_return_sf, "sf") +}) + +gjson <- as.geojson(imerg_lonlat) # get chirps with geojson method test_that("geojson method", { - gjson <- as.geojson(imerg_lonlat) - x_gjson <- get_imerg(gjson, - imerg_dates) + x_gjson <- get_imerg(gjson, imerg_dates) expect_equal(x_gjson$imerg, imerg_values, tolerance = 0.01) }) + +# get_imerg with geojson method +test_that("geojson method return sf", { + x_return_gjson <- get_imerg(gjson, imerg_dates, as.geojson = TRUE) + expect_s3_class(x_return_gjson, "geojson") +}) From 888f275601d92844243fb32f6dae2d5694bf61f8 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 19 Oct 2024 13:42:10 +0800 Subject: [PATCH 93/93] corrects redundant word in fn title --- R/get_chirts.R | 2 +- codemeta.json | 2 +- man/get_chirts.Rd | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/get_chirts.R b/R/get_chirts.R index c21a8b1..8fb5823 100644 --- a/R/get_chirts.R +++ b/R/get_chirts.R @@ -1,4 +1,4 @@ -#' Get CHIRTS temperature data data +#' Get CHIRTS temperature data #' #' Get daily maximum and minimum temperature data from the "Climate Hazards #' Group". CHIRTS-daily is a global 2-m temperature product that combines the diff --git a/codemeta.json b/codemeta.json index 2544d08..9120866 100644 --- a/codemeta.json +++ b/codemeta.json @@ -205,7 +205,7 @@ }, "SystemRequirements": null }, - "fileSize": "1559.459KB", + "fileSize": "1559.449KB", "citation": [ { "@type": "ScholarlyArticle", diff --git a/man/get_chirts.Rd b/man/get_chirts.Rd index f69e82a..90125af 100644 --- a/man/get_chirts.Rd +++ b/man/get_chirts.Rd @@ -6,7 +6,7 @@ \alias{get_chirts.SpatVector} \alias{get_chirts.SpatRaster} \alias{get_chirts.SpatExtent} -\title{Get CHIRTS temperature data data} +\title{Get CHIRTS temperature data} \usage{ get_chirts(object, dates, var, ...)