Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebaron committed Jul 11, 2024
1 parent 8133f97 commit 56c0e49
Show file tree
Hide file tree
Showing 5 changed files with 1,018 additions and 989 deletions.
14 changes: 7 additions & 7 deletions R/mwrite.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ mwrite_model_to_list <- function(x) {
if(nrow(x@annot$data)) {
annot <- x@annot$data
annot$options <- NULL
if(!requireNamespace("knitr", quietly = TRUE)) {
abort("The package \"knitr\" is required.")
}
if(!requireNamespace("knitr", quietly = TRUE)) {
abort("The package \"knitr\" is required.") #nocov
}
annot <- knitr::kable(annot, format = "simple")
annot <- c("# Annotations: ", "", annot)
if("PROB" %in% names(code)) {
Expand Down Expand Up @@ -144,7 +144,7 @@ mwrite_model_to_list <- function(x) {
#' @export
mwrite_yaml <- function(x, file = NULL, digits = 8) {
if(!requireNamespace("yaml", quietly = TRUE)) {
abort("The package \"yaml\" is required.")
abort("The package \"yaml\" is required.") #nocov
}
l <- mwrite_model_to_list(x)
l$format <- "yaml"
Expand All @@ -160,7 +160,7 @@ mwrite_yaml <- function(x, file = NULL, digits = 8) {
#' @export
mwrite_json <- function(x, file = NULL, digits = 8) {
if(!requireNamespace("jsonlite", quietly = TRUE)) {
abort("The package \"jsonlite\" is required.")
abort("The package \"jsonlite\" is required.") #nocov
}
l <- mwrite_model_to_list(x)
l$format <- "json"
Expand Down Expand Up @@ -230,15 +230,15 @@ mread_json <- function(file, model = basename(file), project = tempdir(), ...) {

parse_yaml <- function(file) {
if(!requireNamespace("yaml", quietly = TRUE)) {
abort("The package \"yaml\" is required.")
abort("The package \"yaml\" is required.") #nocov-start
}
text <- readLines(file)
yaml::yaml.load(text)
}

parse_json <- function(file) {
if(!requireNamespace("jsonlite", quietly = TRUE)) {
abort("The package \"jsonlite\" is required.")
abort("The package \"jsonlite\" is required.") #nocov-start
}
text <- readLines(file)
jsonlite::fromJSON(text)
Expand Down
29 changes: 15 additions & 14 deletions inst/maintenance/unit/coverage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coverage: 78.76%
# coverage: 80.09%

|file | coverage|
|:---------------------|--------:|
Expand All @@ -8,37 +8,38 @@
|R/class_tgrid.R | 56.06|
|R/mrgsims.R | 58.33|
|R/generics.R | 60.00|
|R/update.R | 62.98|
|R/chain.R | 63.16|
|R/knobs.R | 64.76|
|R/update.R | 67.65|
|R/utils.R | 70.35|
|R/matlist.R | 70.42|
|R/model_include.R | 71.15|
|R/handle_spec_block.R | 73.25|
|R/relabel.R | 74.14|
|R/data_set.R | 75.16|
|R/class_mrgmod.R | 75.27|
|R/class_ev.R | 77.65|
|R/param.R | 78.57|
|R/modspec.R | 78.60|
|R/handle_spec_block.R | 75.19|
|R/class_mrgmod.R | 77.14|
|R/class_ev.R | 77.91|
|R/modspec.R | 79.71|
|R/param.R | 79.76|
|R/realize_addl.R | 80.65|
|R/init.R | 81.25|
|R/workflows.R | 81.25|
|R/compile.R | 81.82|
|R/class_build.R | 81.93|
|R/class_numericlist.R | 83.33|
|R/env.R | 84.21|
|R/events.R | 84.39|
|R/events.R | 84.44|
|R/mrgindata.R | 84.62|
|R/nmxml.R | 86.10|
|R/compile.R | 87.16|
|R/class_evd.R | 87.50|
|R/class_mrgsims.R | 87.50|
|R/mrgsolve.R | 88.86|
|R/mrgsim_q.R | 89.13|
|R/class_rx.R | 91.43|
|R/mrgsim_q.R | 87.76|
|R/mrgsolve.R | 89.15|
|R/funset.R | 92.31|
|R/mread.R | 95.92|
|R/class_rx.R | 92.86|
|R/inven.R | 96.10|
|R/nm-mode.R | 96.55|
|R/mread.R | 96.58|
|R/class_matlist.R | 100.00|
|R/inven.R | 100.00|
|R/mcode.R | 100.00|
|R/mwrite.R | 100.00|
Loading

0 comments on commit 56c0e49

Please sign in to comment.