Skip to content
Snippets Groups Projects
Commit daf70cc5 authored by Ruben Heinrich's avatar Ruben Heinrich
Browse files

[base] added call to config package to onLoad method

parent c4d986fc
No related branches found
No related tags found
1 merge request!20Resolve "Prepare package for installation"
...@@ -9,49 +9,27 @@ vtk <- NULL ...@@ -9,49 +9,27 @@ vtk <- NULL
op <- options() op <- options()
op.r2ogs6 <- list( op.r2ogs6 <- list(
# Default paths # Default paths
r2ogs6.default_sim_path = "", r2ogs6.default_sim_path = NULL,
r2ogs6.default_script_path = "", r2ogs6.default_script_path = NULL,
r2ogs6.default_benchmark_path = "", r2ogs6.default_benchmark_path = NULL,
r2ogs6.default_ogs6_processlib_path = "", r2ogs6.default_ogs6_processlib_path = NULL,
r2ogs6.default_ogs6_bin_path = "", r2ogs6.default_ogs6_bin_path = NULL,
r2ogs6.max_lines_gml = 300, r2ogs6.max_lines_gml = NULL
# External file reference tags
# Reticulate setting for reading in VTK
r2ogs6.use_python = ""
) )
toset <- !(names(op.r2ogs6) %in% names(op)) toset <- !(names(op.r2ogs6) %in% names(op))
if (any(toset)) options(op.r2ogs6[toset]) if (any(toset)) options(op.r2ogs6[toset])
# use superassignments to update global Python references cfg <- config::get()
vtk <<- reticulate::import("vtk", delay_load = TRUE)
test_config <- TRUE
if (test_config) { for(i in names(op.r2ogs6)){
options( eval(parse(text = paste0("options(", i, " = cfg$", i, ")")))
r2ogs6.default_sim_path = "D:/OGS_sims/",
r2ogs6.default_script_path = "D:/OGS_scripts/",
r2ogs6.default_benchmark_path =
"D:/Programme/OpenGeoSys/ogs-master/Tests/Data/",
r2ogs6.default_ogs6_processlib_path =
"D:/Programme/OpenGeoSys/ogs-master/ProcessLib/",
r2ogs6.default_ogs6_bin_path =
paste0(
"D:/Programme/OpenGeoSys/",
"ogs-6.3.3-Windows-10.0.14393-python-3.7.2-de-utils",
"/bin/"
),
r2ogs6.max_lines_gml = 300,
r2ogs6.use_python = "D:/Programme/anaconda3/envs/rtest/python.exe"
)
reticulate::use_virtualenv(unlist(options("r2ogs6.use_python")))
} }
invisible() # use superassignments to update global Python references
vtk <<- reticulate::import("vtk", delay_load = TRUE)
return(invisible())
} }
......
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