Commit db2c5bad authored by Dorchies David's avatar Dorchies David
Browse files

fix: check errors

1 merge request!6Resolve "Read result simulation in sections from a binary result files"
Showing with 15 additions and 10 deletions
+15 -10
...@@ -20,5 +20,7 @@ RoxygenNote: 7.1.2 ...@@ -20,5 +20,7 @@ RoxygenNote: 7.1.2
Roxygen: list(markdown = TRUE) Roxygen: list(markdown = TRUE)
Imports: Imports:
logger, logger,
magrittr,
terra, terra,
tidyquery tidyquery,
xml2
...@@ -20,4 +20,3 @@ export(sic_run_fortran) ...@@ -20,4 +20,3 @@ export(sic_run_fortran)
export(split_reach) export(split_reach)
import(magrittr) import(magrittr)
import(xml2) import(xml2)
importFrom(rlang,parse_expr)
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
#' @export #' @export
#' #'
#' @examples #' @examples
#' convert_sic_params(list(SCE = 1, VAR = 1)) #' cfg <- cfg_tmp_project()
#' convert_sic_params(list(SCE = 1, VAR = 1), cfg = cfg)
#' #'
convert_sic_params <- function(params, cfg = loadConfig()) { convert_sic_params <- function(params, cfg = loadConfig()) {
if (!"INTERF" %in% names(params)) { if (!"INTERF" %in% names(params)) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#' @export #' @export
#' @examples #' @examples
#' # Trapezoidal section #' # Trapezoidal section
#' export_section_txt("Trapeze", 0, "T", list(B = 2, S = 1.5, ZF = 100, ZB = 102)) #' create_section_txt("Trapeze", 0, "T", list(B = 2, S = 1.5, ZF = 100, ZB = 102))
create_section_txt <- function(section_name, abscissa, section_type, profile, distance_majeur = FALSE) { create_section_txt <- function(section_name, abscissa, section_type, profile, distance_majeur = FALSE) {
if (section_type == "T") { if (section_type == "T") {
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#' #'
#' @return #' @return
#' @export #' @export
#' @importFrom rlang parse_expr
#' @import magrittr #' @import magrittr
#' #'
#' @examples #' @examples
......
...@@ -21,6 +21,7 @@ This function is called by \link{sic_run_fortran} to convert list of parameters ...@@ -21,6 +21,7 @@ This function is called by \link{sic_run_fortran} to convert list of parameters
The parameter \code{INTERF} is set to 0 (zero) by default. The parameter \code{INTERF} is set to 0 (zero) by default.
} }
\examples{ \examples{
convert_sic_params(list(SCE = 1, VAR = 1)) cfg <- cfg_tmp_project()
convert_sic_params(list(SCE = 1, VAR = 1), cfg = cfg)
} }
...@@ -31,5 +31,5 @@ Export a section in importation SIC format ...@@ -31,5 +31,5 @@ Export a section in importation SIC format
} }
\examples{ \examples{
# Trapezoidal section # Trapezoidal section
export_section_txt("Trapeze", 0, "T", list(B = 2, S = 1.5, ZF = 100, ZB = 102)) create_section_txt("Trapeze", 0, "T", list(B = 2, S = 1.5, ZF = 100, ZB = 102))
} }
...@@ -6,15 +6,18 @@ profT <- list( ...@@ -6,15 +6,18 @@ profT <- list(
) )
test_that("Trapezoidal minor section", { test_that("Trapezoidal minor section", {
profT2 <- profT
profT2$ZF <- 99
profT2$ZB <- 101
expect_equal( expect_equal(
create_uniform_reach_txt(abscissas = c(1000, 2000), create_uniform_reach_txt(abscissas = c(1000, 2000),
upstream_bed_elevation = 100, upstream_bed_elevation = 100,
slope = 0.001, slope = 0.001,
section_type = "T", section_type = "T",
profile = profT), profile = profT)[1:2],
list( list(
"00001000" = c("Section x=1000 $ 1000 $ $ 0 $ T", "2\t1", "102\t100"), "00001000" = create_section_txt("Section x=1000", 1000, "T", profT),
"00002000" = c("Section x=2000 $ 2000 $ $ 0 $ T", "2\t1", "101\t99") "00002000" = create_section_txt("Section x=2000", 2000, "T", profT2)
) )
) )
}) })
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment