Skip to content

Commit

Permalink
Merge pull request #256 from rte-antares-rpackage/ant1973
Browse files Browse the repository at this point in the history
fread_antares() shiny compatible
  • Loading branch information
boitardn authored Aug 29, 2024
2 parents 1036461 + 8aca5e3 commit 64e60ba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ importFrom(plyr,llply)
importFrom(purrr,quietly)
importFrom(shiny,getDefaultReactiveDomain)
importFrom(shiny,incProgress)
importFrom(shiny,isRunning)
importFrom(shiny,withProgress)
importFrom(stats,as.formula)
importFrom(stats,setNames)
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ NEW FEATURES:
It contains a table with group dimensions of time series for binding constraints.
* `readAntares()` new parameter **clustersST** to read (output simulation) short-term clusters
* New function `readAntaresSTClusters()`

* `fread_antares()` shiny compatible with a conditional processing of the error messages

BREAKING CHANGES :

Expand Down
6 changes: 5 additions & 1 deletion R/utils_api.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#' @importFrom utils URLencode
#' @importFrom shiny isRunning
fread_antares <- function(opts, file, ...) {
if (identical(opts$typeLoad, "api")) {
file <- gsub("\\.txt$", "", file)
Expand All @@ -9,7 +10,10 @@ fread_antares <- function(opts, file, ...) {
)
suppressWarnings(
tryCatch(fread(response, ...), error = function(e){
message(file); message(e)
if(isRunning())
e <- as.character(e)
message(file)
message(e)
}))
} else {
suppressWarnings(
Expand Down

0 comments on commit 64e60ba

Please sign in to comment.