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

Reorganize grid related modules and objects #650

Merged
merged 5 commits into from
Jun 9, 2022
Merged

Reorganize grid related modules and objects #650

merged 5 commits into from
Jun 9, 2022

Conversation

rouille
Copy link
Collaborator

@rouille rouille commented Jun 8, 2022

Pull Request doc

Purpose

Move and rename modules/classes/functions/tests related to grid creation from different sources and engines. The purpose is to make it clear where the data come from. To illustrate, we had a powersimdata.input.scenario_grid module for reading the grid.mat file created by REISE/REISE.jl. In the future we will likely have CEM scenarios ran with PyPSA and the grid will be converted differently. For this reason the current scenario_grid module is renamed reise_to_grid.

Please propose other names/location ideas if you have some in mind.

What the code is doing

No new code. Modules /classes/functions/tests have been renamed and relocated.

Testing

Run existing tests

Where to look

In the new powersimdata.input.converter and powersimdata.input.exporter modules

Usage Example/Visuals

N/A

Time estimate

It should be short.

@rouille rouille added the refactor Code that is being refactored label Jun 8, 2022
@rouille rouille self-assigned this Jun 8, 2022
@rouille rouille changed the title Ben/grid Reorganize grid related modules and objects Jun 8, 2022
Copy link
Collaborator

@BainanXia BainanXia left a comment

Choose a reason for hiding this comment

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

Make sense.

import pandas as pd


def add_column_to_data_frame(data_frame, column_dict):
Copy link
Contributor

Choose a reason for hiding this comment

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

Just looking through (and this is really just a stupid side-comment), there is the nice pandas version assign for that purpose

df = df.assign(**column_dict)

might be helpful for future implementations

Copy link
Collaborator Author

@rouille rouille Jun 9, 2022

Choose a reason for hiding this comment

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

Should I get rid of the add_column_to_data_frame function and used assign when needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@rouille rouille merged commit d1a411e into develop Jun 9, 2022
@rouille rouille deleted the ben/grid branch June 9, 2022 21:31
@jenhagg jenhagg mentioned this pull request Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code that is being refactored
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants