rte-antares-rpackage / antaresRead

Import, manipulate and explore the results of an Antares simulation
https://rte-antares-rpackage.github.io/antaresRead/
13 stars 6 forks source link

New aliases to import columns used in production stacks or in computations in antaresProcessing #28

Closed FrancoisGuillem closed 7 years ago

FrancoisGuillem commented 7 years ago

Now one can write for instance:

mydata <- readAntares(select="margins")

This will load all required data to compute margins.

jalazawa commented 7 years ago

TEST KO

It's not working for some alias like margins or surplus

##tests alias 
library(antaresProcessing)

PathStudyAntares<-"E:\\ANTARES\\Exemple_antares\\2_exemple_etudes_importantes\\BP_2015_2016_ConsoMedian"
setSimulationPath(PathStudyAntares, -1)

mydataP<-readAntares(select = "netLoad")
is.null(mydataP$netLoad)
addNetLoad(mydataP)
is.null(mydataP$netLoad)

mydataP<-readAntares(select = "surplus", mcYears = 1:2)
surplus(mydataP)
mydataP<-readAntares(select = "margins", mcYears = 1:2)
margins(mydataP)

CMD


> library(antaresProcessing)
> PathStudyAntares<-"E:\\ANTARES\\Exemple_antares\\2_exemple_etudes_importantes\\BP_2015_2016_ConsoMedian"
> setSimulationPath(PathStudyAntares, -1)
Antares project 'BP2015 - 2016 - Conso Median' (E:/ANTARES/Exemple_antares/2_exemple_etudes_importantes/BP_2015_2016_ConsoMedian)
Simulation 'Suisse-NouvCalage100scenMemescenRef'
Mode Economy

Content:
 - synthesis: TRUE
 - year by year: TRUE
 - MC Scenarios: TRUE
 - Number of areas: 16
 - Number of districts: 0
 - Number of links: 38
 - Number of Monte-Carlo years: 100
Warning message:
Parameter 'horizon' is missing or inconsistent with 'january.1st' and 'leapyear'. Assume correct year is 2017.
To avoid this warning message in future simulations, open the study with Antares and go to the simulation tab, put a valid year number in the cell 'horizon' and use consistent values for parameters 'Leap year' and '1st january'. 
> mydataP<-readAntares(select = "netLoad")
Importing areas
  |============================================================================================| 100%
Importing clusters
  |============================================================================================| 100%
> is.null(mydataP$netLoad)
[1] TRUE
> addNetLoad(mydataP)
> is.null(mydataP$netLoad)
[1] FALSE
> mydataP<-readAntares(select = "surplus", mcYears = 1:2)
Importing areas
  |============================================================================================| 100%
> surplus(mydataP)
Error in .checkColumns(x, list(areas = c("LOAD", "MRG. PRICE", "OV. COST",  : 
  The following columns are needed but missing: LOAD, MRG. PRICE, OV. COST, NUCLEAR, LIGNITE, COAL, GAS, OIL, MIX. FUEL, MISC. DTG, H. STOR, H. ROR, WIND, SOLAR, MISC. NDG, PSP, ROW BAL., CONG. FEE (ALG.)
> mydataP<-readAntares(select = "margins", mcYears = 1:2)
Importing areas
  |============================================================================================| 100%
> margins(mydataP)
Error in margins(mydataP) : 
  'x' is not an object of class 'antaresDataList'
FrancoisGuillem commented 7 years ago

Je clos ce ticket car ce n'est plus d'actualité. Maintenant qu'il y a la nouvelle fonction setAlias, les nouveaux alias comme "surplus" ou "margins" sont directement définis dans le package antaresProcessing au lieu d'être définis dans antaresRead