fix: correct bug where get_dcline_differences fails for DC lines connected to new buses #299
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request doc
Purpose
Correct a bug where the
postreise.analyze.transmission.upgrades.get_dcline_differences
fails when comparing a grid with dclines connected to new buses. This also blocks thepostreise.plot.plot_transmission_upgrades_map.map_transmission_upgrades
function which relies on it.Demonstration of bug
What the code is doing
Previously, within
get_dcline_differences
, bothdcline
tables looked up latitudes and longitudes from the a singlebus
table, and themap_transmission_upgrades
function passed thebus
table corresponding to the firstdcline
table, which fails when the seconddcline
table points to buses that aren't in the firstbus
table. To fix this, we refactor theget_dcline_differences
function to take two grids, and we look up the latitudes and longitudes from each correspondingbus
table before merging the twodcline
tables together to calculate thePmax
differences.Testing
Manually testing, the call that had failed before works:
(does not fail)
Time estimate
5-15 minutes.