Skip to content

Commit

Permalink
Merge pull request #3262 from DongchenZ/develop
Browse files Browse the repository at this point in the history
Bug fixes for the progress bar in the qub_parallel function and Q type identification in the analysis_SDA_block function.
  • Loading branch information
mdietze authored Feb 21, 2024
2 parents 5b9778b + 9b0a728 commit ea75942
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions base/remote/R/qsub_parallel.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ qsub_parallel <- function(settings, files = NULL, prefix = "sipnet.out", sleep =
folders <- file.path(settings$host$outdir, run_list)
L_folder <- length(folders)
pb <- utils::txtProgressBar(min = 0, max = L_folder, style = 3)
pbi <- 0
#here we not only detect if the target files are generated.
#we also detect if the jobs are still existed on the server.
if (is_rabbitmq) {
Expand All @@ -121,7 +120,6 @@ qsub_parallel <- function(settings, files = NULL, prefix = "sipnet.out", sleep =
} else {
L_jobid <- length(jobids)
pb1 <- utils::txtProgressBar(min = 0, max = L_jobid, style = 3)
pb1 <- 0
if (hybrid) {
while ((L_folder - length(folders)) < L_folder &
(L_jobid - length(jobids)) < L_jobid) {
Expand Down
4 changes: 2 additions & 2 deletions modules/assim.sequential/R/Analysis_sda_block.R
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,11 @@ MCMC_Init <- function (block.list, X) {
}
#initialize q.
#if we want the vector q.
if (block.list[[i]]$constant$q.type == 1) {
if (block.list[[i]]$constant$q.type == 3) {
for (j in seq_along(block.list[[i]]$data$y.censored)) {
block.list[[i]]$Inits$q <- c(block.list[[i]]$Inits$q, stats::rgamma(1, shape = block.list[[i]]$data$aq[j], rate = block.list[[i]]$data$bq[j]))
}
} else if (block.list[[i]]$constant$q.type == 2) {
} else if (block.list[[i]]$constant$q.type == 4) {
#if we want the wishart Q.
if ("try-error" %in% class(try(block.list[[i]]$Inits$q <-
stats::rWishart(1, df = block.list[[i]]$data$bq, Sigma = block.list[[i]]$data$aq)[,,1], silent = T))) {
Expand Down

0 comments on commit ea75942

Please sign in to comment.