-
Notifications
You must be signed in to change notification settings - Fork 40
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: add module to 'design' scenarios, starting with renewable stub scaling #80
Conversation
fix: ensure renewable stub scaling works starting with empty change table fix: ensure renewable stub scaling works starting with empty change table (for real) fix: ensure renewable stub scaling works starting with empty change table (for real for real)
I will look in more details tomorrow or, if I don't find the time, Thursday. Quick question, did you consider having |
@rouille do you mean where the method is invoked from, or where the code lives? I am agnostic on where it's invoked from, and it could be from change_table if you think that fits better. I see that the ChangeTable has a Grid object which we could use to do topology analysis. For where the code lives, I like having a new |
I am talking about where the method is invoked. Right now it is in the |
Okay, I will change it. |
Invocation has been moved. Bonus, it cuts down on the printing because we don't instantiate a new grid! Unit testing:
Integration testing:
|
Yes, I was expecting the printing to be reduced. So, if I read the code well, it seems that |
If you call |
I remember doing that. The idea behind was that if you make a mistake in the scaling, you can easily overwrite without having to manually pop entries in the dictionary. |
Maybe it would be worth adding an option to the |
Not a bad idea |
Demo:
|
Looks good. Thanks. |
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.
Super duper nice
…ious scalings, add clear() method
8bd0439
to
3620e52
Compare
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.
Using this for a while and finally I got a chance to give a pass of the code. Nice work.
This feature adds the automatic scaling of renewable stub branches that was used in the Western, Eastern, and USA Scenario runs. It analyzes the topology of the network, starting at each renewable generator and finding 'stub' branches--branches which are the only path between a given node and anywhere else in the network. In graph theory, these branches would be considered 'bridges', although this is currently a cruder implementation that will not detect when a stub is 'tree-shaped' rather than a series of singular links (this could be improved via the use of
networkx
or a similar graph theory package).Once a builder is assigned, this feature is called via:
scenario.state.builder.scale_renewable_stubs()
, with optional kwargs passed through to the implementation inpowersimdata/input/design.py
.To support testing, I've created
mock_builder.py
andmock_change_table.py
to contain new mock objects used in the tests for the functions inpowersimdata/input/design.py
.Unit tests:
Implementation test. First we start with a vanilla Western scenario. The change_table is initially empty, and remains functionally empty after stub scaling (since renewables haven't been overbuilt). Once we scale up renewables, calling the stub scaling again adds branch scaling to the change_table.