Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case 14 #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions getting_started/getting_started_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"metadata": {},
"outputs": [],
"source": [
"import os\n",
Expand Down Expand Up @@ -330,9 +328,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"metadata": {},
"outputs": [],
"source": [
"\n",
Expand Down Expand Up @@ -428,9 +424,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"metadata": {},
"outputs": [],
"source": [
"# Launch solar and wind generation\n",
Expand Down Expand Up @@ -501,9 +495,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"metadata": {},
"outputs": [],
"source": [
"%run ../chronix2grid/kpi/Generator_parameter_checker.py\n",
Expand Down Expand Up @@ -657,9 +649,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"metadata": {},
"outputs": [],
"source": [
"#for scenario_name in os.listdir(generation_output_folder):\n",
Expand Down Expand Up @@ -823,9 +813,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"metadata": {},
"outputs": [],
"source": [
"Ramps=delta_dispatch_no_monthly_rupture\n",
Expand Down
132 changes: 8 additions & 124 deletions getting_started/getting_started_cli.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -31,54 +31,16 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Usage: chronix2grid [OPTIONS]\n",
"\n",
"Options:\n",
" --case TEXT case folder to base generation on\n",
" --start-date TEXT Start date to generate chronics\n",
" --weeks INTEGER Number of weeks to generate\n",
" --by-n-weeks INTEGER Size of the output chunks in weeks\n",
" --n_scenarios INTEGER Number of scenarios to generate\n",
" --mode TEXT Steps to execute : L for loads only (and KPI);\n",
" R(K) for renewables (and KPI) only; LRTK for all\n",
" generation\n",
"\n",
" --input-folder TEXT Directory to read input files from.\n",
" --output-folder TEXT Directory to store output files.\n",
" --seed-for-loads TEXT Input seed to ensure reproducibility of loads\n",
" generation\n",
"\n",
" --seed-for-res TEXT Input seed to ensure reproducibility of renewables\n",
" generation\n",
"\n",
" --seed-for-dispatch TEXT Input seed to ensure reproducibility of dispatch\n",
" --ignore-warnings Ignore the warnings related to the existence of\n",
" data files in the chosen output directory.\n",
"\n",
" --scenario_name TEXT subname to add to the generated scenario output\n",
" folder, as Scenario_subname_i\n",
"\n",
" --nb_core INTEGER number of cores to parallelize the number of\n",
" scenarios\n",
"\n",
" --help Show this message and exit.\n"
]
}
],
"outputs": [],
"source": [
"!chronix2grid --help"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -105,20 +67,9 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'chronix2grid --mode RLTK --output-folder /home/vrenault/Projects/ChroniX2Grid/getting_started/example/output --input-folder /home/vrenault/Projects/ChroniX2Grid/getting_started/example/input --ignore-warnings --weeks 8 --case case118_l2rpn_wcci --n_scenarios 1 --start-date 2012-01-01 --by-n-weeks 4'"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"cli_chronix2grid=\"chronix2grid \\\n",
" --mode {} --output-folder {} --input-folder {} --ignore-warnings \\\n",
Expand All @@ -129,76 +80,9 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"case118_l2rpn_wcci\n",
"initial_seeds\n",
"{'loads': 1046744458, 'renewables': 1046744458, 'dispatch': 1046744458}\n",
"seeds for scenario: Scenario_0\n",
"{'loads': 1046744458, 'renewables': 1046744458, 'dispatch': 1046744458}\n",
"scenarion_path: /home/vrenault/Projects/ChroniX2Grid/getting_started/example/output/generation/case118_l2rpn_wcci/2012-01-01/Scenario_0\n",
"=====================================================================================================================================\n",
"============================================== CHRONICS GENERATION ==================================================================\n",
"=====================================================================================================================================\n",
"/home/vrenault/Projects/ChroniX2Grid/venv_test/lib/python3.6/site-packages/grid2op/MakeEnv/Make.py:248: UserWarning:\n",
"\n",
"You are using a development environment. This environment is not intended for training agents.\n",
"\n",
"================ Generating Scenario_0 ================\n",
"Computing global auto-correlated spatio-temporal noise for thermosensible demand...\n",
"Computing loads ...\n",
"Saving files in zipped csv in \"/home/vrenault/Projects/ChroniX2Grid/getting_started/example/output/generation/case118_l2rpn_wcci/2012-01-01/Scenario_0\"\n",
"Computing global auto-correlated spatio-temporal noise for sun and wind...\n",
"Generating solar and wind production chronics\n",
"Saving files in zipped csv\n",
"mode_opf is not None\n",
"Preprocessing input data..\n",
"Filter generators ramps up/down\n",
"Adapting PyPSA grid with parameters..\n",
"mode_opf is not None\n",
"\n",
"--> OPF formulation by => month - Analyzing month # 1\n",
"INFO:pypsa.linopf:Prepare linear problem\n",
"INFO:pypsa.linopf:Total preparation time: 7.42s\n",
"INFO:pypsa.linopf:Solve linear problem using Cbc solver\n",
"INFO:pypsa.linopf:Optimization successful. Objective value: 1.07e+09\n",
"-- opf succeeded >Objective value (should be greater than zero!\n",
"\n",
"--> OPF formulation by => month - Analyzing month # 2\n",
"INFO:pypsa.linopf:Prepare linear problem\n",
"INFO:pypsa.linopf:Total preparation time: 5.79s\n",
"INFO:pypsa.linopf:Solve linear problem using Cbc solver\n",
"INFO:pypsa.linopf:Optimization successful. Objective value: 8.48e+08\n",
"-- opf succeeded >Objective value (should be greater than zero!\n",
"Total time 2.07 min\n",
"OPF Done......\n",
"Saving results for the grids with individual generators...\n",
"applying noise to forecast of 0.01 %\n",
"\n",
"\n",
"=====================================================================================================================================\n",
"================================================= KPI GENERATION ===================================================================\n",
"=====================================================================================================================================\n",
"Scenario_0...\n",
"Warning: KPI are incomplete. Computation has been made on 8 weeks, but are meant to be computed on 52 weeks\n",
"Importing and formatting data downloaded from regional eco2mix data\n",
"Importing and formatting synthetic chronics\n",
"(1) Computing KPI's...\n",
"Warning: prices data have not been given for both synthetic and reference dispatch. Quantiles will be computed on demand instead. Next time, you can provide .../France/eco2mix/prices_2012.csv.bz2 \n",
"\n",
"(2) Generating json output file...\n",
"-Done-\n",
"\n",
"multiprocessing done\n",
"Time taken = 327.52284812927246 seconds\n"
]
}
],
"outputs": [],
"source": [
"!$cli_chronix2grid"
]
Expand Down
20 changes: 5 additions & 15 deletions getting_started/running_chronics_grid2op.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"metadata": {},
"outputs": [],
"source": [
"import os\n",
Expand Down Expand Up @@ -109,9 +107,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"metadata": {},
"outputs": [],
"source": [
"from grid2op.Chronics import Multifolder, GridStateFromFileWithForecasts\n",
Expand Down Expand Up @@ -215,9 +211,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"metadata": {},
"outputs": [],
"source": [
"!ls $path_data_saved"
Expand Down Expand Up @@ -297,9 +291,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"metadata": {},
"outputs": [],
"source": [
"\n",
Expand Down Expand Up @@ -362,9 +354,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"metadata": {},
"outputs": [],
"source": [
"prods_p_perType[['nuclear','hydro','thermal']].iplot(kind='scatter', filename='cufflinks/cf-simple-line')"
Expand Down
40 changes: 40 additions & 0 deletions input_data/generation/l2rpn_case14_sandbox_1x/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from grid2op.Action import TopologyAndDispatchAction
from grid2op.Reward import RedispReward
from grid2op.Rules import DefaultRules
from grid2op.Chronics import Multifolder
from grid2op.Chronics import GridStateFromFileWithForecasts
from grid2op.Backend import PandaPowerBackend

config = {
"backend": PandaPowerBackend,
"action_class": TopologyAndDispatchAction,
"observation_class": None,
"reward_class": RedispReward,
"gamerules_class": DefaultRules,
"chronics_class": Multifolder,
"grid_value_class": GridStateFromFileWithForecasts,
"volagecontroler_class": None,
"thermal_limits": [
541.,
450.,
375.,
636.,
175.,
285.,
335.,
657.,
496.,
827.,
442.,
641.,
840.,
156.,
664.,
235.,
119.,
179.,
1986.,
1572.
],
"names_chronics_to_grid": None
}
Loading