From 67f505162c54662f6a4e63deb3fdd839b67a1cae Mon Sep 17 00:00:00 2001 From: berthetclement Date: Tue, 23 Jul 2024 17:15:44 +0200 Subject: [PATCH] update docs to put values returned + some cleaning references to private function with (:::) --- R/aggregateResult.R | 13 ++++++++----- R/giveSize.R | 2 ++ R/hvdcModification.R | 3 +++ R/ponderateMcAggregation.R | 3 +++ R/setHvdcAreas.R | 3 ++- R/utils_api.R | 4 ++++ man/aggregatate_mc_all.Rd | 4 ++++ man/dot-writeIni.Rd | 10 +++++----- man/hvdcModification.Rd | 4 ++++ man/ponderateMcAggregation.Rd | 3 +++ man/setHvdcAreas.Rd | 3 ++- man/setRam.Rd | 3 +++ man/setTimeoutAPI.Rd | 4 ++++ 13 files changed, 47 insertions(+), 12 deletions(-) diff --git a/R/aggregateResult.R b/R/aggregateResult.R index b215e452..04882b92 100644 --- a/R/aggregateResult.R +++ b/R/aggregateResult.R @@ -22,6 +22,9 @@ #' @importFrom stringr str_split #' @importFrom stringi stri_replace_last_fixed #' @importFrom memuse Sys.meminfo +#' +#' @return Object `list` of data.tables, each element representing one type +#' of element (areas, links, clusters) #' #' @export #' @@ -1417,9 +1420,9 @@ pmax.fast <- function(k,x) (x+k + abs(x-k))/2 # From antaresFlowbased duplicated necessary -#' Write ini file from list obtain by antaresRead:::readIniFile and modify by user +#' Write ini file from list obtain by antaresRead::readIniFile and modify by user #' -#' @param listData \code{list}, modified list obtained by antaresRead:::readIniFile. +#' @param listData \code{list}, modified list obtained by antaresRead::readIniFile. #' @param pathIni \code{Character}, Path to ini file. #' @param overwrite logical, should file be overwritten if already exist? #' @@ -1427,11 +1430,12 @@ pmax.fast <- function(k,x) (x+k + abs(x-k))/2 #' #' \dontrun{ #' pathIni <- "D:/exemple_test/settings/generaldata.ini" -#' generalSetting <- antaresRead:::readIniFile(pathIni) +#' generalSetting <- antaresRead::readIniFile(pathIni) #' generalSetting$output$synthesis <- FALSE #' writeIni(generalSetting, pathIni) #' } #' +#' @keywords internal #' .writeIni <- function(listData, pathIni, overwrite = FALSE) { if (file.exists(pathIni)) { @@ -2159,8 +2163,7 @@ aggregateResult_old <- function(opts, verbose = 1, #' @importFrom pbapply pblapply pboptions #' @importFrom doParallel registerDoParallel #' -#' -#' @rdname aggregatate_mc_all_old +#' @noRd #' parAggregateMCall_old <- function(opts, nbcl = 8, diff --git a/R/giveSize.R b/R/giveSize.R index 4b941253..1318511e 100644 --- a/R/giveSize.R +++ b/R/giveSize.R @@ -8,6 +8,8 @@ #' #' @param x \code{numeric} RAM limit in Go #' +#' @return `list` (returned by [options()]) +#' #' @examples #' \dontrun{ #' #Set maximum ram to used to 50 Go diff --git a/R/hvdcModification.R b/R/hvdcModification.R index 4fbe0a47..4bc82d98 100644 --- a/R/hvdcModification.R +++ b/R/hvdcModification.R @@ -8,6 +8,9 @@ #' @param removeHvdcAreas \code{boolean} remove HVDC areas. #' @param reafectLinks \code{boolean} . #' +#' @return Object of class "antaresDataList" is returned. +#' It is a list of data.tables, each element representing one type of element (areas, links, clusters) +#' #' @examples #' \dontrun{ #' diff --git a/R/ponderateMcAggregation.R b/R/ponderateMcAggregation.R index 43657eba..61dc64c2 100644 --- a/R/ponderateMcAggregation.R +++ b/R/ponderateMcAggregation.R @@ -4,6 +4,9 @@ #' @param fun \code{function} function to use #' @param ... \code{args} others args pass to fun #' +#' @return +#' Object of class "antaresDataTable". +#' #' @examples #' \dontrun{ #' data <- readAntares(areas = 'all', mcYears = 'all') diff --git a/R/setHvdcAreas.R b/R/setHvdcAreas.R index a170febf..265c5f09 100644 --- a/R/setHvdcAreas.R +++ b/R/setHvdcAreas.R @@ -10,7 +10,8 @@ #' #' #' -#' @return A list with three elements: +#' @return Object of class "antaresDataList" is returned. +#' It is a list of data.tables, each element representing one type of element (areas, links, clusters) #' #' #' @examples diff --git a/R/utils_api.R b/R/utils_api.R index 562e31cd..38743b77 100644 --- a/R/utils_api.R +++ b/R/utils_api.R @@ -471,6 +471,10 @@ setSimulationPathAPI <- function(host, study_id, token, simulation = NULL, #' list of simulation parameters returned by the function #' \code{\link{setSimulationPathAPI}} #' @param timeout \code{numeric} API timeout (seconds). Default to 60. +#' +#' @return +#' Object of class `simOptions`, list of options used to read the data contained in the last +#' simulation read by \code{\link{setTimeoutAPI}}. #' #' @export #' diff --git a/man/aggregatate_mc_all.Rd b/man/aggregatate_mc_all.Rd index 4b4a1bc4..caad54c8 100644 --- a/man/aggregatate_mc_all.Rd +++ b/man/aggregatate_mc_all.Rd @@ -56,6 +56,10 @@ aggregateResult( \item{legacy}{\code{boolean} run old version of the function} } +\value{ +Object \code{list} of data.tables, each element representing one type +of element (areas, links, clusters) +} \description{ Creation of Mc_all new (only antares > V6) } diff --git a/man/dot-writeIni.Rd b/man/dot-writeIni.Rd index 743af8ad..c898a2d3 100644 --- a/man/dot-writeIni.Rd +++ b/man/dot-writeIni.Rd @@ -2,28 +2,28 @@ % Please edit documentation in R/aggregateResult.R \name{.writeIni} \alias{.writeIni} -\title{Write ini file from list obtain by antaresRead:::readIniFile and modify by user} +\title{Write ini file from list obtain by antaresRead::readIniFile and modify by user} \usage{ .writeIni(listData, pathIni, overwrite = FALSE) } \arguments{ -\item{listData}{\code{list}, modified list obtained by antaresRead:::readIniFile.} +\item{listData}{\code{list}, modified list obtained by antaresRead::readIniFile.} \item{pathIni}{\code{Character}, Path to ini file.} \item{overwrite}{logical, should file be overwritten if already exist?} } \description{ -Write ini file from list obtain by antaresRead:::readIniFile and modify by user +Write ini file from list obtain by antaresRead::readIniFile and modify by user } \examples{ \dontrun{ pathIni <- "D:/exemple_test/settings/generaldata.ini" -generalSetting <- antaresRead:::readIniFile(pathIni) +generalSetting <- antaresRead::readIniFile(pathIni) generalSetting$output$synthesis <- FALSE writeIni(generalSetting, pathIni) } - } +\keyword{internal} diff --git a/man/hvdcModification.Rd b/man/hvdcModification.Rd index 3af6b72c..02d1fa07 100644 --- a/man/hvdcModification.Rd +++ b/man/hvdcModification.Rd @@ -13,6 +13,10 @@ hvdcModification(data, removeHvdcAreas = TRUE, reafectLinks = FALSE) \item{reafectLinks}{\code{boolean} .} } +\value{ +Object of class "antaresDataList" is returned. +It is a list of data.tables, each element representing one type of element (areas, links, clusters) +} \description{ usage for hvdc } diff --git a/man/ponderateMcAggregation.Rd b/man/ponderateMcAggregation.Rd index 4b29c825..367db546 100644 --- a/man/ponderateMcAggregation.Rd +++ b/man/ponderateMcAggregation.Rd @@ -13,6 +13,9 @@ ponderateMcAggregation(x, fun = weighted.mean, ...) \item{...}{\code{args} others args pass to fun} } +\value{ +Object of class "antaresDataTable". +} \description{ Mcyear aggregation weigthed by wd } diff --git a/man/setHvdcAreas.Rd b/man/setHvdcAreas.Rd index fb30659e..f271fd2d 100644 --- a/man/setHvdcAreas.Rd +++ b/man/setHvdcAreas.Rd @@ -12,7 +12,8 @@ setHvdcAreas(data, areas) \item{areas}{\code{character} hvdc areas list.} } \value{ -A list with three elements: +Object of class "antaresDataList" is returned. +It is a list of data.tables, each element representing one type of element (areas, links, clusters) } \description{ This function add hvdc attribute diff --git a/man/setRam.Rd b/man/setRam.Rd index 9a6c2420..e315a0a8 100644 --- a/man/setRam.Rd +++ b/man/setRam.Rd @@ -9,6 +9,9 @@ setRam(x) \arguments{ \item{x}{\code{numeric} RAM limit in Go} } +\value{ +\code{list} (returned by \code{\link[=options]{options()}}) +} \description{ This function specify RAM limit (in Go) of the value returned by \link[antaresRead]{readAntares}. } diff --git a/man/setTimeoutAPI.Rd b/man/setTimeoutAPI.Rd index d158c487..b464ead2 100644 --- a/man/setTimeoutAPI.Rd +++ b/man/setTimeoutAPI.Rd @@ -12,6 +12,10 @@ setTimeoutAPI(opts, timeout) \item{timeout}{\code{numeric} API timeout (seconds). Default to 60.} } +\value{ +Object of class \code{simOptions}, list of options used to read the data contained in the last +simulation read by \code{\link{setTimeoutAPI}}. +} \description{ Change API Timeout }