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] import topology to pgm-ds arrays from dictonary of pgm ComponentType #27

Open
Bramtimm opened this issue Feb 3, 2025 · 2 comments
Labels
feature New feature or request

Comments

@Bramtimm
Copy link

Bramtimm commented Feb 3, 2025

Considering I have a topology from power-grid-model in a dictionary, as from the power-grid-model-example below, I would like to have a simple interface/function to convert this to pgm-ds array objects. This would simplify the process of importing pgm topologies into pgm-ds.

Given the example below, the function should convert it to a dictionary of pgm-ds array objects. Optionally also supporting extension arrays if users have their own array objects.

I am happy to contribute to the implementation if needed.

from power_grid_model import ComponentType
from power_grid_model_ds import NodeArray, LineArray, LinkArray, TransformerArray, SourceArray

# PGM-topology
input_data = {
    ComponentType.node: node,
    ComponentType.line: line,
    ComponentType.sym_load: sym_load,
    ComponentType.source: source,
}

topology_pgm_ds = pgm_2_pgm_ds_converter(input_data, ...)

# PGM-DS topology
topology_pgm_ds = {
    "node": NodeArray,
    "line": LineArray,
    "link": LinkArray,
    "transformer": TransformerArray,
    "source":  SourceArray,
}
@Bramtimm Bramtimm changed the title [FEATURE] **import topology to pgm-ds arrays from dictonary of pgm ComponentType** [FEATURE] import topology to pgm-ds arrays from dictonary of pgm ComponentType Feb 3, 2025
@jaapschoutenalliander jaapschoutenalliander added the feature New feature or request label Feb 3, 2025
@Thijss
Copy link
Contributor

Thijss commented Feb 3, 2025

Sounds good to me. I think we want to switch to the ComponentType setup anyways. We can add a conversion method to the PGMInterface class

@jaapschoutenalliander
Copy link
Contributor

I agree with that it is a good feature to have. It makes integrating with the pgm-io conversion output easier as well. The design idea for adding it to the exesiting PGMInterface class is a good choice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants