Skip to content

data_manipulation_sh(network) fails to find biggest indices #133

@jankaeh

Description

@jankaeh

I don't know if I'm the only one stumbling over this, but the code of the function data_manipulation_sh(network) at eTraGo/utilities.py does not find the biggest index correctly on my System.

This code does not find the maximum of the indices correctly if they are str, because '9' is bigger than '1', '9999' is bigger than '10000':
new_bus = str(int(network.buses.index.max())+1)

I changed the lines 296-298 to:
new_bus = str(network.buses.index.astype(np.int64).max()+1)
new_trafo = str(network.transformers.index.astype(np.int64).max()+1)
new_line = str(network.lines.index.astype(np.int64).max()+1)

Maybe it's more robust.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions