Skip to content

Commit

Permalink
Increase timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Jul 29, 2024
1 parent 50c5806 commit c717d01
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 9 deletions.
5 changes: 4 additions & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ message: 'To cite package "climaemet" in publications use:'
type: software
license: GPL-3.0-only
title: 'climaemet: Climate AEMET Tools'
version: 1.3.0
version: 1.3.0.9000
doi: 10.5281/zenodo.5205573
identifiers:
- type: doi
Expand Down Expand Up @@ -199,6 +199,9 @@ references:
email: [email protected]
orcid: https://orcid.org/0000-0002-4035-0289
year: '2024'
identifiers:
- type: url
value: https://arxiv.org/abs/1403.2805
doi: 10.32614/CRAN.package.jsonlite
version: '>= 1.7.0'
- type: software
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: climaemet
Title: Climate AEMET Tools
Version: 1.3.0
Version: 1.3.0.9000
Authors@R: c(
person("Manuel", "Pizarro", role = c("aut", "cph"),
comment = c(ORCID = "0000-0002-6981-0154")),
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# climaemet (development version)

- Increase timeout limit with `httr2::req_timeout()`.
- Better management of non valid/duplicated/empty API keys.

# climaemet 1.3.0

- Migrate from **httr** to **httr2** (#50).
Expand Down
13 changes: 13 additions & 0 deletions R/aemet_api_query.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ get_data_aemet <- function(apidest, verbose = FALSE) {
stopifnot(is.logical(verbose))

initapikey <- aemet_hlp_get_allkeys()
initapikey <- c("a", NULL, NA, initapikey)
# Clean not valid apikeys
initapikey <- initapikey[!is.na(initapikey)]
initapikey <- initapikey[nchar(initapikey) > 10]
initapikey <- unique(initapikey)

if (length(initapikey) < 1) {
stop("Can't find any valud API key. See ??aemet_api_key.", call. = FALSE)
}


# Sample to get a random apikey
index <- sample(seq_len(length(initapikey)), 1)
Expand Down Expand Up @@ -287,6 +297,9 @@ aemet_api_call <- function(apidest, verbose = FALSE, data_call = FALSE,
FALSE
})

# Increase timeout
req1 <- httr2::req_timeout(req1, 20)

# Perform request
if (verbose) {
message("\nRequesting ", req1$url)
Expand Down
6 changes: 3 additions & 3 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"codeRepository": "https://github.com/rOpenSpain/climaemet",
"issueTracker": "https://github.com/rOpenSpain/climaemet/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "1.3.0",
"version": "1.3.0.9000",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.4.1 (2024-06-14 ucrt)",
"runtimePlatform": "R version 4.4.1 (2024-06-14)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -339,7 +339,7 @@
},
"applicationCategory": "Meteorology",
"isPartOf": "https://ropenspain.es/",
"fileSize": "831.104KB",
"fileSize": "823.112KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down
Binary file modified data/climaemet_9434_climatogram.rda
Binary file not shown.
Binary file modified data/climaemet_9434_temp.rda
Binary file not shown.
2 changes: 0 additions & 2 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ AEMET
Avilés
Bogdan
Climatogram
DMS
Estadistica
Fernández
Guijarro
Expand Down Expand Up @@ -30,7 +29,6 @@ climatol
climatological
coercible
de
dms
english
json
spanish
Expand Down
4 changes: 2 additions & 2 deletions inst/schemaorg.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"runtimePlatform": "R version 4.4.1 (2024-06-14 ucrt)",
"version": "1.3.0"
"runtimePlatform": "R version 4.4.1 (2024-06-14)",
"version": "1.3.0.9000"
},
{
"id": "https://doi.org/10.5281/zenodo.5205573",
Expand Down
Binary file modified man/figures/README-climatogram-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-windrose-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c717d01

Please sign in to comment.