diff --git a/DESCRIPTION b/DESCRIPTION index ad61b48fe74be0c5d7b57b508558b14aba5938a9..11207c5d45aa004bd20298a40c2601c37be80435 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,5 +20,7 @@ RoxygenNote: 7.1.2 Roxygen: list(markdown = TRUE) Imports: logger, + magrittr, terra, - tidyquery + tidyquery, + xml2 diff --git a/NAMESPACE b/NAMESPACE index 61371cb73ce1e8e19069e5fe811cbf7cf6ee279b..ad1a24b82e4d51b12edb4af032d93b94b9d24f42 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -20,4 +20,3 @@ export(sic_run_fortran) export(split_reach) import(magrittr) import(xml2) -importFrom(rlang,parse_expr) diff --git a/R/convert_sic_params.R b/R/convert_sic_params.R index 7b674e60199df0b2b90505c7433292366df9feed..a3a4f37cb6403872eb60b330e563547aafc340f0 100644 --- a/R/convert_sic_params.R +++ b/R/convert_sic_params.R @@ -11,7 +11,8 @@ #' @export #' #' @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()) { if (!"INTERF" %in% names(params)) { diff --git a/R/create_section_txt.R b/R/create_section_txt.R index 8f38a251869d5d95b1c4e5bff00a623df577e3d3..ed7e7590785fcbca5b26e0351129f7256da0c4a9 100644 --- a/R/create_section_txt.R +++ b/R/create_section_txt.R @@ -10,7 +10,7 @@ #' @export #' @examples #' # 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) { if (section_type == "T") { diff --git a/R/get_result.R b/R/get_result.R index aa91ab5b097b388e4f1491073f49ed27c1d31430..b2a41975632c6e13cbb010178c070948a123008c 100644 --- a/R/get_result.R +++ b/R/get_result.R @@ -6,7 +6,6 @@ #' #' @return #' @export -#' @importFrom rlang parse_expr #' @import magrittr #' #' @examples diff --git a/man/convert_sic_params.Rd b/man/convert_sic_params.Rd index 83537b4bbaae7ced862991afaf47221ef42a0a6b..76bd523b5346be1c4fe0e996b5d54845908cf44f 100644 --- a/man/convert_sic_params.Rd +++ b/man/convert_sic_params.Rd @@ -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. } \examples{ -convert_sic_params(list(SCE = 1, VAR = 1)) +cfg <- cfg_tmp_project() +convert_sic_params(list(SCE = 1, VAR = 1), cfg = cfg) } diff --git a/man/create_section_txt.Rd b/man/create_section_txt.Rd index cd02ce1b2d7cc5467c1f085432653c477936510d..eecc674e690e2eb823d5a955191a8cfe436ede8a 100644 --- a/man/create_section_txt.Rd +++ b/man/create_section_txt.Rd @@ -31,5 +31,5 @@ Export a section in importation SIC format } \examples{ # 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)) } diff --git a/tests/testthat/test-create_uniform_reach_txt.R b/tests/testthat/test-create_uniform_reach_txt.R index c6eaa3442adbd6652aab15dba749d70d8e739500..62a8c12785421b8ee16bd432599cf6921c53ee41 100644 --- a/tests/testthat/test-create_uniform_reach_txt.R +++ b/tests/testthat/test-create_uniform_reach_txt.R @@ -6,15 +6,18 @@ profT <- list( ) test_that("Trapezoidal minor section", { + profT2 <- profT + profT2$ZF <- 99 + profT2$ZB <- 101 expect_equal( create_uniform_reach_txt(abscissas = c(1000, 2000), upstream_bed_elevation = 100, slope = 0.001, section_type = "T", - profile = profT), + profile = profT)[1:2], list( - "00001000" = c("Section x=1000 $ 1000 $ $ 0 $ T", "2\t1", "102\t100"), - "00002000" = c("Section x=2000 $ 2000 $ $ 0 $ T", "2\t1", "101\t99") + "00001000" = create_section_txt("Section x=1000", 1000, "T", profT), + "00002000" = create_section_txt("Section x=2000", 2000, "T", profT2) ) ) })