Giter Site home page Giter Site logo

rte-antares-rpackage / antareseditobject Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 6.0 2.07 MB

Edit an Antares study

Home Page: https://rte-antares-rpackage.github.io/antaresEditObject/

R 100.00%
antares-simulation cluster energy monte-carlo-simulation r rte

antareseditobject's People

Contributors

assilma avatar baptsegu avatar berthetclement avatar boitardn avatar bthieurmel avatar cderv avatar etienne-s avatar jalazawa avatar janusdebondt avatar kkamel67 avatar nekmek7 avatar olivroy avatar pl-buiquang avatar pplessiez avatar pvictor avatar titouanrobert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

antareseditobject's Issues

pbapply & doParallel functions

pblapply and pboptions are used from package pbapply
registerDoParallel is used drom package doParallel
Maybe use specific @importFrom instead of @importing the whole packages.

API polling should have a delay

Description

Currently, when generating a snapshot for a variant on antares-web, we poll very aggressively the server, without any delay, until the generation is done.
This causes an unnecessary workload on the server and on the network:

if (is_variant(opts)) {
api_put(opts, paste0(opts$study_id, "/generate"))
result <- api_get(opts, paste0(opts$study_id, "/task"))
while(is.null(result$result)) {
result <- api_get(opts, paste0(opts$study_id, "/task"))
}

We must introduce a polling delay in order to be more gentle with the application.

WriteInputTS for Misc Gen

Dear all,

As far as I know, it is not possible to write input TS for Misc generation using the anatresEditObject functions.
The text files to be modified are located in "Antares_study/input/misc-gen/"
I could not modify these text files because when reading an already filled misc gen text file, it look like it is not a normal text file :
That's how it looks like :
image

My question is : is it possible to make the miscgen-area.txt files support dataframes so that users can modify them easily? the dataframe head would be for example :
image

Best regards,
Mahmoud

writeInputTS

Vérifier que les arguments gèrent bien hydro
exclusion du thermique

AntaresEditObject Thermal Timeseries Generation did not work

Description
I use the package AntaresEditObject in order to edit my Antares model via RStudio. When I tried to let the thermal timeseries automatically generated, it did not work. Therefore, there were no thermalavailabilities Timeseries in the input folder, which can be read.

How to Reproduce
In Rstudio, I put the following command to start the timeseries generator for my thermal plant fleet.
updateGeneralSettings(generate = c("thermal"))
updateInputSettings(import = "thermal")
runTsGenerator(path_solver = "C:/Program Files/RTE/Antares/7.1.0/bin/antares-7.1-solver.exe")
When looking into my input > thermal > series > area 1 > Power Plant 1, the series.txt file is empty and do not have the number of timeseries I wanted to generate. There is obviously an error in the Timeseries generator in Antares.

Afterwards, when I try to read the thermal availabilities timeseries, I get an error:
Function: thermal_ts = readInputTS(thermalAvailabilities = "all")
Error: Error in .checkTypos(e, names_x) : Object 'cluster' not found amongst
In addition: Warning message:
In .addOutputToRes("thermalAvailabilities", thermalAvailabilities, :

Expected behavior
Can you please help me to check why the timeseries generator did not work in my case? One month ago, I used the same script and it worked.

Screenshots and additional files
If applicable, add screenshots to help explain your problem. You may also include a .zip file containing your study.

OS and version

OS: windows
Antares Simulator version: 7.1
Additional context
Add any other context about the problem here.

Wrong column swap in createLink()

When using createLink with a non-null dataLink argument, in the case where the areas from and to are not in alphabetical order, the following column swap is performed:

dataLink[, 4:5] <- dataLink[, 5:4]

This is fine when dealing with a v6 study (swap of Hurdle cost direct and Hurdle cost indirect columns).

However expected column order has changed in v7, and the above swap leads to mixing up Hurdle cost indirect and Impedances.

Created area is not appearing in Antares simulator

Dear Antares developers,
I have some problems regarding to the function createArea().
When I am trying to create an area in my Antares model, I have some problems.

opts <- antaresRead::setSimulationPath('NT2030_V802', simulation = 'input')
antaresEditObject::createArea(name='x_c3')

I am using such script to create it and it's working, it doesn't return me any errors, but when I go to my Antares model, I can't see any new areas if I go to the ,for example, tab Thermal in Antares simulator. How can I solve this problem?

Best regards,
Dmytro Smirnov

computeTimeStampFromHourly for studies that don't have a year 1

The function computeTimeStampFromHourly doesn't seem to be working for studies without a year 1. The error I get is:

Error in file(con, "r") : impossible d'ouvrir la connexion

I think I found where it came from and how to fix it. In the computeTimeStampFromHourly.R file, the lines 42-52:

dayArea <- unique(antaresRead::readAntares(areas = "all", mcYears = 1, timeStep = "daily", opts = opts, showProgress = FALSE)$area)
weArea <- unique(antaresRead::readAntares(areas = "all", mcYears = 1, timeStep = "weekly", opts = opts, showProgress = FALSE)$area)
moArea <- unique(antaresRead::readAntares(areas = "all", mcYears = 1, timeStep = "monthly", opts = opts, showProgress = FALSE)$area)
annualArea <- unique(antaresRead::readAntares(areas = "all", mcYears = 1, timeStep = "annual", opts = opts, showProgress = FALSE)$area)
  
  
  
dayLink <- unique(antaresRead::readAntares(links = "all", mcYears = 1, timeStep = "daily", opts = opts, showProgress = FALSE)$link)
weLink <- unique(antaresRead::readAntares(links = "all", mcYears = 1, timeStep = "weekly", opts = opts, showProgress = FALSE)$link)
moLink <- unique(antaresRead::readAntares(links = "all", mcYears = 1, timeStep = "monthly", opts = opts, showProgress = FALSE)$link)
annualLink <- unique(antaresRead::readAntares(links = "all", mcYears = 1, timeStep = "annual", opts = opts, showProgress = FALSE)$link)

The mcYears = 1 should be replaced by mcYears = mcYears[1] like so:

dayArea <- unique(antaresRead::readAntares(areas = "all", mcYears = mcYears[1], timeStep = "daily", opts = opts, showProgress = FALSE)$area)
weArea <- unique(antaresRead::readAntares(areas = "all", mcYears = mcYears[1], timeStep = "weekly", opts = opts, showProgress = FALSE)$area)
moArea <- unique(antaresRead::readAntares(areas = "all", mcYears = mcYears[1], timeStep = "monthly", opts = opts, showProgress = FALSE)$area)
annualArea <- unique(antaresRead::readAntares(areas = "all", mcYears = mcYears[1], timeStep = "annual", opts = opts, showProgress = FALSE)$area)



dayLink <- unique(antaresRead::readAntares(links = "all", mcYears = mcYears[1], timeStep = "daily", opts = opts, showProgress = FALSE)$link)
weLink <- unique(antaresRead::readAntares(links = "all", mcYears = mcYears[1], timeStep = "weekly", opts = opts, showProgress = FALSE)$link)
moLink <- unique(antaresRead::readAntares(links = "all", mcYears = mcYears[1], timeStep = "monthly", opts = opts, showProgress = FALSE)$link)
annualLink <- unique(antaresRead::readAntares(links = "all", mcYears = mcYears[1], timeStep = "annual", opts = opts, showProgress = FALSE)$link)

This seemed to fix it.

copyOutput

Faire évoluer la fonction copyOutput pour pouvoir passer un argument mcYears. (vecteur de numériques ou all).

RunSimulation

I am running simulations with many montecarlo years (100) and not using Antares interface to do so. My probelm is that with the following configuration, the simulation evolution (import of the matrix, optimzation and results exports) does not show up on the console:

runSimulation(
name = "100MCyears",
mode = "economy",
path_solver = getOption("antares.solver"),
wait = TRUE,
show_output_on_console = TRUE,
parallel = TRUE,
opts = antaresRead::simOptions()
)

I have to open the task manager to see if the simulation is healthy!
am I missing any steps? What should one do to make the evolution appear on the console?

I am running out of ideas here (as I don't really understand the script RunSimulation.R), your help is highy appreciated.

BR,
Mahmoud

Creating Link with Antares 8.2 and editObject

I am using Antares 8.2 with the EditObject package for R.

After creating an new area and a new link in an Antares 8.2 study, Antares faces the following issue when opening the study :
The program reports that it can not find a series of files (ex. node_parameters.txt) in the inputs/link/node folder. See attached picture.

The issue doesnt appear on a 8,1 study.

Is it related to a need for an update of EditObject in order to be compatible with Antares 8.2 ?

Thank you for your feedback.

1

runSimulation

Il faut clarifier les arguments :

  • name réfère à quoi ? l'étude ou le nom de la sortie
  • ajouter un argument pour que l'utilisateur puisse choisir le nom de la sortie

De plus, path_solver semble indispensable pour lancer la fonction

  • il faut que ce soit écrit dans la description
  • à terme, il faut que l'on puisse juste indiquer quelle est la fonction et qu'il trouve seul le solver correspondant

createBindingConstraint is not compatible with thermal unit coëfficients

Hi,

At the moment the coëfficients argument (a named vector) only takes links (format "zoneA%zoneB") as an name. Can this be extended to allow thermal clusters (format "zoneA.clusterX") as well as this is possible since Antares V6.1.3?

links <- antaresRead::getLinks(opts = opts, namesOnly = TRUE)

My current workaround is to make the BC on the first link I find, then to go into the ini-file using readIniFile, modify it manually and write it back using writeIni which is a bit cumbersome :-)

R CMD CHECK

0 errors v | 0 warnings v | 2 notes x

🙈

createPSP not updated to antares v7

dataLinkVirtual <- matrix(data = c(rep(stepCapaX, 8760), rep(0, 8760), rep(0, 8760), rep(hurdleCost, 8760 * 2)), ncol = 5)

Anatares 7 requires 8 columns for a link update. The function createLink() was updated (cfr. issue 11), however, when called from createPSP > addLinksBetweenPspAndAreas a matrix of only 5 columns is provided. Please add 3 0-columns to these matrices (line 233 and line 236).

Pb using editCluster with purrr

When trying to modify only the 'market-bid-cost' of a large set of thermal clusters via editCluster method and the pwalk method from the purrr package, modified clusters are renamed 1, 2, 3... n.
Looking more into details, it appears that it is only the name of the cluster within the brackets that is modified.

Example (before):
[AT_CCGT present 2]
name = AT_CCGT present 2
group = gas
unitcount = 5

Example (after):
[1]
name = AT_CCGT present 2
group = gas
unitcount = 5

Note :
a test with a smaller set (4) worked
using a "for" loop instead of pwatch works also

Modify the data of a cluster and recreate it completely

Hello,

Is it possible to use CreateCluster() (or another function) just to modify the data of a unit (in a simple way)?
Because it is possible, but it is also required to put all the input data back in CreateCluster() to be sure it is exactly the same unit characteristics (except the one I want to change).

createBindingConstraint - issue with coefficients

Hello,

When using createBindingConstraint, I encountered an issue with including the function in a loop.
I want to define binding constraints for multiple different nodes (variable named 'country' in the enclosed script). I included the following instructions in a "for" loop but it does not seem to work. Is there another way to do it ?

for (country in ...){
...

linkBindingConstraint <- paste0("0_battery_pmp%", country)

createBindingConstraint(paste0("battery_energyLimit_", country),
values = cbind(rep(newBattery_Enrg, 366), rep(0, 366), rep(0, 366)),
timeStep = "daily",
operator = "less",
coefficients = c(linkBindingConstraint = -1),
overwrite = TRUE)

}

The result in the input\bindingconstraints folder is the following :

[181]
name = battery_energyLimit_ukni
id = battery_energylimit_ukni
enabled = true
type = daily
operator = less
linkBindingConstraint = -1.000000

Of course, Antares is unable to read linkBindingConstraint = -1.000000 which should be here 0_battery_pmp%ukni

Please note that the following alternatives did not work either :
coefficients = c(paste0("0_battery_pmp%", country) = -1)
coefficients = paste0("0_battery_pmp%", country, " = -1")
coefficients = c(paste0("0_battery_pmp%", country, " = -1"))

Thank you,

Arthur

createLink incompatible with Antares v7

"dataLink" function should be updated in order to create the necessary input data for a given link in ANTARES v7.

In the past, a matrix with only 5 columns was needed (trans. capacity (direct) trans. capacity (indirect), impedances, hurdles cost (direct), hurdles cost (indirect)).

With ANTARES v7, a matrix of 8 columns is needed to take into account the new parameters (i.e. loop flow, p.shift.min, p.shift.max)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.