From 1a5b045ca74f09f8517fffe684e063732488e972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20M=C3=A1ty=C3=A1s=20Tam=C3=A1s?= Date: Tue, 31 May 2022 23:11:50 +0000 Subject: [PATCH] removing memory size check for non-linux systems --- DESCRIPTION | 4 ++-- NEWS.md | 6 +++++- R/load_cfg.R | 3 --- inst/tinytest/test_restatapi.R | 11 +---------- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2637aa9..ead6236 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: restatapi Type: Package Title: Search and Retrieve Data from Eurostat Database -Date: 2022-05-23 -Version: 0.13.2 +Date: 2022-06-01 +Version: 0.13.3 Encoding: UTF-8 Authors@R: person("Mátyás", "Mészáros", email = "matyas.meszaros@ec.europa.eu", role = c("aut", "cre")) Description: Eurostat is the statistical office of the European Union and provides high quality statistics for Europe. diff --git a/NEWS.md b/NEWS.md index 7008c34..f1e644c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,11 @@ +# restatapi 0.13.3 + +- removing memory size check for non-linux systems +- CRAN release + # restatapi 0.13.2 - correction of tests as changes in the historical data for "avia_par_me" and "avia_par_is" -- CRAN release # restatapi 0.13.1 diff --git a/R/load_cfg.R b/R/load_cfg.R index ee32de8..d81fcdc 100644 --- a/R/load_cfg.R +++ b/R/load_cfg.R @@ -83,9 +83,6 @@ load_cfg<-function(api_version="current",load_toc=FALSE,parallel=TRUE,max_cores= suppressWarnings(mem_size<-switch(Sys.info()[['sysname']], - Windows={tryCatch({as.numeric(gsub("[^0-9]","",system("wmic MemoryChip get Capacity", intern = TRUE)[2]))/1024/1024},error=function(e){0},warning=function(w){0})}, - # Darwin={tryCatch({as.numeric(substring(system('system_profiler SPHardwareDataType | grep " Memory:"', intern = TRUE), 13))},error=function(e){0},warning=function(w){0})}, - # SunOS={tryCatch({as.numeric(gsub("[^0-9]","",system("prtconf | grep Memory", intern = TRUE,ignore.stderr=TRUE)))},error=function(e){0},warning=function(w){0})}, Linux={tryCatch({as.numeric(system("awk '/MemTotal/ {print $2}' /proc/meminfo",intern=TRUE,ignore.stderr=TRUE))/1024},error=function(e){0},warning=function(w){0})} )) if (is.null(mem_size)|length(mem_size)==0){mem_size<-0} diff --git a/inst/tinytest/test_restatapi.R b/inst/tinytest/test_restatapi.R index fe04098..57d194d 100644 --- a/inst/tinytest/test_restatapi.R +++ b/inst/tinytest/test_restatapi.R @@ -29,16 +29,7 @@ testid12<-"ei_bsfs_q" testid13<-"avia_par_mk" -# suppressWarnings(mem_size<-switch(Sys.info()[['sysname']], -# Windows={tryCatch({as.numeric(gsub("[^0-9]","",system("wmic MemoryChip get Capacity", intern = TRUE)[2]))/1024/1024},error=function(e){0},warning=function(w){0})}, -# Darwin={tryCatch({as.numeric(substring(system('hwprefs memory_size', intern = TRUE), 13))},error=function(e){0},warning=function(w){0})}, -# SunOS={tryCatch({as.numeric(gsub("[^0-9]","",system("prtconf | grep Memory", intern = TRUE,ignore.stderr=TRUE)))},error=function(e){0},warning=function(w){0})}, -# Linux={tryCatch({as.numeric(system("awk '/MemTotal/ {print $2}' /proc/meminfo",intern=TRUE,ignore.stderr=TRUE))/1024},error=function(e){0},warning=function(w){0})} -# )) -# -# test_that("test mem_size",{ -# expect_true(mem_size>1) -# }) + t1<-system.time({xml_toc<-get_eurostat_toc(verbose=TRUE)})[3] txt_toc<-get_eurostat_toc(mode="txt")