Skip to content

Commit

Permalink
Merge pull request #1036 from NREL-Sienna/jd/pfdata_bus_naming_conven…
Browse files Browse the repository at this point in the history
…tion

change the bus name convention
  • Loading branch information
jd-lara authored Jan 10, 2024
2 parents 4e2ff11 + 718bf10 commit 9d6e1bf
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])"
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])"
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

2 comments on commit 9d6e1bf

@jd-lara
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/98580

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v3.2.1 -m "<description of version>" 9d6e1bf92ba3a21d5a4e9bdc740d8b1e8e7a920c
git push origin v3.2.1

Please sign in to comment.