Skip to content

Commit

Permalink
fix duplicate vary_params bug (#188)
Browse files Browse the repository at this point in the history
* If the same parameter is varies across different DGPs, only show this parameter once in `vary_params`
* Same applies to parameters that are varied across multiple methods
* Closes #187
  • Loading branch information
tiffanymtang authored Mar 13, 2024
1 parent b4414f2 commit 1e0767f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/experiment.R
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ Experiment <- R6::R6Class(
return(NULL)
} else {
return(purrr::map(x, names) %>%
purrr::reduce(c))
purrr::reduce(c) %>%
unique())
}
})
param_names <- purrr::reduce(param_names_ls, c)
Expand Down Expand Up @@ -390,6 +391,7 @@ Experiment <- R6::R6Class(
}
return(out_params)
},

.get_obj_params = function(field_name = c("evaluator", "visualizer"),
obj_list) {
field_name <- match.arg(field_name)
Expand Down Expand Up @@ -707,6 +709,7 @@ Experiment <- R6::R6Class(
paste("Varying", param_names))
return(save_dir)
},

deep_clone = function(name, value) {
if (is.list(value) && length(value) > 0 && inherits(value[[1]], "R6")) {
lapply(value, function(v) v$clone(deep = TRUE))
Expand Down

0 comments on commit 1e0767f

Please sign in to comment.