Skip to content

Commit 7f54f74

Browse files
committed
Change pipeline information in print
1 parent 8da9f97 commit 7f54f74

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

R/Graph.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,13 @@ Graph = R6Class("Graph",
424424
print(lines, row.names = FALSE)
425425
})
426426

427-
if(all(!duplicated(self$edges[["src_id"]]))) {
427+
is_sequential = all(table(self$edges$src_id) <= 1) && all(table(self$edges$dst_id) <= 1)
428+
if(is_sequential) {
428429
ppunit = paste0(self$ids(), collapse = " -> ")
430+
pp = paste0(c("<INPUT>", ppunit, "<OUTPUT>"), collapse = " -> ")
429431
} else {
430-
ppunit = "<SUPPRESSED>"
432+
pp = "non-sequential"
431433
}
432-
pp = paste0(c("<INPUT>", ppunit, "<OUTPUT>"), collapse = " -> ")
433434
cat_cli(cli_h3("Pipeline: {.strong {pp}}"))
434435
} else {
435436
cat("Empty Graph.\n")

R/GraphLearner.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,13 @@ GraphLearner = R6Class("GraphLearner", inherit = Learner,
316316
print = function() {
317317
super$print(self)
318318

319-
if(all(!duplicated(self$edges[["src_id"]]))) {
319+
is_sequential = all(table(self$edges$src_id) <= 1) && all(table(self$edges$dst_id) <= 1)
320+
if(is_sequential) {
320321
ppunit = paste0(self$ids(), collapse = " -> ")
322+
pp = paste0(c("<INPUT>", ppunit, "<OUTPUT>"), collapse = " -> ")
321323
} else {
322-
ppunit = "<SUPPRESSED>"
324+
pp = "non-sequential"
323325
}
324-
pp = paste0(c("<INPUT>", ppunit, "<OUTPUT>"), collapse = " -> ")
325326
cat_cli(cli_h3("Pipeline: {.strong {pp}}"))
326327
}
327328
),

0 commit comments

Comments
 (0)