-
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
fix: ensure that get_bus_demand works in Create state #422
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,6 +149,7 @@ def get_bus_demand(self): | |
|
||
:return: (*pandas.DataFrame*) -- data frame of demand (hour, bus). | ||
""" | ||
self._update_scenario_info() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It makes sense. I am confused to why it was working before without the update. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the bug has been introduced because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did we test it in Create state after #388? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably not but I thought this was a feature you were using before creating each scenario. That's why I am surprised you just found the bug now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, this method was not part of my usual scenario setup process. REISE.jl does the same thing within the Julia code though. This feature was mostly being used for scenarios in Analyze state. |
||
grid = self.get_grid() | ||
return get_bus_demand(self._scenario_info, grid) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import pytest | ||
|
||
from powersimdata.scenario.scenario import Scenario | ||
|
||
|
||
@pytest.mark.ssh | ||
def test_get_bus_demand(): | ||
scenario = Scenario("") | ||
scenario.state.set_builder(interconnect="Texas") | ||
scenario.state.builder.set_base_profile("demand", "vJan2021") | ||
scenario.state.get_bus_demand() |
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.
Nice safeguard