Skip to content
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

feat: add code to plot shadow price data #52

Merged
merged 3 commits into from
Dec 11, 2019
Merged

feat: add code to plot shadow price data #52

merged 3 commits into from
Dec 11, 2019

Conversation

merrielle
Copy link
Collaborator

@merrielle merrielle commented Nov 28, 2019

Plotting an interesting hour:
plot_shadowprice('91', '2016-08-04 23:00:00'
Screen Shot 2019-11-19 at 6 31 18 PM

Plotting a boring hour. Note the values in the legend on the left.
plot_shadowprice('91', '2016-04-12 02:00:00')
Screen Shot 2019-11-19 at 6 31 54 PM

Plotting the same hour but with custom split points:
plot_shadowprice('91', '2016-04-12 02:00:00', [20,22,22.5,23,23.5])
Screen Shot 2019-11-19 at 6 33 23 PM

@rouille
Copy link
Collaborator

rouille commented Dec 2, 2019

Very nice.

In _construct_shadowprice_visuals, the title, Western Interconnect, is hard coded. I believe it should be a parameter of the function because the same will be made for Eastern, Texas and USA. This private function is caleed in the plot_shadowprice where you have access to a scenario instance. You can get the name of the interconnect as follow: scenario.info['interconnect'].split('_')

@merrielle
Copy link
Collaborator Author

Great catch. That was in the original code and I totally missed it! I'll go fix it now.

@merrielle
Copy link
Collaborator Author

Fixed. We can now handle Texas!

Screen Shot 2019-12-02 at 11 21 06 AM

@merrielle merrielle self-assigned this Dec 2, 2019
@rouille
Copy link
Collaborator

rouille commented Dec 3, 2019

Sorry I missed the typo in my first message but I believe that LMP ($ per MW) would be better. Ask your office mates but I believe we can drop the h here since we are in terested in the price per MegaWatt produced.

@rouille
Copy link
Collaborator

rouille commented Dec 3, 2019

_construct_branch_data returns a pandas.DataFrame but _construct_shadowprice_visuals is expected a bokeh.models.ColumnDataSource. I believe you can change the rtype of branc_data in _construct_shadowprice_visuals.

@rouille
Copy link
Collaborator

rouille commented Dec 3, 2019

In import statements:
l. 7: too many spaces

In docstrings:
degeree --> dgree (l. 18, l.174)
busses --> buses (l. 113)

Also, PyCharm complains about a lot of PEP8 violation. I can easily fix them before merging.

@merrielle
Copy link
Collaborator Author

Just checked and Daniel says LMP is $/mwh

If I'm still getting a lot of PEP8 violations, it seems like autopep8 isn't working so well on my machine. I'll be switching to pycharm after this sprint so hopefully after that it won't be a problem anymore. In the meantime, feel free to add a commit to fix the PEP8 issues.

@kasparm kasparm added this to the Sprint 2 milestone Dec 5, 2019
@merrielle
Copy link
Collaborator Author

Fixed!
Screen Shot 2019-12-05 at 1 41 09 PM

:type scenario_id: string
:param hour: the hour we will be analyzing
:type hour: string
:param lmp_split_points: the lmp values we have chosen to
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe change this line to:
:param lmp_split_points: the locational marginal pricing (lmp) ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Just updated it.

Copy link
Collaborator

@rouille rouille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Thanks.

Merrielle Ondreicka added 3 commits December 11, 2019 11:01
refactor: break shadowprice code into smaller functions

feat: make shadowprice code work

feat: automate lmp split points for busses

style: fix code style and imports
Finish tests

test: finish writing tests

fix: remove hardcoded interconnect
style: run autopep8 more aggressively to fix style

fix: Make legend titles include units

docs: update lmp_split_points docstring
@merrielle merrielle merged commit 402a8eb into develop Dec 11, 2019
@merrielle merrielle deleted the shadowprice branch December 11, 2019 19:03
@ahurli ahurli mentioned this pull request Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants