From 1f2e2594292b17f2916a8939fcbf8f6fdf51f4ec Mon Sep 17 00:00:00 2001 From: pvictor Date: Thu, 16 Dec 2021 17:08:33 +0100 Subject: [PATCH] fixed check --- .Rbuildignore | 1 + R/API.R | 8 +++++--- man-roxygen/opts-value.R | 1 + man/mockSimulationAPI.Rd | 8 +++----- test.json | 1 - 5 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 man-roxygen/opts-value.R delete mode 100644 test.json diff --git a/.Rbuildignore b/.Rbuildignore index 3ac7b2f7..726d769c 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,4 @@ test_case/ ^docs$ ^pkgdown$ ^\.github$ +man-roxygen/ diff --git a/R/API.R b/R/API.R index 1cb0656e..37198f82 100644 --- a/R/API.R +++ b/R/API.R @@ -4,16 +4,18 @@ #' @description Use this to generate command without an active API connection, #' it allow to use function to edit a study to later on get API commands. #' -#' @template opts +#' @template opts-value #' @export #' #' @examples +#' \dontrun{ #' # Mock simulation API #' mockSimulationAPI() #' # Create an area #' createArea("new area") #' # Get commands -#' getAPIcommands() +#' getVariantCommands() +#' } mockSimulationAPI <- function() { opts <- list( typeLoad = "api", @@ -97,7 +99,7 @@ getVariantCommands <- function(last = NULL, actions = NULL, opts = antaresRead:: #' #' @importFrom jsonlite write_json writeVariantCommands <- function(path, last = NULL, actions = NULL, ..., opts = antaresRead::simOptions()) { - commands <- getAPIcommands(last = last, actions = actions, opts = opts) + commands <- getVariantCommands(last = last, actions = actions, opts = opts) jsonlite::write_json(x = commands, path = path, auto_unbox = TRUE, ...) } diff --git a/man-roxygen/opts-value.R b/man-roxygen/opts-value.R new file mode 100644 index 00000000..a249d668 --- /dev/null +++ b/man-roxygen/opts-value.R @@ -0,0 +1 @@ +#' @return An updated list containing various information about the simulation. diff --git a/man/mockSimulationAPI.Rd b/man/mockSimulationAPI.Rd index 0b930115..d2d5c48a 100644 --- a/man/mockSimulationAPI.Rd +++ b/man/mockSimulationAPI.Rd @@ -6,10 +6,6 @@ \usage{ mockSimulationAPI() } -\arguments{ -\item{opts}{List of simulation parameters returned by the function -\code{\link[antaresRead:setSimulationPath]{antaresRead::setSimulationPath()}}} -} \value{ An updated list containing various information about the simulation. } @@ -18,10 +14,12 @@ Use this to generate command without an active API connection, it allow to use function to edit a study to later on get API commands. } \examples{ +\dontrun{ # Mock simulation API mockSimulationAPI() # Create an area createArea("new area") # Get commands -getAPIcommands() +getVariantCommands() +} } diff --git a/test.json b/test.json deleted file mode 100644 index 6ec0e346..00000000 --- a/test.json +++ /dev/null @@ -1 +0,0 @@ -[{"action":"create_area","args":{"area_name":"earth"}},{"action":"create_area","args":{"area_name":"moon"}},{"action":"update_config","args":{"target":"input/areas/moon/optimization","data":{"nodal optimization":{"non-dispatchable-power":true,"dispatchable-hydro-power":true,"other-dispatchable-power":true,"spread-unsupplied-energy-cost":0,"spread-spilled-energy-cost":0,"unserverdenergycost":0,"spilledenergycost":0},"filtering":{"filter-synthesis":"hourly, daily","filter-year-by-year":"hourly, daily, weekly, monthly, annual"}}}}]