@@ -278,18 +278,23 @@ PipeOp = R6Class("PipeOp",
278278
279279 print = function (... ) {
280280 type_table_printout = function (table ) {
281- strings = do.call(sprintf , cbind(fmt = " %s`[%s,%s]" , table [, c(" name" , " train" , " predict" )]))
282- strings = strwrap(paste(strings , collapse = " , " ), indent = 2 , exdent = 2 )
283- if (length(strings ) > 6 ) {
284- strings = c(strings [1 : 5 ], sprintf(" [... (%s lines omitted)]" , length(strings ) - 5 ))
281+ print(head(table , 5L ), row.names = FALSE , print.keys = FALSE )
282+ if (nrow(table ) > 5L ) {
283+ catf(" [...] (%i rows omitted)" , nrow(table ) - 5L )
285284 }
286- gsub(" `" , " " , paste(strings , collapse = " \n " ))
287285 }
288286
289- catf(" PipeOp: <%s> (%strained)" , self $ id , if (self $ is_trained ) " " else " not " )
290- catf(" values: <%s>" , as_short_string(self $ param_set $ values ))
291- catf(" Input channels <name [train type, predict type]>:\n %s" , type_table_printout(self $ input ))
292- catf(" Output channels <name [train type, predict type]>:\n %s" , type_table_printout(self $ output ))
287+ msg_h = if (self $ is_trained ) " " else " not "
288+ cat_cli({
289+ cli_h1(" PipeOp {.cls {self$id}}: {msg_h}trained" )
290+ cli_text(" Values: {as_short_string(self$param_set$values)}" )
291+ cli_h3(" {.strong Input channels:}" )
292+ })
293+ type_table_printout(self $ input )
294+ cat_cli({
295+ cli_h3(" {.strong Output channels:}" )
296+ })
297+ type_table_printout(self $ output )
293298 },
294299
295300 train = function (input ) {
0 commit comments