Skip to content

Commit 8aec6b5

Browse files
committed
remove old print_frosting function
1 parent b456aa3 commit 8aec6b5

File tree

3 files changed

+4
-35
lines changed

3 files changed

+4
-35
lines changed

NAMESPACE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ S3method(print,canned_epipred)
5555
S3method(print,epi_workflow)
5656
S3method(print,flat_fcast)
5757
S3method(print,flatline)
58-
S3method(print,frosting)
5958
S3method(print,layer_add_forecast_date)
6059
S3method(print,layer_add_target_date)
6160
S3method(print,layer_naomit)
@@ -145,6 +144,8 @@ export(new_default_epi_recipe_blueprint)
145144
export(new_epi_recipe_blueprint)
146145
export(pivot_quantiles)
147146
export(prep)
147+
export(print_frosting)
148+
export(print_preprocessor_recipe)
148149
export(quantile_reg)
149150
export(remove_frosting)
150151
export(slather)

R/epi_recipe.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ kill_levels <- function(x, keys) {
398398
x
399399
}
400400

401+
#' @export
402+
# Currently only used in the workflow printing
401403
print_preprocessor_recipe <- function (x) {
402404

403405
recipe <- workflows::extract_preprocessor(x)

R/frosting.R

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -302,40 +302,6 @@ print_frosting <- function(x, ...) {
302302
invisible(x)
303303
}
304304

305-
# Currently only used in the workflow printing
306-
print_frosting <- function(x, ...) {
307-
308-
layers <- x$layers
309-
n_layers <- length(layers)
310-
layer <- ifelse(n_layers == 1L, "Layer", "Layers")
311-
n_layers_msg <- glue::glue("{n_layers} Frosting {layer}")
312-
cat_line(n_layers_msg)
313-
314-
if (n_layers == 0L) return(invisible(x))
315-
316-
cat_line("")
317-
318-
layer_names <- map_chr(layers, pull_layer_name)
319-
320-
if (n_layers <= 10L) {
321-
cli::cat_bullet(layer_names)
322-
return(invisible(x))
323-
}
324-
325-
extra_layers <- n_layers - 10L
326-
layer_names <- layer_names[1:10]
327-
328-
layer <- ifelse(extra_layers == 1L, "layer", "layers")
329-
330-
extra_dots <- "..."
331-
extra_msg <- glue::glue("and {extra_layers} more {layer}.")
332-
333-
layer_names <- c(layer_names, extra_dots, extra_msg)
334-
335-
cli::cat_bullet(layer_names)
336-
invisible(x)
337-
}
338-
339305
print_postprocessor <- function(x) {
340306
if (!has_postprocessor_frosting(x)) return(invisible(x))
341307

0 commit comments

Comments
 (0)