-
Notifications
You must be signed in to change notification settings - Fork 13
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
Improve shadow price plotting module #206
Conversation
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. Thanks.
There are a few places in the code where we use |
41817de
to
302ac62
Compare
I have simplified the for loops. In particular the one dealing with the color bar. The only difference with the previous version is that all bins spanning more than 5 $/MWh have size 5 now. Previously it would be only set for the first and last bins, resulting eventually in oversized bins in the middle (see plot below): BeforeAfter |
302ac62
to
7b4e98f
Compare
|
||
:param list/tuple/set/numpy.array lmp_split_points: lmp values chosen to split | ||
the bus data | ||
:param list x_range: the x-range for the vertical bar |
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 seems that this parameter is never actually used in this function, and the relevant info could be added to the bars
dict within _construct_bus_legend
, after the return from _get_bus_legend_bars_and_labels
.
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.
Yes I saw that. Same thing with bar_length_sum
, it is equal to max(bars.values)
and hence does not need to be returned.
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.
Done
color=SHADOW_PRICE_COLORS[: (len(bars) - 1)], | ||
source=bars, | ||
color=shadow_price_pallette[: len(bars)], | ||
source={**{"x_range": [""]}, **bars}, |
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.
Clever.
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, thanks.
Purpose
Improve
plot_shadowprice_map
module. Changes are mostly related to docstringTesting
Ran associated notebook
Where to look
plot_shadowprice_map
:hour
todate
shadowprice_map_demo
:show
frombokeh.io
and encapsulate the call toplot_shadowprice
pandas
and usepd.Timestamp
to pass the timestamp of the hour to plot toplot_shadowprice
Usage Example/Visuals
shadowprice_map_demo
notebookTime estimate
10 min