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

[bugfix] read in of value, dvalue on class prj_ph_property

parent da684a11
No related branches found
No related tags found
1 merge request!55[base] update package to OGS6.4.2
...@@ -544,16 +544,22 @@ new_prj_ph_property <- function(name, ...@@ -544,16 +544,22 @@ new_prj_ph_property <- function(name,
are_strings(name, are_strings(name,
type) type)
if (is.list(value)) { if (!is.null(value)) {
are_null_or_strings(value[[1]]) if(is.list(value)){
} else { assertthat::assert_that(names(value[1]) == "expression")
are_null_or_numeric(value) are_null_or_strings(value[[1]])
}else{
are_null_or_numeric(value)
}
} }
if (!is.null(dvalue)) { if (!is.null(dvalue)) {
is_wrapper_list(dvalue, "list")
dvalue <- lapply(dvalue, function(x){ dvalue <- lapply(dvalue, function(x){
are_null_or_strings(x[[1]]) assertthat::assert_that(
x[[2]] <- coerce_string_to_numeric(x[[2]]) all(names(x) %in% c("variable_name", "expression")))
are_null_or_strings(x[["variable_name"]])
x[["expression"]] <- coerce_string_to_numeric(x[["expression"]])
return(x) return(x)
}) })
} }
...@@ -571,15 +577,6 @@ new_prj_ph_property <- function(name, ...@@ -571,15 +577,6 @@ new_prj_ph_property <- function(name,
are_null_or_strings(parameter_name, curve) are_null_or_strings(parameter_name, curve)
# if (!is.null(independent_variable)) {
# independent_variable <- lapply(independent_variable, function(x){
# x <- coerce_names(x,
# c("variable_name",
# "reference_condition",
# "slope"))
# })
# }
if (!is.null(exponent)) { if (!is.null(exponent)) {
exponent <- coerce_names(exponent, exponent <- coerce_names(exponent,
c("variable_name", c("variable_name",
...@@ -763,4 +760,4 @@ new_prj_com_property <- function(name, ...@@ -763,4 +760,4 @@ new_prj_com_property <- function(name,
), ),
class = "prj_com_property" class = "prj_com_property"
) )
} }
\ No newline at end of file
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