Skip to content

Commit

Permalink
two objects of the same class
Browse files Browse the repository at this point in the history
  • Loading branch information
dajmcdon committed Jun 17, 2023
1 parent ea48355 commit 206f0ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ S3method(print,arx_class)
S3method(print,arx_fcast)
S3method(print,canned_epipred)
S3method(print,epi_workflow)
S3method(print,flat_fcast)
S3method(print,flatline)
S3method(print,frosting)
S3method(print,layer_add_forecast_date)
Expand Down
8 changes: 4 additions & 4 deletions R/flatline_forecaster.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ flatline_forecaster <- function(
args_list = flatline_args_list()) {

validate_forecaster_inputs(epi_data, outcome, "time_value")
if (!inherits(args_list, c("flatline", "alist"))) {
if (!inherits(args_list, c("flat_fcast", "alist"))) {
cli_stop("args_list was not created using `flatline_args_list().")
}
keys <- epi_keys(epi_data)
Expand Down Expand Up @@ -77,7 +77,7 @@ flatline_forecaster <- function(
training = attr(epi_data, "metadata"),
forecast_created = Sys.time()
)),
class = c("flatline", "canned_epipred")
class = c("flat_fcast", "canned_epipred")
)
}

Expand Down Expand Up @@ -125,12 +125,12 @@ flatline_args_list <- function(
symmetrize,
nonneg,
quantile_by_key),
class = c("flatline", "alist")
class = c("flat_fcast", "alist")
)
}

#' @export
print.flatline <- function(x, ...) {
print.flat_fcast <- function(x, ...) {
name <- "flatline"
NextMethod(name = name, ...)
}

0 comments on commit 206f0ef

Please sign in to comment.