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

change the bus name convention #1036

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/parsers/powerflowdata_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,10 @@
bus_number_to_bus = Dict{Int, ACBus}()
bus_types = instances(ACBusTypes)

_get_name = get(kwargs, :bus_name_formatter, strip)
for ix in eachindex(buses.i)
# d id the data dict for each bus
# d_key is bus key
bus_name = buses.name[ix] * "_$(buses.i[ix])"
bus_name = strip(buses.name[ix]) * "_$(buses.i[ix])" * "_$(buses.ide[ix])"

Check warning on line 120 in src/parsers/powerflowdata_data.jl

View check run for this annotation

Codecov / codecov/patch

src/parsers/powerflowdata_data.jl#L120

Added line #L120 was not covered by tests
has_component(ACBus, sys, bus_name) && throw(
DataFormatError(
"Found duplicate bus names of $bus_name, consider formatting names with `bus_name_formatter` kwarg",
Expand Down Expand Up @@ -210,11 +209,10 @@

bus_types = instances(ACBusTypes)

_get_name = get(kwargs, :bus_name_formatter, strip)
for ix in 1:length(buses)
# d id the data dict for each bus
# d_key is bus key
bus_name = _get_name(buses.name[ix])
bus_name = strip(buses.name[ix]) * "_$(buses.i[ix])" * "_$(buses.ide[ix])"

Check warning on line 215 in src/parsers/powerflowdata_data.jl

View check run for this annotation

Codecov / codecov/patch

src/parsers/powerflowdata_data.jl#L215

Added line #L215 was not covered by tests
has_component(ACBus, sys, bus_name) && throw(
DataFormatError(
"Found duplicate bus names of $bus_name, consider formatting names with `bus_name_formatter` kwarg",
Expand Down
Loading