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

Jd/index fixes #89

Merged
merged 4 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
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: 3 additions & 3 deletions src/ptdf_calculations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,11 @@ function PTDF(
bus_ax = [PSY.get_number(bus) for bus in buses]
axes = (bus_ax, line_ax)
M, bus_ax_ref = calculate_adjacency(branches, buses)
ref_bus_positions = find_slack_positions(buses)
subnetworks = find_subnetworks(M, bus_ax)
ref_bus_positions = find_slack_positions(buses, bus_ax_ref)
subnetworks =
assign_reference_buses!(find_subnetworks(M, bus_ax), ref_bus_positions, bus_ax_ref)
if length(subnetworks) > 1
@info "Network is not connected, using subnetworks"
subnetworks = assign_reference_buses!(subnetworks, ref_bus_positions, bus_ax_ref)
end
look_up = (bus_ax_ref, make_ax_ref(line_ax))
S, _ = _buildptdf(
Expand Down
2 changes: 1 addition & 1 deletion src/ybus_calculations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
buscount = length(nodes)
bus_ax = PSY.get_number.(nodes)
axes = (bus_ax, bus_ax)
bus_lookup = _make_ax_ref(bus_ax)
bus_lookup = make_ax_ref(bus_ax)

Check warning on line 230 in src/ybus_calculations.jl

View check run for this annotation

Codecov / codecov/patch

src/ybus_calculations.jl#L230

Added line #L230 was not covered by tests
look_up = (bus_lookup, bus_lookup)

a = SparseArrays.spzeros(Int, buscount, buscount)
Expand Down
Loading