-
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 flexibility of map plots #199
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, much cleaner
eb26241
to
0a056ec
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.
Thank you for making these changes to make the code more flexible and cleaner. All looks good.
postreise/plot/plot_lmp_map.py
Outdated
:return: (bokeh.layout.row) bokeh map visual in row layout | ||
:param inf/float lmp_min: minimum LMP to clamp plot range to. | ||
:param inf/float lmp_max: maximum LMP to clamp plot range to. | ||
:return: (*bokeh.models.layout.Row*) bokeh map visual in row layout | ||
""" | ||
if us_states_dat is None: | ||
us_states_dat = us_states.data | ||
|
||
bus = project_bus(s_grid.bus) | ||
lmp_split_points = list(range(0, 256, 1)) |
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.
Are we ever going to modify the above range? if not it could be define in def _get_bus_legend_bars_and_labels
and we don't have to propagate it from function to function. Or we could make it a global variable.
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.
Good point. Previously, it had been passed to both _construct_bus_data
and _construct_shadowprice_visuals
(although not used in _construct_bus_data
as of the code in develop
right now). I will move it as you suggest.
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. Saves us 8 lines too!
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.
Yeah, I felt the linter going faster in the checks
Purpose
What the code is doing
lmp_min
andlmp_max
parameters topostreise.plot.plot_lmp_map.map_lmp
, with default values equal to the previous hardcoded values.vmin
andvmax
topostreise.plot.plot_utilization_map.map_risk_bind
andpostreise.plot.plot_utilization_map.map_utilization
, with defaults equal to data min/max (same as before)postreise.plot.plot_carbon_map.get_borders
topostreise.plot.projection_helpers.project_borders
Testing
Relevant notebooks in postreise/plot/demo run successfully.
Time estimate
15-30 minutes. New features are pretty minimal, the rest of the changes are mostly reorganization.