Skip to content

Commit

Permalink
exchangesStack() documentation example updated + cran comments + news
Browse files Browse the repository at this point in the history
  • Loading branch information
berthetclement committed Nov 29, 2024
1 parent 7e94ef3 commit 1a0858c
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 91 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Copyright 2016 RTE Reseau de transport d'electricite

# antaresViz 0.18.3
* The package has been accepted but archived as version 0.18.2.
New version for distribution on CRAN
New version for distribution on CRAN
* Licence file updated and documentation for `exchangesStack()` updated

# antaresViz 0.18.2
* fix cran issue on test not skip well
Expand Down
86 changes: 41 additions & 45 deletions R/stack_exchanges.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright © 2016 RTE Réseau de transport d’électricité

#' Plot the exchanges of an area
#' @title Plot the exchanges of an area
#'
#' This function draws a stack representing the evolution of the exchanges of
#' @description This function draws a stack representing the evolution of the exchanges of
#' an area with its neighbours. Positive values denotes exports and negative
#' values imports.
#' User can either plot all flows from/to an area using the \code{default} stack or use a custom one.
Expand Down Expand Up @@ -46,50 +46,46 @@
#' }
#'
#' @examples
#' \dontrun{
#' mydata <- readAntares(links = "all", timeStep = "daily")
#' exchangesStack(mydata)
#'
#' # Also display exchanges with the rest of the world
#' mydata <- readAntares(areas = "all", links = "all", timeStep = "daily")
#' exchangesStack(mydata)
#'
#' # Use compare :
#' exchangesStack(mydata, compare = "mcYear")
#' exchangesStack(mydata, compare = "area")
#' exchangesStack(mydata, compare = "unit")
#' exchangesStack(mydata, compare = "legend")
#' # Compare studies with refStudy argument
#' exchangesStack(x = myData1, refStudy = myData2)
#' exchangesStack(x = myData1, refStudy = myData2, interactive = FALSE)
#' exchangesStack(x = list(myData2, myData3, myData4), refStudy = myData1)
#' exchangesStack(x = list(myData2, myData3, myData4), refStudy = myData1, interactive = FALSE)
#'
#' # Use h5 opts
#' # Set path of simulaiton
#' setSimulationPath(path = path1)
#'
#' # Convert your study in h5 format
#' writeAntaresH5(path = mynewpath)
#'
#' # Redefine sim path with h5 file
#' opts <- setSimulationPath(path = mynewpath)
#' exchangesStack(x = opts)
#'
#' # Compare elements in a single study
#' exchangesStack(x = opts, .compare = "mcYear")
#'
#' # Compare 2 studies
#' exchangesStack(x = list(opts, opts2))
#'
#' # Compare 2 studies with argument refStudy
#' exchangesStack(x = opts, refStudy = opts2)
#' exchangesStack(x = opts, refStudy = opts2, interactive = FALSE, mcYearh5 = 2, areas = myArea)
#' exchangesStack(x = opts, refStudy = opts2, h5requestFiltering = list(
#' areas = getAreas(select = "a"),
#' links = getLinks(areas = myArea),
#' mcYears = myMcYear))
#' \donttest{
#' library(antaresRead)
#' # with study test for example (study is in package antaresRead)
#' sourcedir <- system.file("testdata", package = "antaresRead")
#'
#' # untar study in temp dir
#' path_latest <- file.path(tempdir(), "latest")
#' untar(file.path(sourcedir, "antares-test-study.tar.gz"), exdir = path_latest)
#'
#' study_path <- file.path(path_latest, "test_case")
#'
#' # set path to your Antares simulation
#' opts <- setSimulationPath(study_path)
#'
#' if(interactive()){
#' mydata <- readAntares(links = "all", timeStep = "daily")
#' exchangesStack(mydata)
#'
#' # Also display exchanges with the rest of the world
#' mydata <- readAntares(areas = "all", links = "all", timeStep = "daily")
#' exchangesStack(mydata)
#'
#' # Use compare :
#' exchangesStack(mydata, compare = "mcYear")
#' exchangesStack(mydata, compare = "area")
#' exchangesStack(mydata, compare = "unit")
#' exchangesStack(mydata, compare = "legend")
#' # Compare studies with refStudy argument
#' exchangesStack(x = myData1, refStudy = myData2)
#' exchangesStack(x = myData1, refStudy = myData2, interactive = FALSE)
#' exchangesStack(x = list(myData2, myData3, myData4), refStudy = myData1)
#' exchangesStack(x = list(myData2, myData3, myData4), refStudy = myData1, interactive = FALSE)
#'
#'
#' # Compare 2 studies
#' exchangesStack(x = list(opts, opts))
#'
#' # Compare 2 studies with argument refStudy
#' exchangesStack(x = opts, refStudy = opts)
#' }
#' }
#'
#' @export
Expand Down
12 changes: 11 additions & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,15 @@ We have to fix dependencies with package `rhdf5` on this package before to push
Cran check in ERROR cause test skip not skip

## v0.18.3
To put the package back on CRAN
To put the package back on CRAN
- `exchangesStack()` documentation updated with `\donttest` and rewrite example
- Update file "Licence" with GPL licence `usethis::use_gpl_license()`

```
> devtools::check_man()
ℹ Updating antaresViz documentation
ℹ Loading antaresViz
ℹ Checking documentation...
✔ No issues detected
```

84 changes: 40 additions & 44 deletions man/exchangesStack.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1a0858c

Please sign in to comment.