Breakthrough-Energy / PowerSimData

Simulation framework
https://breakthrough-energy.github.io/docs/
MIT License
52 stars 40 forks source link

Enable workflow for europe_tub grid model #711

Closed rouille closed 1 year ago

rouille commented 1 year ago

Pull Request doc

Purpose

Add workflow to run scenario in PyPSA-Eur grid model.

What the code is doing

Testing

Existing unit tests

Where to look

Most of the code is in powersimdata.scenario.create. Some tweaks in other modules where necessary to be able to access the network version and correctly set the data_loc attribute of the Grid object

Usage Example/Visuals

>>> from powersimdata import Scenario
>>> s = Scenario()
Could not connect to ssh server
Initialized remote filesystem with scenario_fs
>>> s.set_grid(grid_model="europe_tub", interconnect="ContinentalEurope", reduction=128, zenodo_record_id="3601881")
Transferring ScenarioList.csv.2 from scenario_fs
--> Begin: Existing Study
Nothing yet
<-- End: Existing Study
Title: PyPSA-Eur: An Open Optimisation Model of the European Transmission System (Dataset)
Publication date: 2022-09-20
Version: v0.6.1
DOI: 10.5281/zenodo.7251657
networks.zip has been downloaded previously
WARNING:pypsa.io:Importing network from PyPSA version v0.20.0 while current version is v0.21.2. Read the release notes at https://pypsa.readthedocs.io/en/latest/release_notes.html to prepare your network for import.
INFO:pypsa.io:Imported network elec_s_128_ec.nc has buses, carriers, generators, lines, links, loads, storage_units, stores
>>> grid = s.get_base_grid()
>>> grid.version
'v0.6.1'
>>> grid.data_loc
'/Users/brdo/CEM/PowerSimData/powersimdata/network/europe_tub/data_v0.6.1/networks'
>>> grid.plant.head()
                 bus_id  Pg  Qg  Qmax  ...  pypsa_ramp_limit_up  pypsa_ramp_limit_down  pypsa_ramp_limit_start_up  pypsa_ramp_limit_shut_down
plant_id                               ...                                                                                                   
AL1 0 offwind-ac  AL1 0 NaN NaN   NaN  ...                  NaN                    NaN                        1.0                         1.0
AL1 0 oil         AL1 0 NaN NaN   NaN  ...                  NaN                    NaN                        1.0                         1.0
AL1 0 onwind      AL1 0 NaN NaN   NaN  ...                  NaN                    NaN                        1.0                         1.0
AL1 0 ror         AL1 0 NaN NaN   NaN  ...                  NaN                    NaN                        1.0                         1.0
AL1 0 solar       AL1 0 NaN NaN   NaN  ...                  NaN                    NaN                        1.0                         1.0

[5 rows x 63 columns]

Time estimate

20min

rouille commented 1 year ago

@jenhagg, is that ready to go? Or you are still testing it while developing in jen/tub?

jenhagg commented 1 year ago

@jenhagg, is that ready to go? Or you are still testing it while developing in jen/tub?

I've been testing it with my branch, as well as your fix for using loads instead of buses. Let me double check, but I think we could probably merge this.

rouille commented 1 year ago

@jenhagg, is that ready to go? Or you are still testing it while developing in jen/tub?

I've been testing it with my branch, as well as your fix for using loads instead of buses. Let me double check, but I think we could probably merge this.

Ok. Keep me updated. No hurry, just want to make sure things are taken care of before the break.