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

[feature] Make bus element checks in create_switches optional #2303

Open
4 of 7 tasks
thomas-whaley-poco opened this issue Jun 11, 2024 · 0 comments
Open
4 of 7 tasks

Comments

@thomas-whaley-poco
Copy link

Feature Checklist

Feature Type

  • Adding new functionality to pandapower

  • Changing existing functionality in pandapower

  • Removing existing functionality in pandapower

Problem Description

I am writing a pipeline that converts large DataFrames to a large pandapower network. I estimate the size of the DataFrame containing switch data to be over 50,000 rows. Simply running the create_switches function with this DataFrame takes 10-20 minutes, whereas functions like create_lines take less than a minute with a similar sized DataFrame.

I understand this is caused because it is checking if the bus and element matches the element type and is a valid bus. In my situation, I would prefer to have this function run in less than a minute than being sure the busses are valid.

def create_switches(net, buses, elements, et, closed=True, type=None, name=None, index=None,
                    z_ohm=0, in_ka=nan, **kwargs):
    ...
    # This is very slow when len(elements) is very large
    for element, elm_type, bus in zip(elements, et, buses):
        ...
    ...

Feature Description

Perhaps there could be a new flag in create_switches (maybe validate_busses=True), which would determine if the for loop runs or not.

Additional Context

def create_switches(net, buses, elements, et, closed=True, type=None, name=None, index=None,
                    z_ohm=0, in_ka=nan, validate_busses=True, **kwargs):
    ...
    if validate_busses:
        for element, elm_type, bus in zip(elements, et, buses):
            ...
    ...

Label

  • Relevant labels are selected
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

No branches or pull requests

1 participant