Skip to content

Commit

Permalink
bug: create devs bug Q and early rec devs
Browse files Browse the repository at this point in the history
Add check for model with zero Q parameters and exclude early rec devs from recdevs grep so only main period devs are added.
  • Loading branch information
nathanvaughan-NOAA committed Oct 15, 2024
1 parent 06f523f commit a514c6c
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions R/initOM_create_devs_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,26 +138,34 @@ match_parname <- function(list_pars, parlist) {
obj = "SR_parms"
)
)
par_name_tbl <- rbind(
par_name_tbl,
data.frame(
pars = rownames(parlist[["Q_parms"]]),
obj = "Q_parms"
if(!is.null(parlist[["Q_parms"]])){
par_name_tbl <- rbind(
par_name_tbl,
data.frame(
pars = rownames(parlist[["Q_parms"]]),
obj = "Q_parms"
)
)
)
par_name_tbl <- rbind(
par_name_tbl,
data.frame(
pars = rownames(parlist[["S_parms"]]),
obj = "S_parms"
}
if(!is.null(parlist[["S_parms"]])){
par_name_tbl <- rbind(
par_name_tbl,
data.frame(
pars = rownames(parlist[["S_parms"]]),
obj = "S_parms"
)
)
)
}
## Edit to allow for recdevs labeled recdev2 not recdev1
rdnme <- names(parlist)[grepl("recdev", names(parlist))][1]
par_name_tbl <- rbind(par_name_tbl, data.frame(
pars = "rec_devs",
obj = rdnme
))
rdnme <- names(parlist)[grepl("recdev", names(parlist))]
rdnme <- rdnme[!grepl("early", rdnme)]
rdnme <- rdnme[!grepl("forecast", rdnme)]
if(length(rdnme)>=1){
par_name_tbl <- rbind(par_name_tbl, data.frame(
pars = "rec_devs",
obj = rdnme[1]
))
}
par_name_tbl <- rbind(par_name_tbl, data.frame(pars = "impl_error", obj = NA))
if (isTRUE(list_pars == "all")) {
# TODO: consider which parameters should be included in the "all" option.
Expand Down

0 comments on commit a514c6c

Please sign in to comment.