Skip to content

Commit

Permalink
fix: calculation of neqs
Browse files Browse the repository at this point in the history
  • Loading branch information
Siel committed Mar 15, 2024
1 parent 49f9609 commit 82a2cd9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/PM_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,7 @@ PM_model_list <- R6::R6Class("PM_model_list",
content <- gsub("</parameter_definition>", parameter_definition %>% paste(collapse = "\n"), content)

eqs <- self$model_list$eqn %>% tolower()
neqs <- stringr::str_extract_all(eqs, "xp\\((\\d)\\)") %>%
unique() %>%
length()
neqs <- sum(sapply(stringr::str_extract_all(eqs, "xp\\[(\\d)\\]"), function(x) length(x) > 0))
if (neqs == 0) {stop("Error: PMcore does not support analytic equations, provide a eqn block.")}
content <- gsub("</neqs>", neqs, content)

Expand Down

0 comments on commit 82a2cd9

Please sign in to comment.