Skip to content

Commit

Permalink
feat: adds graceful exit when epgap does not converge
Browse files Browse the repository at this point in the history
When the time limit (tilim) is reached but the epgap has not reached its threshold, JaBbA would still spit out an output (which was usually garbage/uninterpretable). Now it gracefully exits with an error message, suggesting the user increase the tilim.
  • Loading branch information
shihabdider committed May 21, 2024
1 parent b4d4b01 commit 020bb89
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/JaBbA.R
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,11 @@ JaBbA = function(## Two required inputs
QCStats(inputDT=data.table(pair=name,inputdir=outdir),outdir=outdir)
}
setwd(cdir)
# exit with error if epgap did not converge
sol_epgap = jab$nodes$gr$epgap %>% unique
if (sol_epgap > opt$epgap) {
stop(paste("JaBbA did not converge. Try increasing the tilim. Final epgap:", sol_epgap))
}
return(jab)
}

Expand Down

0 comments on commit 020bb89

Please sign in to comment.