Skip to content

Commit

Permalink
Merge pull request #30 from invenia/rs/restore
Browse files Browse the repository at this point in the history
Restore `branches_by_breakpoints` changes
  • Loading branch information
Raphael Saavedra authored Aug 25, 2022
2 parents a845c8d + a70ea7a commit c063c92
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FullNetworkSystems"
uuid = "877b7152-b508-43dc-81fb-72341a693988"
authors = ["Invenia Technical Computing Corporation"]
version = "1.5.1"
version = "1.6.0"

[deps]
AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5"
Expand Down
8 changes: 4 additions & 4 deletions src/accessors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ function gens_per_zone(system::System)
end

"""
branches_by_breakpoints(system::System)
branches_by_breakpoints(system::System) -> NTuple{3, Vector{$BranchName}}
Returns three vectors containing of the names of branches which have 0, 1, and 2 breakpoints.
"""
function branches_by_breakpoints(system::System)
zero_bp, one_bp, two_bp = String[], String[], String[]
zero_bp, one_bp, two_bp = BranchName[], BranchName[], BranchName[]
for branch in system.branches
if branch.is_monitored
if all(branch.break_points .== 0.0)
if all(iszero, branch.break_points)
push!(zero_bp, branch.name)
elseif last(branch.break_points) == 0.0
elseif iszero(last(branch.break_points))
push!(one_bp, branch.name)
else
push!(two_bp, branch.name)
Expand Down
1 change: 1 addition & 0 deletions test/system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
@test zero_bp == ["3"]
@test one_bp == ["2"]
@test two_bp == ["1", "4"]
@test eltype(zero_bp) == eltype(one_bp) == eltype(two_bp) == FullNetworkSystems.BranchName
da_system.branches = branches # reset

# Check that we can remove the PTDF
Expand Down

2 comments on commit c063c92

@raphaelsaavedra
Copy link
Member

Choose a reason for hiding this comment

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

@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/67030

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 v1.6.0 -m "<description of version>" c063c920637bea6b2e6f5830d88a9ecdacf29a51
git push origin v1.6.0

Please sign in to comment.