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

data: update hydro Pmax to reflect latest profile max #162

Merged
merged 1 commit into from
May 5, 2020

Conversation

danielolsen
Copy link
Contributor

Purpose

Update hydro Pmax to reflect latest profile max. This will let us run the renewable stub scaling on hydro plants, and automatically fix any transmission problems that would be caused by a mismatch between stub capacity and profile values.

What is the code doing

No code is being added. The following code was used to diagnose the problem plants and update their values:

>>> import pandas as pd
>>> from powersimdata.input.grid import Grid
>>> usa = Grid(['USA'])
Reading bus.csv
Reading plant.csv
Reading gencost.csv
Reading branch.csv
Reading dcline.csv
Reading sub.csv
Reading bus2sub.csv
Reading zone.csv
>>> plant = usa.plant
>>> hydro = pd.read_csv("usa_hydro_v4.csv", index_col=0)
>>> violations = {}
>>> hydro_max = hydro.max()
>>> for i in hydro_max.index:
...     if hydro_max.loc[i] > plant.loc[int(i), 'Pmax']:
...             violations[i] = (hydro_max.loc[i], plant.loc[int(i), 'Pmax'])
...
>>> len(violations)
1718
>>> plant_csv = pd.read_csv("../powersimdata/powersimdata/input/data/usa_tamu/plant.csv", index_col=0, dtype=str)
>>> for k, v in violations.items():
...     plant_csv.loc[int(k), 'Pmax'] = '{:.03f}'.format(v[0])
...
>>> plant_csv.to_csv("../powersimdata/powersimdata/input/data/usa_tamu/plant.csv")

Time to review

15 minutes. You can check through the code and make sure that everything is being done properly, and check the CSV to ensure that no plants besides hydro are being modified, that modifications are only to Pmax, and/or that modifications only ever increase capacity.

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.

I checked that only the Pmax of hydro plants were modified and that the corresponding maximum power output in the profile was used ti update the value in the TAMU plant.csv file.

@danielolsen danielolsen merged commit 9814742 into develop May 5, 2020
@danielolsen danielolsen deleted the hydro_pmax_update branch May 5, 2020 20:08
@ahurli ahurli mentioned this pull request Mar 11, 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.

2 participants