GithubHelp home page GithubHelp logo

antaressimulatorteam / antarest Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 6.0 103.14 MB

API REST and WebUI for Antares_Simulator

License: Apache License 2.0

Python 72.69% Dockerfile 0.01% Shell 0.14% HTML 0.01% TypeScript 25.93% CSS 1.04% JavaScript 0.05% Mako 0.01% R 0.12% Batchfile 0.01%

antarest's People

Contributors

3lbanna avatar a-zakir avatar cbion avatar flomnes avatar francoisj avatar gpivette avatar hdinia avatar hyralc avatar laurent-laporte-pro avatar mabw-rte avatar makdeuneuv avatar martinbelthle avatar olfamizen avatar pl-buiquang avatar qdesmedt avatar romeoadanhounme avatar sgatto avatar skamril avatar sylvlecl avatar tlaidi avatar wintxer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

antarest's Issues

Setup flask server

Linked to
#1

What

  • listen port 8080
  • get path request, give path to url engine: /simulation/{id}/settings/generaldata.ini/{}/{}

Besoins

  • fetch simulation settings

Parse file system with jsonschema

Linked to
#2

What
Currently, file system is parsed at one time, these force a tree structure with key / value at each node. However, we need more flexibility in node like array.

Need
More flexibility in tree structure

Integration Test for #1

Linked to
#1

What

  • given simulation with settings/generaldata.ini
  • Send URL request to server
  • assert request responce is equals to data in the file

implement S10

Strategy 10: economy/mc-ind has a complet set of scenarios
Capture d’écran 2020-10-21 à 16 50 24

Create an new empty study

As a user (who is in the process of building a new study)
I want to create a new simulation from scrath (with all the default values)
in order to later start modifying the paramters of the study and eventually launch the calculation

acceptance criteria

  • the request of the creation should accept the name of new simulation, that becomes the directory name
  • the name should be written in the study.antares file as the value of the field caption
  • the creation date sould be written as Unix Timestamp in the fields created and lastsave
  • an error should be returned if a simulation with the same name exists already in the workspace

note: an empty study named empty-study72 is provided
empty-study72.zip

WIP: Managing Antares_Simulator versions behind the API

As a user that is going to prepare and eventually run a simulation
I would need to know what is the version of Antares that is going to execute my study.

Accemptance criteria

  • when requesting the version, the API sould return the version of the API
  • when requesting the version of Antares the API should return the 3 digits Antares version (actuellement 7.2.0)

Read a simulation general settings

What
As a user (who has launched or simply created a simulation)
I want to retrieve the informations of the simulation settings of a simulation (the content of settings/generaldata.ini)
in order to check the values of the general settings of the simulation

Definition of done

  • If I ask for "generaldata" i get a json containing all the data of generaldata.ini
  • if I ask "generaldata/general" I get the json of the section "general" of the file
  • If I ask "generaldata/general/nbyears" I simply get an integer (the number of MonteCarlo years of the simulation)
  • I get an error if I ask for a non existent variable i.e. "generaldata/general/years"

Besoins

  • Un ou des fichiers d'exemple generaldata.ini

Give area list by url

Linked to
#2

What

  • return 404 if simulation not found
  • add a depth key to allow return only N steps in the folder tree

implement S3

Strategy 3: some folders, .ini has defined keys, with incomplet set of sone key

Capture d’écran 2020-10-21 à 16 42 23

Use $ref in jsonschema

Linked to
#2

What
Use $ref keyword in jsonschema to remove duplicate object and simplify jsonschema

Need

implement S5

Strategy 5: some folders, .ini has a incomplet set of zone keys

Capture d’écran 2020-10-15 à 15 00 59

implement S7

Strategy 7 : some folders have complet set of thermal production
Capture d’écran 2020-10-21 à 16 45 27

process .ico file

The file /settings/resources/study.ico is a picture, and is for now treated as a .txt file.

Get matrix content by url

Linked to
#2

What

  • return file content according to url given
  • return 404 not found if matrix not present

Besoins

  • get matrix data

Read .ini

Linked to
#1

What

  • Lire et parse un fichier .ini
  • Output un dict

Besoins

  • Utiliser fichier exemple generaldata.ini

implement S4

Strategy 4: Some folders, .ini have a complet set of zone keys

Capture d’écran 2020-10-15 à 15 04 30

Read the study.antares file contained in the simulation

as a user who created or run a study
I need to read the content of the study.antares file that is at the root of the study directory
in order to check its content, for example the version of Antares with which it has been generated
study.antares is standard inifile

Acceptance criteria

  • the content of study.antares can be added to the variables of the study, hence accessed directly

  • for example inside study.antares "antares/version": 700 can be found.
    I expect to find the version of Antares by requesting "/studyname/antaresversion"

  • i expect to find the caption of the simulation by requesting "studyname/caption"

  • I expect to find the "created" value of the simulation by requesting "studyname/created" (it is a unixtime, to confirm)

  • I expect to find the "lastsave" value of the simulation by requesting "studyname/lastsave" (it is a unixtime, to confirm)

Retrieve Antares version from the output of a simulation

As a user who is reading the results of a simulation
I would like to retrieve the version of Antares that was used to produce the simulation
This information is contained in the info.antares-output inside the output directory of the simulation
This file also contains in a .iniformat all the metadata of the simulation

[general]
version = 710
name = hello-world
mode = Economy
date = 2020.10.09 - 12:21
title = 2020.10.09 - 12:21
timestamp = 1602238885

The idea:
/studies/{study}/output/{simulation}/version
can be used as
/studies/{study}/output/{simulation}/about-the-study/study/antares/version

acceptance criteria

  • a GET /metadata/simulationname/output/ID/version should allow to retrieve the antares version
  • in the same way the other metadata can be retrieved fro me the file instead of parsing the directory name

IT for #2

Linked to
#2

Happy path

  • given simulation files.
  • get areas list names
  • get matrix url for a given area
  • get matrix data for ALL value_*

Error path

  • given simulation files
  • ask wrong simulation (return error)
  • ask good simulation, wrong area (return error)
  • ask good simulation, good area, wrong matrix (return error)

Get the values_* from mc_all from an existing area

As a user (who is reading a finished simulation)
I want to retrieve the data contained in one of the files values-hourly or values-weekly or values-monthly or values-yearly inside mc-all/areas/$AREA-NAME/ (a text file corresponding to one area of the simulation) if:

  • mc-all is present inside the output
  • if the chosen file values-hourly or one of the other three exists for the chosen area
    In order to analyse the overall cost

Note
A small simulation with the output is provided (TODO)

Accemptance criteria

  • ìf values_hourly does not exists inside mc-all/areas/$AREA-NAME/ an error message should be retuned saying that "values_hourly does not exist for the chosen area"

  • ìf mc-all/areas/$AREA-NAME/ is not found an error message should be retuned saying that "no mc-all for the chosen area"

  • ìf mc-all is not found an error message should be returned saying "no mc-all for the current simulation"

  • if the chosen file is found it should be returned as a reply of the API request

implement S8

Strategy 8: output simulation has different type (adequacy, economy, ...) these types create specific folder in simulation folder.

Capture d’écran 2020-10-21 à 16 47 56

implement S2

Strategy S2: some folder, .ini have non defined keys

Capture d’écran 2020-10-21 à 16 43 06

S12 Multiple simulation-outputs should have name, date, type and ID

Strategy 12

As a user (who is reading a finished simulation)
I want to acces to the different outputs of the simulations of a study
In order to analyse the results of my simulationsoverall cost
Note
A small study with two simulations is provided
STA-mini.zip

Acceptance criterias

  • if the user request "/studyname/output" it should get the json with a depth on 1: list of the simulation outputs

  • one simulation output should be an object that contains the data of the directory (for example the directory "20201014-1422eco-hello" ) and some additional variable whose values are inferred for the directoryname (yearmonthday-hourminutes[-simulationname]
    "date": YearMonthDayHourMinute
    "run type": "adequacy" (adq) or "economy" (eco) or "draft" (dft)
    "simulationname"(optional): ("hello", "goodbye", "", "" in the example)
    "id"(int): 1 (oldest) to NUM-OF-SIMULATIONS

  • it should be possible to acces to the simulation output by a request "/studyname/output/ID"

"output": [
  {
    "date": date,
    "ID": 1,
    "name": "",
    "type": "economy",
    "data":{
      ...
      ...

    },
    {
    "date": 20201014-1045,
    "ID": 2,
    "name": "goodbye",
    "type": "adequacy",
    "data":{
      ...
      ...
      
    }
  }
]

implement S1

Strategy 1: Some folders or .ini has a mixte of defined keys and complet set of zones keys

image

implement S6

Strategy 6: some folders have multi set of zones file to read.
Capture d’écran 2020-10-15 à 15 32 24

implement S11

Strategy 11: ts-generator has incomplet set of production type
Capture d’écran 2020-10-21 à 16 51 56

Get "values_*" matrix for a given area

Linked to
#1

What

  • Get matrix url pointer for a given area name:
    • e.g. /studies/study1/areas/area1/matrice1.txt return /matrices/study1/areas/area1/matrice1.txt
  • Return 404 if area name not found or matrix not found

File System parser

Linked to
#2

What

  • parse all file in the study folder
  • fill json data with directories name
  • raise error when file system doesn't match jsonschema

Besoins

  • build jsondata according to simulation file system

Manage file format

What

  • Manage .ini: study.antares, settings/scenariobuilder.dat,

  • Manage xml: settings/comment.txt

  • Manage .log: logs/*

implement S9

Strategy S9: some folders has complet set of frequencies time step

Capture d’écran 2020-10-21 à 16 49 26

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.