powersimdata.design.transmission package¶
Subpackages¶
- powersimdata.design.transmission.tests package
- Submodules
- powersimdata.design.transmission.tests.test_mwmiles module
TestCalculateMWMiles
TestCalculateMWMiles.setUp()
TestCalculateMWMiles.test_calculate_mw_miles_many_scaled()
TestCalculateMWMiles.test_calculate_mw_miles_many_scaled_one_branch_excluded()
TestCalculateMWMiles.test_calculate_mw_miles_many_scaled_two_branches_excluded()
TestCalculateMWMiles.test_calculate_mw_miles_no_scale()
TestCalculateMWMiles.test_calculate_mw_miles_one_line_scaled()
TestCalculateMWMiles.test_calculate_mw_miles_one_transformer_scaled()
- powersimdata.design.transmission.tests.test_statelines module
TestClassifyInterstateIntrastate
TestClassifyInterstateIntrastate.setUp()
TestClassifyInterstateIntrastate.test_classify_interstate_intrastate_bad_ct()
TestClassifyInterstateIntrastate.test_classify_interstate_intrastate_empty_ct()
TestClassifyInterstateIntrastate.test_classify_interstate_intrastate_none()
TestClassifyInterstateIntrastate.test_classify_interstate_intrastate_several()
TestClassifyInterstateIntrastate.test_classify_interstate_intrastate_two()
- powersimdata.design.transmission.tests.test_substations module
- powersimdata.design.transmission.tests.test_upgrade module
TestConstructCompositeAllowlist
TestConstructCompositeAllowlist.test_allow_list_and_deny_list_failure()
TestConstructCompositeAllowlist.test_bad_allow_list_entry_type()
TestConstructCompositeAllowlist.test_bad_allow_list_value()
TestConstructCompositeAllowlist.test_bad_deny_list_type()
TestConstructCompositeAllowlist.test_bad_deny_list_value()
TestConstructCompositeAllowlist.test_good_allow_list()
TestConstructCompositeAllowlist.test_good_deny_list()
TestConstructCompositeAllowlist.test_none_none()
TestGetBranchesByArea
TestGetBranchesByArea.setUp()
TestGetBranchesByArea.test_bad_area_name()
TestGetBranchesByArea.test_bad_area_type()
TestGetBranchesByArea.test_bad_grid_type()
TestGetBranchesByArea.test_bad_method_name()
TestGetBranchesByArea.test_bad_method_type()
TestGetBranchesByArea.test_bridging_multi_state()
TestGetBranchesByArea.test_bridging_oregon()
TestGetBranchesByArea.test_bridging_washington()
TestGetBranchesByArea.test_either_multi_state()
TestGetBranchesByArea.test_either_oregon()
TestGetBranchesByArea.test_either_washington()
TestGetBranchesByArea.test_internal_multi_state()
TestGetBranchesByArea.test_internal_oregon()
TestGetBranchesByArea.test_internal_washington()
TestIdentifyMesh
TestIdentifyMesh.setUp()
TestIdentifyMesh.test_identify_mesh_MW_n_1()
TestIdentifyMesh.test_identify_mesh_MW_n_2()
TestIdentifyMesh.test_identify_mesh_MW_n_2_allow_list()
TestIdentifyMesh.test_identify_mesh_MW_n_2_deny_list()
TestIdentifyMesh.test_identify_mesh_MW_n_3()
TestIdentifyMesh.test_identify_mesh_MWmiles_n_1()
TestIdentifyMesh.test_identify_mesh_MWmiles_n_2()
TestIdentifyMesh.test_identify_mesh_MWmiles_n_3()
TestIdentifyMesh.test_identify_mesh_bad_method()
TestIdentifyMesh.test_identify_mesh_branch_upgrades_default()
TestIdentifyMesh.test_identify_mesh_branch_upgrades_n_2()
TestIdentifyMesh.test_identify_mesh_branch_upgrades_n_3()
TestIdentifyMesh.test_identify_mesh_branch_upgrades_n_4()
TestIdentifyMesh.test_identify_mesh_branch_upgrades_quantile90()
TestIdentifyMesh.test_identify_mesh_mean()
TestIdentifyMesh.test_identify_mesh_mean_n_1()
TestIdentifyMesh.test_identify_mesh_mean_n_2()
TestIdentifyMesh.test_identify_mesh_mean_n_3()
TestIdentifyMesh.test_identify_mesh_mean_n_4()
TestIdentifyMesh.test_identify_mesh_mean_n_4_specify_quantile()
TestIncrementBranch
TestIncrementBranch.setUp()
TestIncrementBranch.test_increment_branch_scaling_ref_and_ct_and_increment1()
TestIncrementBranch.test_increment_branch_scaling_ref_and_ct_and_increment2()
TestIncrementBranch.test_increment_branch_scaling_ref_and_custom_increment()
TestIncrementBranch.test_increment_branch_scaling_ref_and_increment()
TestIncrementBranch.test_increment_branch_scaling_ref_only()
TestScaleRenewableStubs
TestScaleRenewableStubs.test_empty_ct_inplace_default()
TestScaleRenewableStubs.test_empty_ct_inplace_false()
TestScaleRenewableStubs.test_empty_ct_inplace_true()
TestScaleRenewableStubs.test_empty_ct_no_fuzz()
TestScaleRenewableStubs.test_existing_ct_unrelated_branch_id()
TestScaleRenewableStubs.test_existing_ct_zone_id_solar_wind()
TestScaleRenewableStubs.test_existing_ct_zone_id_wind()
TestStubTopologyHelpers
TestStubTopologyHelpers.setUp()
TestStubTopologyHelpers.test_find_branches_connected_to_bus_1()
TestStubTopologyHelpers.test_find_branches_connected_to_bus_4()
TestStubTopologyHelpers.test_find_branches_connected_to_bus_5()
TestStubTopologyHelpers.test_find_capacity_at_bus_1_solar_str()
TestStubTopologyHelpers.test_find_capacity_at_bus_1_solar_tuple()
TestStubTopologyHelpers.test_find_capacity_at_bus_2_wind()
TestStubTopologyHelpers.test_find_capacity_at_bus_7_solar()
TestStubTopologyHelpers.test_find_capacity_at_bus_7_solar_ng()
TestStubTopologyHelpers.test_find_first_degree_branches_101()
TestStubTopologyHelpers.test_find_first_degree_branches_108()
TestStubTopologyHelpers.test_find_stub_degree_1()
TestStubTopologyHelpers.test_find_stub_degree_5()
TestStubTopologyHelpers.test_find_stub_degree_7()
- Module contents
Submodules¶
powersimdata.design.transmission.mwmiles module¶
- powersimdata.design.transmission.mwmiles.calculate_mw_miles(scenario, exclude_branches=None)[source]¶
Given a Scenario object, calculate the number of upgraded lines and transformers, and the total upgrade quantity (in MW and MW-miles). Currently only supports change tables that specify branches’ id, not zone name. Currently lumps Transformer and TransformerWinding upgrades together.
- Parameters:
scenario (powersimdata.scenario.scenario.Scenario) – scenario instance.
exclude_branches (list/tuple/set/None) – branches to exclude.
- Returns:
(dict) – Upgrades to the branches.
powersimdata.design.transmission.statelines module¶
- powersimdata.design.transmission.statelines.classify_interstate_intrastate(scenario)[source]¶
Classifies branches in a change_table as interstate or intrastate.
- Parameters:
scenario (powersimdata.scenario.scenario.Scenario) – scenario instance.
- Returns:
(dict) – keys are ‘interstate’, ‘intrastate’. Values are list of branch ids.
powersimdata.design.transmission.substations module¶
- powersimdata.design.transmission.substations.calculate_substation_capacity(grid)[source]¶
For each substation in a grid, calculate the total substation transmission capacity (in a transport model, ignoring power flow).
- Parameters:
grid (powersimdata.input.grid.Grid) – a grid instance.
- Returns:
(pandas.Series) – index is substation IDs, value are total transmission capacity (MW).
powersimdata.design.transmission.upgrade module¶
- powersimdata.design.transmission.upgrade.get_branches_by_area(grid, area_names, method='either')[source]¶
Given a set of area names, select branches which are in one or more of these areas.
- Parameters:
grid (powersimdata.input.grid.Grid) – Grid to query for topology.
area_names (list/set/tuple) – an iterable of area names, used to look up zone names.
method (str) – whether to include branches which span zones. Options: - ‘internal’: only select branches which are to/from the same area. - ‘bridging’: only select branches which connect area to another. - ‘either’: select branches if either end is in area. Equivalent to ‘internal’ + ‘bridging’.
- Returns:
(set) – a set of branch IDs.
- Raises:
TypeError – if area_names not a list/set/tuple, or method not a str.
ValueError – if not all elements of area_names are strings, if method is not one of the recognized methods.
- powersimdata.design.transmission.upgrade.scale_congested_mesh_branches(change_table, ref_scenario, upgrade_n=100, allow_list=None, deny_list=None, congestion_metric='quantile', cost_metric='branches', quantile=None, increment=1)[source]¶
Use a reference scenario to detect congested mesh branches (based on values of the shadow price of congestion), and increase the capacity of a subset of them. Branches are ranked by a ratio of (congestion metric) / (cost metric), and the top N branches are selected for upgrading, where N is specified by
upgraade_n
, with each upgraded by their base capacity multiplied byincrement
.- Parameters:
change_table (powersimdata.input.change_table.ChangeTable) – ChangeTable object.
ref_scenario (powersimdata.scenario.scenario.Scenario) – the reference scenario to be used in bootstrapping the branch scaling factors.
upgrade_n (int) – the number of branches to upgrade.
allow_list (list/set/tuple/None) – only select from these branch IDs.
deny_list (list/set/tuple/None) – never select any of these branch IDs.
congestion_metric (str) – numerator method: ‘quantile’ or ‘mean’.
cost_metric (str) – denominator method: ‘branches’, ‘cost’, ‘MW’, or ‘MWmiles’.
quantile (float) – if
congestion_metric
== ‘quantile’, this is the quantile to use to judge branch congestion (otherwise it is unused). If None, a default value of 0.95 is used, i.e. we evaluate the shadow price for the worst 5% of hours.increment (float/int) – branch increment, relative to original capacity.
- Returns:
(None) – the change_table is modified in-place.
- Raises:
ValueError – if
ref_scenario
is not in analyze state.
- powersimdata.design.transmission.upgrade.scale_renewable_stubs(change_table, fuzz=1, inplace=True, verbose=False)[source]¶
Identify renewable gens behind ‘stub’ branches, scale up branch capacity (via change_table entries) to match generator capacity.
- Parameters:
change_table (powersimdata.input.change_table.ChangeTable) – ChangeTable object.
fuzz (float/int) – adds just a little extra capacity to avoid binding.
inplace (bool) – if True, modify ct inplace and return None. If False, copy ct and return modified copy.
verbose (bool) – if True, print info for each unscaled plant.
- Returns:
(None/dict) – if inplace is True, return modified ct dict.
powersimdata.design.transmission.zones module¶
- powersimdata.design.transmission.zones.calculate_interzone_capacity(grid)[source]¶
For each zone in a grid, calculate the aggreagte zone transmission capacity (in a transport model, ignoring power flow).
- Parameters:
grid (powersimdata.input.grid.Grid) – a grid instance.
- Returns:
(pandas.Series) – index is zone IDs, values are total transmission capacity (MW).