Hello everyone!
Today, PowerGridModelInterface.create_grid_from_input_data() creates a base Grid from PGM input data (standard conversion step from the Power Grid Model engine input into a PGM‑DS Grid).
In many workflows, we want to work with an extended grid (Extended_Grid(Grid)) to add specific attributes (for example an extended LinkArray with a field like link_type) while keeping the rest of the grid unchanged. The documentation shows that PGM‑DS is explicitly designed to support grid extensions by subclassing arrays and the Grid dataclass.
However, from what I’ve understood, starting from a base Grid produced by create_grid_from_input_data() and converting it into an Extended_Grid is currently not implemented, and thus requires manually reconstructing / appending many arrays one-by-one. Having a direct base→extended conversion would avoid manual reconstruction and makes these workflows much easier to implement correctly.
What would be great is a built-in way to take the base Grid created from PGM input data and then promote/extend it into an Extended_Grid by only providing the extended parts, e.g. only node/line/link replaced by Node_Extended_Array, Line_Extended_Array, Link_Extended_Array, while all other component arrays (transformers, loads, sensors, etc.) are reused as-is.
Maybe it exists such functions but I haven't found them, so if you have more informations it would be great!
Thank you
Hello everyone!
Today, PowerGridModelInterface.create_grid_from_input_data() creates a base Grid from PGM input data (standard conversion step from the Power Grid Model engine input into a PGM‑DS Grid).
In many workflows, we want to work with an extended grid (Extended_Grid(Grid)) to add specific attributes (for example an extended LinkArray with a field like link_type) while keeping the rest of the grid unchanged. The documentation shows that PGM‑DS is explicitly designed to support grid extensions by subclassing arrays and the Grid dataclass.
However, from what I’ve understood, starting from a base Grid produced by create_grid_from_input_data() and converting it into an Extended_Grid is currently not implemented, and thus requires manually reconstructing / appending many arrays one-by-one. Having a direct base→extended conversion would avoid manual reconstruction and makes these workflows much easier to implement correctly.
What would be great is a built-in way to take the base Grid created from PGM input data and then promote/extend it into an Extended_Grid by only providing the extended parts, e.g. only node/line/link replaced by Node_Extended_Array, Line_Extended_Array, Link_Extended_Array, while all other component arrays (transformers, loads, sensors, etc.) are reused as-is.
Maybe it exists such functions but I haven't found them, so if you have more informations it would be great!
Thank you