Skip to content

Commit

Permalink
CRAN RELEASE (#190)
Browse files Browse the repository at this point in the history
* update version 0.7.1 and delete remotes to push on CRAN

* cran comment to fix error submission

* Fix latex error cran submission

* pkgdown build_site() fix warnings vignette

* fix local r cmd check error with path in vignette

* fix for re submission

* docs

* update with master branch + update licence file
  • Loading branch information
berthetclement authored Oct 3, 2024
1 parent 4f6a815 commit b0cd0fa
Show file tree
Hide file tree
Showing 15 changed files with 388 additions and 39 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ test_case/
man-roxygen/
^codecov\.yml$
^CRAN-SUBMISSION$
^LICENSE\.md$
10 changes: 4 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: antaresEditObject
Type: Package
Title: Edit an 'Antares' Simulation
Version: 0.7.1.9000
Version: 0.7.1
Authors@R: c(
person("Tatiana", "Vargas", email = "tatiana.vargas@rte-france.com", role = c("aut", "cre")),
person("Frederic", "Breant", role = "aut"),
person("Victor", "Perrier", role = c("aut")),
person("Frederic", "Breant", role = "ctb"),
person("Victor", "Perrier", role = c("ctb")),
person("Baptiste", "Seguinot", role = "ctb"),
person("Benoit", "Thieurmel", role = "ctb"),
person("Titouan", "Robert", role = "ctb"),
Expand All @@ -21,7 +21,7 @@ Authors@R: c(
Description: Edit an 'Antares' simulation before running it : create new areas, links, thermal
clusters or binding constraints or edit existing ones. Update 'Antares' general & optimization settings.
'Antares' is an open source power system generator, more information available here : <https://antares-simulator.org/>.
License: GPL (>= 2) | file LICENSE
License: GPL (>= 2)
URL: https://github.com/rte-antares-rpackage/antaresEditObject, https://rte-antares-rpackage.github.io/antaresEditObject/
BugReports: https://github.com/rte-antares-rpackage/antaresEditObject/issues
Encoding: UTF-8
Expand Down Expand Up @@ -53,5 +53,3 @@ Suggests:
knitr,
rmarkdown
VignetteBuilder: knitr
Remotes:
github::rte-antares-rpackage/antaresRead
1 change: 0 additions & 1 deletion LICENSE

This file was deleted.

336 changes: 336 additions & 0 deletions LICENSE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# antaresEditObject 0.7.1.9000
# antaresEditObject 0.7.1

### Breaking changes :

Expand Down
24 changes: 12 additions & 12 deletions R/computeTimeStepFromHourly.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
# First merge
alldaysYearTwo <- data.table(day = alldaysYearTwo, week2 = weekVector)
alldaysYearTwo[, year2 := year(day)]
res <- merge(copy(dailydata)[, time := as.Date(time)], alldaysYearTwo, by.x = "time", by.y = "day", all.x = T)
res <- merge(copy(dailydata)[, time := as.Date(time)], alldaysYearTwo, by.x = "time", by.y = "day", all.x = TRUE)

# Set up year One
alldaysYearOne <- seq(as.Date(paste0(year-1,"-01-01")),as.Date(paste0(year-1,"-12-31")),by="1 day")
Expand All @@ -144,7 +144,7 @@
# Second merge
alldaysYearOne <- data.table(day = alldaysYearOne, week1 = weekVector)
alldaysYearOne[, year1 := year(day)]
res <- merge(res, alldaysYearOne, by.x = "time", by.y = "day", all.x = T)
res <- merge(res, alldaysYearOne, by.x = "time", by.y = "day", all.x = TRUE)

res[, `:=` (week = ifelse(is.na(week1),week2,week1),
year = ifelse(is.na(year1),year2,year1))][, c("week1", "week2", "year1", "year2") := NULL]
Expand All @@ -156,12 +156,12 @@

if (length(colForMean) > 0){
resMean <- res[, lapply(.SD, function(x){round(mean(x),2)}),.SDcols = colForMean, by= agg_columns]
resFinal <- merge(resSum, resMean, by = agg_columns, sort = F)
resFinal <- merge(resSum, resMean, by = agg_columns, sort = FALSE)
} else resFinal <- resSum

if (length(colForMax) > 0){
resMean <- res[, lapply(.SD, max),.SDcols = colForMax, by= agg_columns]
resFinal <- merge(resFinal, resMean, by = agg_columns, sort = F)
resFinal <- merge(resFinal, resMean, by = agg_columns, sort = FALSE)
}

resFinal[, timeId := week]
Expand Down Expand Up @@ -192,24 +192,24 @@ computeOtherFromHourlyYear <- function(mcYear,
areas = "all",
opts = simOptions(),
timeStep = c("daily", "monthly", "annual", "weekly"),
writeOutput = F){
writeOutput = FALSE){
res <- list()
#for the eval(parse(text))
if (length(areas) == 1) selected <- ifelse(areas == "all", "areas", paste0("'",areas,"'"))
else if (type != "links") selected <- paste(list(areas), sep = ",")
else selected <- paste(list(getLinks(areas, internalOnly = T, opts = opts)),
else selected <- paste(list(getLinks(areas, internalOnly = TRUE, opts = opts)),
sep = ",")

formula <- sprintf('readAntares(%s = %s, timeStep = "hourly",
mcYears = mcYear, showProgress = F, opts = opts)',
mcYears = mcYear, showProgress = FALSE, opts = opts)',
type, selected) #read any type data
hourlydata <- eval(parse(text = formula))
if (type == "clustersRes" && length(hourlydata) > 1) hourlydata <- hourlydata$clustersRes

# Multi timestep at once
# steps <- as.list(intersect(c("daily", "monthly", "annual"), timeStep))
# res <- llply(steps, .hourlyToOther, hourlydata = hourlydata, type = type,
# .parallel = T, .paropts = list(preschedule=TRUE))
# .parallel = TRUE, .paropts = list(preschedule=TRUE))
# names(res) <- paste0(steps,"data")

# Separate timesteps
Expand Down Expand Up @@ -246,7 +246,7 @@ computeOtherFromHourlyYear <- function(mcYear,
}

lapply(res, writeOutputValues, opts = opts)
# llply(res, writeOutputValues, opts = opts, .parallel = T, .paropts = list(preschedule=TRUE))
# llply(res, writeOutputValues, opts = opts, .parallel = TRUE, .paropts = list(preschedule=TRUE))
}

res
Expand Down Expand Up @@ -283,12 +283,12 @@ computeOtherFromHourlyMulti <- function(opts = simOptions(),
type = c("areas", "links", "clusters"),
timeStep = c("daily", "monthly", "annual", "weekly"),
mcYears = simOptions()$mcYears,
writeOutput = F,
writeOutput = FALSE,
nbcl = 8,
verbose = F){
verbose = FALSE){

if (verbose){
handlers(global = T)
handlers(global = TRUE)
handlers("progress")
}

Expand Down
3 changes: 0 additions & 3 deletions R/createClusterST.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@
#' - initiallevel = 0.5 (`numeric` \{0;1\})
#' - enabled = TRUE (`logical` TRUE/FALSE)
#'
#' &#9888;&#9888;&#9888;
#'
#' By default, these values don't allow you to have an active cluster (See example section.)
#'
#' &#9888;&#9888;&#9888;
#'
#'
#' @seealso All the functions needed to manage a storage cluster,
Expand Down
26 changes: 26 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,29 @@ Failure ('test-createCluster.R:76:5'): Remove all clusters ───────

## antaresEditObject 0.6.4
Patch version to break abusive dependencies with antaresRead in tests

## antaresEditObject 0.7.1

### Re Submission

- Check: PDF version of manual, Result: WARNING
LaTeX errors when creating PDF version.
This typically indicates Rd problems.
LaTeX errors found:
! LaTeX Error: Unicode character (U+26A0)
not set up for use with LaTeX.

Fix local error (R CMD check antaresEditObject_0.7.1.tar.gz) :

- When sourcing 'api-variant-management.R':
Erreur : Cannot find the file(s): "../man/figures/badge_api_ok.svg"


This error did not appear on the CRAN

### Re Submission 2

- Fix TRUE and FALSE instead of T and F
- `\dontrun{}` sections are needed because most of functions need to be apply on a study load on Global env (legacy code too)
- There is only a maintainer, contributors and RTE, which is the owner. (we use `use_gpl_license(version = 2, include_future = TRUE)`)

8 changes: 2 additions & 6 deletions man/antaresEditObject-package.Rd

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

4 changes: 2 additions & 2 deletions man/computeOtherFromHourlyMulti.Rd

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

2 changes: 1 addition & 1 deletion man/computeOtherFromHourlyYear.Rd

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

4 changes: 0 additions & 4 deletions man/createClusterST.Rd

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

2 changes: 1 addition & 1 deletion vignettes/Antares_new_features_v860.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Antares new features v8.6.0"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Antares_new_features_v860}
%\VignetteIndexEntry{Antares new features v8.6.0}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down
2 changes: 1 addition & 1 deletion vignettes/antaresEditObject.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "User guide"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{antaresEditObject}
%\VignetteIndexEntry{User guide}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down
2 changes: 1 addition & 1 deletion vignettes/api-variant-management.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ writeVariantCommands("path/to/commands.json")
Below are listed all functions from {antaresEditObject} that can be used with the API. These functions will include the following badge in their documentation:

```{r, echo=FALSE}
knitr::include_graphics("../man/figures/badge_api_ok.svg")
knitr::include_graphics("figures/badge_api_ok.svg")
```


Expand Down

0 comments on commit b0cd0fa

Please sign in to comment.