Skip to content

Generate example epi_archive on demand. #125

@dajmcdon

Description

@dajmcdon

archive_cases_dv_subset needs to be regenerated or reworked to form an epi_archive from more basic parts on demand; it currently appears to load with the old class definition, missing the extra "\n", plus some bad srcrefs that may make user debugging of tweaked examples harder:

archive_cases_dv_subset$print
<srcref: file "C:/Users/chloe/Desktop/Summer2022/epiprocess/R/archive.R" chars 162:19 to 187:11>
<environment: 0x55c5b02d6358>
Warning message:
In getSrcLines(srcfile, x[7L], x[8L]) :
  restarting interrupted promise evaluation
> body(archive_cases_dv_subset$print)
{
    cat("An `epi_archive` object, with metadata:\n")
    cat(sprintf("* %-9s = %s\n", "geo_type", self$geo_type))
    cat(sprintf("* %-9s = %s\n", "time_type", self$time_type))
    if (!is.null(self$additional_metadata)) {
        sapply(self$additional_metadata, function(m) {
            cat(sprintf("* %-9s = %s\n", names(m), m))
        })
    }
    cat("----------\n")
    cat(sprintf("* %-14s = %s\n", "min time value", min(self$DT$time_value)))
    cat(sprintf("* %-14s = %s\n", "max time value", max(self$DT$time_value)))
    cat(sprintf("* %-14s = %s\n", "min version", min(self$DT$version)))
    cat(sprintf("* %-14s = %s\n", "max version", max(self$DT$version)))
    cat("----------\n")
    cat(sprintf("Data archive (stored in DT field): %i x %i\n", 
        nrow(self$DT), ncol(self$DT)))
    cat("----------\n")
    cat(sprintf("Public methods: %s", paste(names(epi_archive$public_methods), 
        collapse = ", ")))
}

The quick fix is to just regenerate the object + file an Issue to later figure out how to generate the example epi_archive on demand or otherwise ensure that it is current with the implementation of epi_archive.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions