Breakthrough-Energy / SwitchWrapper

Wrapper for Switch
MIT License
1 stars 2 forks source link

feat: add storage candidate buses to Switch input preparation #101

Closed danielolsen closed 3 years ago

danielolsen commented 3 years ago

Pull Request doc

Purpose

Allow the user to specify storage candidate expansion buses, and use this information to populate the relevant data within generation_projects_info.csv and gen_build_costs.csv. This is a partial fulfillment of both #69 and #99.

What the code is doing

Testing

Tested manually, both with an without storage. Storage example:

>>> import os
>>>
>>> import pandas as pd
>>> from powersimdata import Scenario
>>>
>>> from switchwrapper.prepare import prepare_inputs
>>>
>>> scenario = Scenario(599)
>>> grid = scenario.get_grid()
>>> profiles = {
...     "demand": scenario.get_demand(),
...     "hydro": scenario.get_hydro(),
...     "solar": scenario.get_solar(),
...     "wind": scenario.get_wind(),
... }
>>> timepoints = pd.read_csv("timepoints_input_v2.csv", index_col=0)
>>> timestamps_to_timepoints = pd.read_csv("slicing_recovery.csv", index_col=0).squeeze()
>>> prepare_inputs(grid, profiles, timepoints, timestamps_to_timepoints, "prepared", storage_candidate_buses={2010001, 2010002})
Please enter base study year (normally PowerSimData scenario year): 2030
Please enter the number of investment stages: 1
Single stage expansion identified.
Please enter investment period year, separate by space: 2030
Please enter start year for each period, separate by space: 2030
Please enter end year for each period, separate by space: 2030
>>>

Time estimate

30 minutes. The largest refactoring is in build_gen_build_costs, everything else is pretty straightforward.