Skip to content

Commit

Permalink
change the bus name convention
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Jan 9, 2024
1 parent 073ae04 commit 718bf10
Showing 1 changed file with 2 additions and 4 deletions.
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 @@ function read_bus!(
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 @@ function read_bus!(

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

0 comments on commit 718bf10

Please sign in to comment.