Skip to content

Commit

Permalink
in reindex_elements: fixed index error when reindexing line_geodata
Browse files Browse the repository at this point in the history
  • Loading branch information
mrifraunhofer committed Feb 16, 2024
1 parent bba0929 commit 88eb520
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Change Log
- [ADDED] function :code:`getOTDF` to obtain Outage Transfer Distribution Factors, that can be used to analyse outages using the DC approximation of the power system
- [ADDED] function :code:`outage_results_OTDF` to obtain the matrix of results for all outage scenarios, with rows as outage scenarios and columns as branch power flows in that scenario
- [FIXED] add some safeguards for TDPF to avoid numerical issues in some cases
- [FIXED] in reindex_elements: fixed index error when reindexing line_geodata


[2.13.1] - 2023-05-12
Expand Down
3 changes: 2 additions & 1 deletion pandapower/toolbox/data_modification.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ def reindex_elements(net, element_type, new_indices=None, old_indices=None, look
idx_name = net.line_geodata.index.name
place_holder = uuid.uuid4()
net["line_geodata"][place_holder] = net["line_geodata"].index
net["line_geodata"].loc[old_indices, place_holder] = get_indices(old_indices, lookup)
net["line_geodata"].loc[old_indices.intersection(net.line_geodata.index), place_holder] = (
get_indices(old_indices.intersection(net.line_geodata.index), lookup))
net["line_geodata"].set_index(place_holder, inplace=True)
net["line_geodata"].index.name = idx_name

Expand Down

0 comments on commit 88eb520

Please sign in to comment.