You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran the example scenario demo_texas.py from the website. Calculated the congestion_surplus following the code snippet on the website. Its give the error shown below.
Here the bus_demand has different shape than bus_pg. The reason is get_bus_demand returns demand for the whole time range, whereas lmp, pg, bus_pg all have the input simulation range. I can make a small modification in calculate_congestion_surplus to overcome this issue:
bus_demand=get_bus_demand(scenario.info, grid).to_numpy()
## hack ######## bus demand gives output for whole range of time# but pg, lmp, bus_pg is calculated for input range of# time hence (bus_demand - bus_pg) throws errorindex_min=pg.index.get_loc(pg.index[0])
index_max=pg.index.get_loc(pg.index[-1])
bus_demand=bus_demand[index_min:index_max+1]
## hack end ###
Hi @jithesh82, thanks for bringing this to our attention. This issue has been fixed via changes to both PostREISE and PowerSimData (where the get_bus_demand function was defined). If you update PowerSimData to at least v0.5.0 and PostREISE to at least v0.5.1 (or use the latest version of each), you should no longer see this issue.
danielolsen
changed the title
Bug report
Calling calculate_congestion_surplus on a partial-year Scenario causes an error
Feb 5, 2022
🪲
Bug summary
I ran the example scenario demo_texas.py from the website. Calculated the congestion_surplus following the code snippet on the website. Its give the error shown below.
Code for reproduction
Actual outcome
Analysis
The error is thrown from calculate_congestion_surplus from the line:
Here the bus_demand has different shape than bus_pg. The reason is get_bus_demand returns demand for the whole time range, whereas lmp, pg, bus_pg all have the input simulation range. I can make a small modification in calculate_congestion_surplus to overcome this issue:
Environment
Comments
Please have a look at it. Thanks a lot for your kind help, support and work.
Best regards,
-Jithesh
The text was updated successfully, but these errors were encountered: