ropensci / beautier

@@ -100,7 +100,7 @@
Loading
100 100
    "<logger ",
101 101
    "id=\"tracelog\" "
102 102
  )
103 -
  if (inference_model$mcmc$tracelog$filename != "") {
103 +
  if (is.na(inference_model$mcmc$tracelog$filename)) {
104 104
    # Alignment IDs
105 105
    ids <- beautier::get_alignment_id(
106 106
      input_filename,
@@ -112,6 +112,12 @@
Loading
112 112
      top_line,
113 113
      "fileName=\"", filename, ".log\" "
114 114
    )
115 +
  } else {
116 +
    testit::assert(!is.na(inference_model$mcmc$tracelog$filename))
117 +
    top_line <- paste0(
118 +
      top_line,
119 +
      "fileName=\"", inference_model$mcmc$tracelog$filename, "\" "
120 +
    )
115 121
  }
116 122
  top_line <- paste0(
117 123
    top_line,

@@ -1,5 +1,8 @@
Loading
1 1
#' Create a \code{tracelog} object
2 -
#' @param filename name of the file to store the posterior traces
2 +
#' @param filename
3 +
#'   name of the file to store the posterior traces.
4 +
#'   Use \link{NA} to use the filename \code{[alignment_id].log},
5 +
#'   where \code{alignment_id} is obtained using \link{get_alignment_id}
3 6
#' @param log_every number of MCMC states between the logging of that state
4 7
#' phylogenies to. By default, this is \code{$(trace).traces}
5 8
#' @param mode mode how to log.
@@ -10,7 +13,7 @@
Loading
10 13
#' Valid values are the ones returned by \link{get_log_sorts}
11 14
#' @export
12 15
create_tracelog <- function(
13 -
  filename = "test_output_0.log",
16 +
  filename = NA,
14 17
  log_every = 1000,
15 18
  mode = "autodetect",
16 19
  sanitise_headers = TRUE,

@@ -44,8 +44,10 @@
Loading
44 44
#' @noRd
45 45
check_tracelog_list_element_values <- function(tracelog) {
46 46
47 -
  assertive::assert_is_character(tracelog$filename)
48 -
  assertive::assert_is_a_string(tracelog$filename)
47 +
  if (!beautier::is_one_na(tracelog$filename)) {
48 +
    assertive::assert_is_character(tracelog$filename)
49 +
    assertive::assert_is_a_string(tracelog$filename)
50 +
  }
49 51
  assertive::assert_is_numeric(tracelog$log_every)
50 52
  assertive::assert_all_are_positive(tracelog$log_every)
51 53
  beautier::check_log_mode(tracelog$mode)
Files Coverage
R 99.48%
Project Totals (228 files) 99.48%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading