Skip to content
Snippets Groups Projects
Commit bf765bfa authored by Johannes Boog's avatar Johannes Boog
Browse files

[base] option to limit benchmark script generation to provided list of PRJ files

parent df79b20b
No related branches found
No related tags found
1 merge request!31[docs] examples polished
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#' @inheritParams ogs6_generate_benchmark_script #' @inheritParams ogs6_generate_benchmark_script
#' @param starting_from_prj_path string: Optional: `.prj` path to start from #' @param starting_from_prj_path string: Optional: `.prj` path to start from
#' @param skip_prj_paths character: Optional: `.prj` paths to skip #' @param skip_prj_paths character: Optional: `.prj` paths to skip
#' @param only_prj_files character: Optional: `.prj` files to limit to.
#' @export #' @export
ogs6_generate_benchmark_scripts <- ogs6_generate_benchmark_scripts <-
function(path, function(path,
...@@ -18,7 +19,8 @@ ogs6_generate_benchmark_scripts <- ...@@ -18,7 +19,8 @@ ogs6_generate_benchmark_scripts <-
read_in_gml, read_in_gml,
read_in_vtu = FALSE, read_in_vtu = FALSE,
starting_from_prj_path = "", starting_from_prj_path = "",
skip_prj_paths = character()){ skip_prj_paths = character(),
only_prj_files = character()){
if(missing(path)){ if(missing(path)){
path <- unlist(options("r2ogs6.default_benchmark_path")) path <- unlist(options("r2ogs6.default_benchmark_path"))
...@@ -40,6 +42,7 @@ ogs6_generate_benchmark_scripts <- ...@@ -40,6 +42,7 @@ ogs6_generate_benchmark_scripts <-
script_path <- as_dir_path(script_path) script_path <- as_dir_path(script_path)
assertthat::assert_that(assertthat::is.string(starting_from_prj_path)) assertthat::assert_that(assertthat::is.string(starting_from_prj_path))
assertthat::assert_that(is.character(skip_prj_paths)) assertthat::assert_that(is.character(skip_prj_paths))
assertthat::assert_that(is.character(only_prj_files))
prj_paths <- list.files(path = path, prj_paths <- list.files(path = path,
pattern = "\\.prj$", pattern = "\\.prj$",
...@@ -78,6 +81,12 @@ ogs6_generate_benchmark_scripts <- ...@@ -78,6 +81,12 @@ ogs6_generate_benchmark_scripts <-
next next
} }
if(!(missing(only_prj_files))){
if(!(basename(prj_paths[[i]]) %in% only_prj_files)){
next
}
}
# cat("\nGenerating script from path", prj_paths[[i]]) # cat("\nGenerating script from path", prj_paths[[i]])
# Put simulations in their own subfolders under sim_path # Put simulations in their own subfolders under sim_path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment