Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapereirabr committed Aug 28, 2024
1 parent e7aa4ce commit 2ee561a
Show file tree
Hide file tree
Showing 7 changed files with 534 additions and 21 deletions.
1 change: 1 addition & 0 deletions r-package/.Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
^aopdata\.Rproj$
^\.Rproj\.user$
^prep_data$
^tests_rafa
^_pkgdown\.yml$
^docs$
^pkgdown$
Expand Down
18 changes: 9 additions & 9 deletions r-package/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: aopdata
Title: Data from the 'Access to Opportunities Project (AOP)'
Version: 1.0.3
Version: 1.1.0
Authors@R: c(
person(given="Rafael H. M.", family="Pereira", email="rafa.pereira.br@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2125-7465")),
person(given="Daniel", family="Herszenhut", email="dhersz@gmail.com", role="aut", comment = c(ORCID = "0000-0001-8066-1105")),
Expand All @@ -17,12 +17,19 @@ Description: Download data from the 'Access to Opportunities Project (AOP)'. The
health care, schools and social assistance facilities at a fine
spatial resolution for all cities included in the project. More
info on the 'AOP' website <https://www.ipea.gov.br/acessooportunidades/en/>.
URL: https://github.com/ipeaGIT/aopdata
URL: https://ipeagit.github.io/aopdata/, https://github.com/ipeaGIT/aopdata
BugReports: https://github.com/ipeaGIT/aopdata/issues
License: MIT + file LICENSE
Encoding: UTF-8
Depends:
R (>= 3.5.0)
Imports:
checkmate,
curl (>= 5.0.0),
data.table,
methods,
sf (>= 0.9-3),
utils
Suggests:
covr,
dplyr (>= 0.8-3),
Expand All @@ -32,13 +39,6 @@ Suggests:
scales,
testthat,
units
Imports:
checkmate,
curl,
data.table,
methods,
sf (>= 0.9-3),
utils
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
VignetteBuilder: knitr
2 changes: 1 addition & 1 deletion r-package/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# aopdata v1.0.4
# aopdata v1.1.0


**Minor changes**
Expand Down
14 changes: 9 additions & 5 deletions r-package/R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ download_data <- function(url, progress_bar = showProgress){
filenames <- basename(url)
url2 <- paste0('https://github.com/ipeaGIT/aopdata/releases/download/v1.0.0/', filenames)

#### 66666 utilizar codigo de {geobr} que soh checa internet se file nao estiver local

# test connection with server1
try( silent = TRUE, check_con <- check_connection(url[1], silent = TRUE))

Expand All @@ -192,11 +194,13 @@ download_data <- function(url, progress_bar = showProgress){
temps <- paste0(tempdir(),"/", unlist(lapply(strsplit(url,"/"),tail,n=1L)))

# download files
downloaded_files <- curl::multi_download(
urls = url,
destfiles = temps,
progress = progress_bar,
resume = TRUE
try(silent = TRUE,
downloaded_files <- curl::multi_download(
urls = url,
destfiles = temps,
progress = progress_bar,
resume = TRUE
)
)

# if anything fails, return NULL
Expand Down
13 changes: 7 additions & 6 deletions r-package/cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
── R CMD check results ────────────────────────── aopdata 1.0.3 ────
Duration: 3m 20.7s

── R CMD check results ───────────────────────────────────────────────── aopdata 1.1.0 ────
Duration: 3m 35.7s

0 errors ✔ | 0 warnings ✔ | 0 notes ✔

# aopdata v1.0.3

**Bug fixes**
# aopdata v1.1.0

**Minor changes**

- Simplified internal functions
- Download functions should now fail gracefully with an informative message when there are internet connection problems. Using a more robust solution now that also accounts for timeout.
- Removed dependency on the {httr} package
- Now using `curl::multi_download()` to download files in parallel

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

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

Loading

0 comments on commit 2ee561a

Please sign in to comment.