Giter Site home page Giter Site logo

rte-antares-rpackage / antaresviz Goto Github PK

View Code? Open in Web Editor NEW
20.0 7.0 12.0 5.81 MB

ANTARES Visualizations

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

R 93.06% CSS 1.07% JavaScript 2.31% HTML 3.56%
r monte-carlo-simulation simulation optimization linear-programming stochastic-simulation-algorithm energy electric renewable-energy adequacy

antaresviz's Introduction


antaresViz

antaresViz is the package to visualize the results of your Antares simulations that you have imported in the R session with package antaresRead. It provides some functions that generate interactive visualisations. Moreover, by default, these functions launch a shiny widget that provides some controls to dynamically choose what data is displayed in the graphics.

R build status Codecov test coverage CRAN status R-CMD-check

Installation

You can install stable version from CRAN with:

install.packages("antaresViz")

To install the last development version:

devtools::install_github("rte-antares-rpackage/antaresViz")

To display the help of the package and see all the functions it provides, use:

help(package="antaresViz")

Basic plots

antaresViz provides a plot method for tables generated with antaresRead. This method is for visualizing a single variable in different formats (times series, barplot, monotone, distribution and cumulative distribution). For instance, the following code displays the distribution of marginal price in different areas.

mydata <- readAntares(areas = "all")
plot(mydata, variable = "MRG. PRICE")

For more information, run:

?plot.antaresDataTable

Stacks

Function prodStack generates a production stack for a set of areas. Different stacks have been defined. One can see their definition with command productionStackAliases().

With function exchangesStack, one can visualize the evolution and origin/destination of imports and exports for a given area.

Maps

The construction of maps first requires to associate geographic coordinates to the areas of a study. antaresViz provides function mapLayout to do interactively this association.

# Get the coordinates of the areas as they have been placed in the antaresSoftware
layout <- readLayout()

# Associate geographical coordinates
myMapLayout <- mapLayout(layout)

# This mapping should be done once and the result be saved on disk.
save(myMapLayout, file = "myMapLayout.rda")

Then map can be generated with function plotMap:

myData <- readAntares(areas = "all", links = "all")
plotMap(myData, myMapLayout)

You can use spMaps to set a map background or download some files at https://gadm.org/download_country_v3.html.

Contributing:

Contributions to the library are welcome and can be submitted in the form of pull requests to this repository.

ANTARES :

Antares is a powerful software developed by RTE to simulate and study electric power systems (more information about Antares here : https://antares-simulator.org/).

ANTARES is now an open-source project (since 2018), you can download the sources here if you want to use this package.

License Information:

Copyright 2015-2016 RTE (France)

This Source Code is subject to the terms of the GNU General Public License, version 2 or any higher version. If a copy of the GPL-v2 was not distributed with this file, You can obtain one at https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html.

antaresviz's People

Contributors

assilma avatar baptsegu avatar berthetclement avatar bthieurmel avatar cpsievert avatar francoisguillem avatar jalazawa avatar pplessiez avatar pvictor avatar titouanrobert avatar vcrtei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

antaresviz's Issues

correction alias eco2mix

Coucou François !

Il a une petite coquille dans l'alias eco2mix de productionStack, la production fioul (oil dans la dénomination anglaise utilisée dans ANTARES - et non pas fuel qui veut plutôt dire combustible) n'est pas incluse dans l'empilement, ce qui fait que l'empilement ne rejoint pas toujours la courbe de consommation.

A modifier donc (en gras ci dessous) :

eco2mix 
===========
Variables:
   pumpedStorage = PSP
   minusBalance = -(BALANCE + `ROW BAL.`)
   bioenergie = `MISC. NDG`
   wind = WIND
   solar = SOLAR
   nuclear = NUCLEAR
   hydraulic = `H. ROR` + `H. STOR`
   gas = GAS
   coal = COAL
   lignite = LIGNITE
   oil = OIL [en gardant la même couleur violette que tu avais pour fuel]
   other = `MISC. DTG` + `MIX. FUEL`

Migrate from highcharter to plotly

plotly has been improved in the last months and is now a good candidate to replace highcharter. This will solve licence issues (plotly has MIT licence).

plotMap : make a spatial aggregation possible

Example :

  • An user visualize 5 areas
  • He choose 2 areas between 5 areas to aggregate (he choose the new name)
  • He visualise values of this new areas (sum, mean, etc. will be computed on each value)

Don't we need an aggregate spatial function in antaresProcessing ?

Générer des heatmap

Un axe représente les heures ou les jours de la semaine et l'autre les semaines de l'année

Getting more done in GitHub with ZenHub

Hola! @jalazawa has created a ZenHub account for the rte-antares-rpackage organization. ZenHub is the only project management tool integrated natively in GitHub – created specifically for fast-moving, software-driven teams.


How do I use ZenHub?

To get set up with ZenHub, all you have to do is download the browser extension and log in with your GitHub account. Once you do, you’ll get access to ZenHub’s complete feature-set immediately.

What can ZenHub do?

ZenHub adds a series of enhancements directly inside the GitHub UI:

  • Real-time, customizable task boards for GitHub issues;
  • Multi-Repository burndown charts, estimates, and velocity tracking based on GitHub Milestones;
  • Personal to-do lists and task prioritization;
  • Time-saving shortcuts – like a quick repo switcher, a “Move issue” button, and much more.

Add ZenHub to GitHub

Still curious? See more ZenHub features or read user reviews. This issue was written by your friendly ZenHub bot, posted by request from @jalazawa.

ZenHub Board

Add images to README

I think it requires to add branch gh_pages, put the images in this branch so they are available at a given url

Proxy Configuration - hiding password

Hi,

To configure the proxy, we use

library(httr)
set_config(use_proxy("XXX.XXX.XX.XX", port=XXXX, username="proxy_user", password="passwd"))

I think the problem with that is it is not very secure because RStudio saves everything in history. So your password become accessible to anyone which can open the file .Rhistory or your session.

There are several solutions to that.

Use prompt box

Among those, RStudio has built-in fonction and an API. Normally, it is shipped by default with RStudio. Among the available functions, there is one to ask for a password rstudioapi::askForPassword. It opens a box for entering password and hiding what is typed.
if rstudioapi package may need to be installed by the user, one could use RStudio built-in function .rs.askForPassword ( called by .rs.api.askForPassword, which is called by rstudioapi::askForPassword) but it is better and advised by rstudio team to use the api because it will be maintain and will continue to work even if internal design of rstudio evolves.

So, it could be more secure to do

httr::set_config(
  httr::use_proxy("XXX.XXX.XX.XX", 
                  port=XXXX, 
                  username="proxy_user", 
                  password=rstudioapi::askForPassword("Enter a password:")
                  )
  )

I made some functions to do this. You can find them here and you can source them directly in R with

devtools::source_gist("35b49bbe05ea6d93a2b8f2a4fe61d4b4", filename = "Config_proxy.R")

I plan to include them in package but it could be included in antares package too as helpers.

Write proxy configuration in .Rprofile

A solution is to put in .Rprofile this line to be executed when R is launched

httr::set_config(httr::use_proxy("XXX.XXX.XX.XX", port=XXXX, username="proxy_user", password="passwd"))

However, if the .Rprofile is open to anyone, it is the same problem.

Use an identification credentials app

Make a small shiny-app or RStudio-add-in to ask for username and password and use some the encrypted package solution to secure password (scrypt, digest, sodium, ...). I plan to do a package to deal with proxy configuration in order to prevent users to type all that each time. Could be a more long term solution. I will keep you updated if it is any interest to your project.

Conclusion

What do you think?
Do you want me to update readme file to include first solution ?
Could it be helpful to depend on another solution as workaround ?

[FR] Change installation process to make it easier to install dependencies from github

Hi,

I suggest to change the installation process in order to :

  • Use only one command to install the package and all the dependencies (from CRAN and Github)
  • Make command shorter by not providing github token each time
  • Ease the proxy configuration seeting

I have made some changes in a feature branch here.

Readme files is updated to explain this new way. If you want to test, juste replace your repo adress by mine and pointing to the right branch.

remotes::install_github("cderv/antares-rpackageViz", ref = "add_remote_deps")

If you want to do a clean test, juste create a new empty folder and execute the command using this libpath

if(!dir.exists(folder <- "~/R_dummyLib")){dir.create(folder)}
library(remotes)
withr::with_libpaths(folder,
                     install_github("cderv/antares-rpackageViz", ref = "add_remote_deps")
)

(use unlink(folder, recursive = T) to delete after)

It will take some times to install all in this new library folder as you have a lot of dependencies in your package, but you'll see it will install all CRAN packages and all Github dependencies from the organisation.

What ease the process is:

  • Configuring a GITHUB_PAT environnement variable to store the token
  • Configure proxy so that it work with new libcurl download method and with internal (deal with #34)
  • Use a Remotes fields in DESCRIPTION file to point to other github repository.

You could see everything in the branch I made.

I did not do a PR to have your reaction first. And I don't know if you prefere PR in master or in your develop branch. So tell me.

One last explanation : I used remotes and not devtools because devtools::install_github is buggy and remotes aims to replace some of the devtools functions.

plot : I cannot plot annual data

I can plot "hourly", "weekly" or "montly" data.

I cannot plot "annual" data.

Error :

plot(mydata$areas)
Error in as.Date.numeric(range(dt$time)) : 'origin' must be supplied

possibilities :

  • print an error message -> "plot annual data is impossible"
  • plot a bar plot for annual data AND make type "monotone" and "curves" NOT available.

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.