Skip to content

Commit 58d04cc

Browse files
committed
summarise_by_instance() only tries to truncate the common root path if trainInstancesDir is not empty.
1 parent ada8d62 commit 58d04cc

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
* Requires ggplot2 >= 3.4.0 to silence deprecation warnings.
44
* `report()` now defaults to `irace.Rdata` so that it is even easier to use.
5+
* `summarise_by_instance()` only tries to truncate the common root path if
6+
`trainInstancesDir` is not empty.
57

68
# iraceplot 2.1
79

R/summarise_by_instance.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ summarise_by_instance <- function(irace_results)
3737
mutate(seeds = seeds_by_instance[as.character(instance)], .after="instance") %>%
3838
mutate(experiments = exp_by_instance[as.character(instance)], .after="instance")
3939

40-
if (is.character(byinstance$instance)) {
40+
# Only try this if the instances are paths.
41+
if (is.character(byinstance$instance) && isTRUE(nzchar(irace_results$scenario$trainInstancesDir))) {
4142
rel_inst <- as.character(path_rel(byinstance$instance, start = path_common(byinstance$instance)))
4243
# We want the instances to be unique still, otherwise don't touch them.
4344
if (length(unique(rel_inst)) == length(byinstance$instance)) {

0 commit comments

Comments
 (0)