NREL-Sienna / PowerSystems.jl

Data structures in Julia to enable power systems analysis. Part of the Scalable Integrated Infrastructure Planning Initiative at the National Renewable Energy Lab.
https://nrel-sienna.github.io/PowerSystems.jl/stable/
BSD 3-Clause "New" or "Revised" License
314 stars 79 forks source link

`System` constructor keyword argument `load_zone_formatter` is ignored #1160

Closed GabrielKS closed 2 months ago

GabrielKS commented 4 months ago

There is a kwarg load_zone_formatter listed as one of the supported SYSTEM_KWARGS: https://github.com/NREL-Sienna/PowerSystems.jl/blob/71b9bf406ef7001eb5d6b56cc780b73093c9eb54/src/base.jl#L13 but, unlike all the other SYSTEM_KWARGS, nothing is ever done with it. This is the only reference to it in the codebase. I'm currently in a situation where I need to remap the names of load zones, so it would be nice to support this behavior as we do for buses, generators, branches, etc.

GabrielKS commented 4 months ago

good first issue because if all we need is a name formatter I think it could be implemented pretty similarly to the existing ones

rodrigomha commented 2 months ago

@GabrielKS What do you need to do here? The main problem is that powerworld does not create a zone dictionary. The load zones are created manually based on the information in the bus dictionary in bus["zone"] key. Would be tricky to pass a function is that we don't have access at the moment of creation of any additional data x that we can do something.

GabrielKS commented 2 months ago

@rodrigomha my use case is here — I am creating a System from a PSS/E .raw file and adjusting a bunch of names based on a JSON that gets written alongside the .raw by the new Sienna PSS/E exporter. All I need is the ability to pass in a mapping from what Sienna thinks the name should be to what I actually want the name to be and have that be evaluated.