-
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: correct type of new bus index in Grid.bus2sub #361
Conversation
I guess this bug could have also been fixed by removing the bracket to the |
Yes, that would be equivalent. Based on the naming |
Yeah, we call this variable |
5574fe2
to
fd47855
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.
Looks good
Do you think I should rename to match? |
Do you read my mind? It is up to you. |
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.
It looks good to me. I vote for being consistent in naming variables though :)
fd47855
to
a23e7b6
Compare
Variables are tweaked, and a test is added that would catch the issue if there's a regression. |
Purpose
Fix a bug, introduced in #352, for the indexing of the bus2sub table when calling
scenario.state.get_grid()
on a Scenario in Create state with one or more new buses.What the code is doing
We fix
new_bus_id
so that it is an int, not a list, and wrap this int into a new list when appending to thebus
dataframe. This avoids a 'double-listing' that creates a tuple as the new index in thebus2sub
table.Testing
Previously:
After the fix:
Time estimate
2 minutes.