Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ogs
OpenGeoSys Tools
r2ogs6
Commits
60a1cd1a
Commit
60a1cd1a
authored
Mar 11, 2021
by
Ruben Heinrich
Browse files
[base] added ogs6_py_install function and prompt in OGS6_vtu class
parent
3f7ff9be
Changes
1
Hide whitespace changes
Inline
Side-by-side
R/ogs6_vtu.R
View file @
60a1cd1a
...
...
@@ -14,6 +14,18 @@ OGS6_vtu <- R6::R6Class(
#' @param vtu_path string: Path to .vtu file
initialize
=
function
(
vtu_path
)
{
if
(
!
reticulate
::
py_module_available
(
"vtk"
)){
install
<-
askYesNo
(
paste
(
"Python module `vtk` was not found."
,
"Install `vtk`?"
))
if
(
is.na
(
install
)
||
!
install
){
stop
(
paste
(
"Python module `vtk` is required for `OGS6_vtu`"
,
"initialization."
),
call.
=
FALSE
)
}
ogs6_py_install
()
}
vtk_xml_ugr
<-
vtk
$
vtkXMLUnstructuredGridReader
()
vtk_xml_ugr
$
SetFileName
(
vtu_path
)
vtk_xml_ugr
$
Update
()
...
...
@@ -326,6 +338,20 @@ validate_coordinates <- function(coordinates){
}
#===== ogs6_py_install =====
#' Install Python dependencies
#'
#' Wrapper for `reticulate::py_install`. Installs the `vtk` library.
#'
#' @inheritParams reticulate::py_install
#' @export
ogs6_py_install
<-
function
(
method
=
"auto"
,
conda
=
"auto"
)
{
reticulate
::
py_install
(
"vtk"
,
method
=
method
,
conda
=
conda
)
}
#===== ogs6_generate_structured_mesh =====
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment