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
in const.py, we add some storage constants, and we move the hard-coded 'base year' from grid_to_switch.py to const.py.
in helpers.py, we refactor make_plant_indices so that it returns a dictionary, rather than a tuple of lists. We also refactor profiles_to_switch.py to take the latest call signature.
in prepare.py, we add a storage_candidate_buses parameter and pass it along to grid_to_switch.
in grid_to_switch.py:
We update the upper-level grid_to_switch function to take a storage_candidate_buses parameter and pass it to lower-level functions build_generation_projects_info and build_gen_build_costs.
We update each of these lower-level functions to interpret storage_candidate_buses and fill data tables appropriately.
We update the use of make_plant_indices within the build_gen_build_predetermined function.
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.
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
make_plant_indices
so that it returns a dictionary, rather than a tuple of lists. We also refactor profiles_to_switch.py to take the latest call signature.storage_candidate_buses
parameter and pass it along togrid_to_switch
.grid_to_switch
function to take astorage_candidate_buses
parameter and pass it to lower-level functionsbuild_generation_projects_info
andbuild_gen_build_costs
.storage_candidate_buses
and fill data tables appropriately.make_plant_indices
within thebuild_gen_build_predetermined
function.Testing
Tested manually, both with an without storage. Storage example:
Time estimate
30 minutes. The largest refactoring is in
build_gen_build_costs
, everything else is pretty straightforward.