Skip to content

Commit

Permalink
readBindingConstraints update to delete warnings message when .txt fi…
Browse files Browse the repository at this point in the history
…le are empty
  • Loading branch information
BERTHET Clement (Externe) committed Jan 31, 2024
1 parent 38b1673 commit 152cc3a
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions R/readBindingConstraints.R
Original file line number Diff line number Diff line change
Expand Up @@ -184,24 +184,13 @@ readBindingConstraints <- function(opts = simOptions()) {
if(both_case){
check_nrow <- unlist(lapply(tmp_values, nrow))
if(any(check_nrow %in% 0)){
warning("Time series files for binding constraint ",
binding_object$id,
" are empty",
call. = FALSE)

tmp_values[["less"]] <- default_scenarised_values
tmp_values[["greater"]] <- default_scenarised_values
}
}
else
if(nrow(tmp_values)==0){
warning("Time series file for binding constraint ",
binding_object$id,
" is empty",
call. = FALSE)
if(nrow(tmp_values)==0)
tmp_values <- default_scenarised_values
}

# return
binding_object$values <- tmp_values
return(binding_object)
Expand Down

0 comments on commit 152cc3a

Please sign in to comment.