Skip to content

Commit

Permalink
removing memory size check for non-linux systems
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatyi committed May 31, 2022
1 parent e55a2da commit 1a5b045
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]", role = c("aut", "cre"))
Description: Eurostat is the statistical office of the European Union and provides high quality statistics for Europe.
Expand Down
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 0 additions & 3 deletions R/load_cfg.R
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
11 changes: 1 addition & 10 deletions inst/tinytest/test_restatapi.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 1a5b045

Please sign in to comment.