From 50c3086d47e18e099734208c2bc26beb0dc23433 Mon Sep 17 00:00:00 2001 From: vargastat Date: Wed, 11 Sep 2024 10:37:08 +0200 Subject: [PATCH] library(stringr) removed from test-setSimulationPath.R --- NAMESPACE | 3 +++ R/setSimulationPath.R | 2 +- man/transform_antares_version.Rd | 14 ++++++++++++++ tests/testthat/test-setSimulationPath.R | 1 - 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 man/transform_antares_version.Rd diff --git a/NAMESPACE b/NAMESPACE index 8bedfaff..2d999f29 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -67,6 +67,7 @@ export(setSimulationPathAPI) export(setTimeoutAPI) export(showAliases) export(simOptions) +export(transform_antares_version) export(viewAntares) export(writeDigest) import(bit64) @@ -105,6 +106,8 @@ importFrom(stats,as.formula) importFrom(stats,setNames) importFrom(stats,weighted.mean) importFrom(stringi,stri_replace_last_fixed) +importFrom(stringr,str_count) +importFrom(stringr,str_detect) importFrom(stringr,str_match) importFrom(stringr,str_replace) importFrom(stringr,str_split) diff --git a/R/setSimulationPath.R b/R/setSimulationPath.R index 6c1fdc4a..7fdadc2b 100644 --- a/R/setSimulationPath.R +++ b/R/setSimulationPath.R @@ -684,7 +684,7 @@ setSimulationPath <- function(path, simulation = NULL) { #' #' @param antares_version Antares number version. #' -#' @importFrom stringr str_count +#' @importFrom stringr str_count str_detect #' #' @export transform_antares_version <- function(antares_version) { diff --git a/man/transform_antares_version.Rd b/man/transform_antares_version.Rd new file mode 100644 index 00000000..e4d58bee --- /dev/null +++ b/man/transform_antares_version.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/setSimulationPath.R +\name{transform_antares_version} +\alias{transform_antares_version} +\title{Convert the Antares number version} +\usage{ +transform_antares_version(antares_version) +} +\arguments{ +\item{antares_version}{Antares number version.} +} +\description{ +Convert the Antares number version +} diff --git a/tests/testthat/test-setSimulationPath.R b/tests/testthat/test-setSimulationPath.R index 65797873..70ca26ca 100644 --- a/tests/testthat/test-setSimulationPath.R +++ b/tests/testthat/test-setSimulationPath.R @@ -208,7 +208,6 @@ test_that("New meta data for group dimension of binding constraints", { expect_is(opts_study_test$binding, "data.table") }) -library(stringr) test_that("valid versions are transformed correctly", { expect_equal(transform_antares_version("9.0")$r, 900) expect_equal(transform_antares_version("9.45")$r, 945)