-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat/data: update HIFLD data to April 2022 version, refactor line assignment #289
Conversation
raise ValueError("Interconnections were not separated successfully") | ||
interconnect_sizes = [len(c) for c in sorted_interconnects] | ||
raise ValueError( | ||
f"Interconnections were not separated successfully {interconnect_sizes}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized we require python 3.8 now, so we can add the equals sign to print name=value, e.g.
In [1]: x = [1,2]
In [2]: f"wow so cool {x=}"
Out[2]: 'wow so cool x=[1, 2]'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow so cool!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fancy!
867a7d2
to
94f6245
Compare
b2594d1
to
c220149
Compare
89c7873
to
a83c3da
Compare
.round({"VOLTAGE": 3}) | ||
) | ||
# Drop columns which aren't relevant to us. Some names are inconsistent b/w versions | ||
shape_lengths = {"SHAPE_Length", "SHAPE__Length"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is bad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. And this looks familiar to me which reminds me the days playing with country names from different datasets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
a83c3da
to
9aca491
Compare
9aca491
to
9152bd1
Compare
9152bd1
to
caeb98f
Compare
caeb98f
to
a2df748
Compare
Pull Request doc
Purpose
What the code is doing
load.py
, we're a bit more accommodating of the inconsistent naming of the Shape Length columns that we want to drop.topology.py
, we make sure that we tag all of the separated/reconnected lines with their appropriate interconnects.transmission.py
:map_lines_to_substations_using_coords
function so that if there are no substations 'close' to a line's endpoint (as defined by our new optional parameter), we create a new proxy substation for it. We do the KDTree/query process twice, where the first time just collects a list of transmission line endpoints with no substation, then we add proxy substations, and the second time we actually re-map all the lines.LINES
= 0, since this information seems to be very noisy.Testing
Tested manually to generate static grid components.
The resulting static grid components haven't been tested for network feasibility yet, so we may also need to update some of the line assumptions that were introduced in #276.EDIT: update: the results of this new code have been tested alongside the new code in #286 and new line/substation assumptions have been added which seem to ensure generator-side feasibility.Usage Example/Visuals
The call signature to
map_lines_to_substations_using_coords
remains the same, we just add one more optional parameter that controls how far away from any substation a line's endpoint can be before we create a new proxy substation for it (instead of connecting it to an existing one).Time estimate
30 minutes? The code changes are fairly light, most of the changes are in the constants which required a tedious guess-and-check process.
This is a draft PR for now, since the functionality depends partially on #283, and since we may want to make some modifications to the underlying logic, but the code that's here creates the interconnections as we expect.EDIT: #283 is merged, so this is ready to go.