feat: add lines to HIFLD dataset before further processing #292
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
Add the ability to append the existing HIFLD lines dataset with additional manually-defined lines. This allows us to fill in parts of the grid where we know there are transmission lines, but these lines are missing for whatever reason. This should be at least partial fulfillment of #234; we get the capability to manually add lines, but we don't yet have a full set of required lines to connect urban areas with lots of undergrounding, or logic to estimate their connectivity.
What the code is doing
add_proxy_lines
which takes data from const.py and uses it to populate required information to add to thebranch
data frame. It adds one new column"line_design_assumptions"
which will get used in the refactored version ofadd_lines_impedances_ratings
.add_lines_impedances_ratings
, we modify the logic so that we first identify the design for each transmission line (using either the default for that voltage or the defined overrides), then we check for a"line_design_assumptions"
column and if this is present, override the design with the design tuple from this column, and then finally use the aggregated design mapping to create aLine
object for each branch so that we can estimate rating and impedance. This way, the data in const.py can have non-default designs without needing to use the existing{branch_id: design}
mapping schema in const.py, since we won't know the ID of these newly-added lines in advance (their IDs get generated based on the max ID of the other branches).build_transmission
, we calladd_proxy_lines
before we connect the branches via the minimum spanning tree, so that manually-defined branches which connect islands will avoid the logic which would otherwise create new branches. This way, even if a branch would get added via the minimum spanning tree logic, it can be entirely replaced with a different branch if we want the branch to have different characteristics.Testing
Tested manually.
Time estimate
30 minutes.
This is a draft PR for now, since it relies on code in #286.