-
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
Refactor geographical part of model immutables #692
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.
It's much cleaner 🚀 One minor comment is not sure we would like to call the subfolder "technology", maybe "component" makes more sense? Another comment out of the scope of this PR is we might get rid of the concept of load zones in the future to support multilayer spatial resolution co-exist and let the user specify distributing demand based on which one with corresponding demand profile selected during scenario creation.
I can rename the folder to component. We could also used carrier as PyPSA. Regarding your second comment, we will likely have to refactor a lot of section of the code in PowerSimData/PostREISE to enable this new feature. We will think about it when it comes our way. |
What do you think @BainanXia, component or carrier? |
I don't have strong preferences between |
9d6dea1
to
4518588
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.
Thanks
Pull Request doc
Purpose
The main purpose is to factor out the building of the geographical part of the model immutables from the
TUB
class so it can be dhared by any PyPSANetork
object. The refactor adds flexibity by allowing to instantiate aModelImmutables
class from a CSV file stored on disk (as currentlt done for theusa_tamu
grid model) or a PyPSANetwork
object for any grid modelAlso, generator/storage related constants were moved in a new powersimdata/network/constants/technology folder and refactor geographical part of the model immutables following .same logic than generators.
What the code is doing
The starting point is a data frame enclosing minimal information on mappings that is augmented using some constants for a region (USA and EU) given in the
powersimdata.network.constants.region.geography
module. All the mappings are then derived from this data frame.Testing
Some existing tests were refactored to account for the new logic
Where to look
A lot of new module with very little code. Small classes are used to break up USA vs EU for different mappings (interconnect, state/country, loadzone)
The trickiest part was to replace ERCOT with Texas and reorder the names (ERCOT_Eastern --> Eastern Texas) for the
usa_tamu
model since all constants uses ERCOT. This is done in theUSA
class of the `powersimdata.network.constants.region.geography module.Usage Example/Visuals
N/A
Time estimate
30min