-
Notifications
You must be signed in to change notification settings - Fork 40
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
add data structure for expansion candidates #679
Conversation
:param pd.DataFrame storage: dataframe of storage candidates | ||
:param powersimdata.input.grid.Grid grid: reference grid | ||
""" | ||
check_bus_id(storage.bus_id, grid) |
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 all these functions could be used in a PCM workflow and hence could live in the powersimdata.input.check
module. To illustrate, we could use these functions when adding new storage, branches, plants and storage in the change table.
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.
I had the same thought but didn't want to expand the scope. The bus id check could be easy to refactor. I just noticed we have a function _check_line_voltages
already but that is used to check the consistency of an existing grid, so we would have to refactor it (or add a separate function) to compare new branches with a given bus dataframe. I'm not seeing a check for that in the change table - is that something we should have? If it's missing, that might be worth adding, but I was planning to hold off on refactoring until there is a bit more cem progress.
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.
Sounds good.
I believe we check that the bus(es) exist when adding a new line, a plant or a storage in the change table. You are right, we don't check the voltages. It could be added.
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
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.
Recall our discussion of data structures to incorporate multiple investment years in CEM. We will either do ec_all[year] = ec
or having columns for each year in candidate data frames. With this implementation, I presume we lean towards the former.
Yeah I hadn't figured that part out yet, but I think adding the columns makes sense, and usually prefer not to duplicate data. |
Purpose
Define a new data structure for expansion candidates and some preliminary validation based on the current grid. The schema is the same as in #641 but I refactored it a bit.
What the code is doing
Add the new class, which can have candidates for branches, plants, and storage. Each one has a set of allowed columns and required columns. When assigning a given type of candidate, there are some basic checks - e.g. buses are in the grid. I imagine more checks could be done in subsequent PRs.
We've discussed expanding the costs over multiple years to account for inflation - this isn't accounted for yet, and I suspect it might be done during the preparation phase, after a user has defined the investment years/time span.
In general there is probably a lot from the original epic that isn't implemented yet. E.g. defining branch candidates by substation instead of buses. This is just meant to be a usable subset of the possible/desired schema.
Testing
New unit tests
Usage Example/Visuals
Create an instance:
After assigning some values (using the example from the unit test), we can inspect it using the custom
repr
Or look at the data frames directly (similar for storage). Note the indexes are not required, that's an artifact of using the existing grid as an example:
Time estimate
30 min