-
Notifications
You must be signed in to change notification settings - Fork 22
PNM interface changes #222
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
Conversation
Looks good! |
# "test_iterative_methods.jl", | ||
# "test_klu_linear_solver_cache.jl", | ||
# "test_loss_factors.jl", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice thanks for updating
src/post_processing.jl
Outdated
# returns list of branches names and buses numbers: PTDF and virtual PTDF case | ||
function _get_branches_buses(data::Union{PTDFPowerFlowData, vPTDFPowerFlowData}) | ||
return PNM.get_branch_ax(data.power_network_matrix), | ||
PNM.get_bus_ax(data.power_network_matrix) | ||
return PNM.get_arc_axis(data.power_network_matrix), | ||
PNM.get_bus_axis(data.power_network_matrix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns a list of arc tuples, not the branches names so the function name and comment should be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. @jose I know you've said that branch_lookup
should have strings as keys, not tuples. I'll fix that in a separate PR: get things working first, then make design changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should already be available to work it out in what's on PSY5. Please add a proper fix to this in the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. PNM's data structures all have tuples as keys, though. How about 2 separate lookups, arc_lookup
(keys are tuples) and branch_lookup
(keys are strings)? Is that ok? I could make it work with a single lookup with keys as strings, but the side effects would be
- I can only use the arc/branch-related network reduction data in places where I have access to the
PSY.System
. I have the names of the branches: the network reduction data requiresPSY.Branch
objects or tuples. - I'd have to name the reduced arcs in such a way that I can retrieve the arc. E.g. as
from-to
. Otherwise, after figuring out the flows, I have no way of knowing "flow in what?" So I'd be dealing in terms of arcs for the reduced branches anyway, just indirectly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. PNM's data structures all have tuples as keys, though. How about 2 separate lookups,
arc_lookup
(keys are tuples) andbranch_lookup
(keys are strings)? Is that ok? I could make it work with a single lookup with keys as strings, but the side effects would be
- I can only use the arc/branch-related network reduction data in places where I have access to the
PSY.System
. I have the names of the branches: the network reduction data requiresPSY.Branch
objects or tuples.- I'd have to name the reduced arcs in such a way that I can retrieve the arc. E.g. as
from-to
. Otherwise, after figuring out the flows, I have no way of knowing "flow in what?" So I'd be dealing in terms of arcs for the reduced branches anyway, just indirectly.
you need to exploit the NetworkReductionData
object in PNM to do this. The map you are talking about is already there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The map you are talking about is already there.
I don't follow. Which map do you have in mind?
If branch_lookup
has type Dict{String, Int}
, that only gives me branch/arc name to index. All the branch
-related maps in NetworkReductionData
that I see have key type Tuple{Int, Int}
or PSY.Branch
.
I've updated the I temporarily commented out the arc power flow calculations. @m-bossart if you could do the following, then they'll work again:
I also adjusted the |
ce91721
to
6514043
Compare
I intended for this to be merged after the "Merge branch 'psy5' into lk/psy5-pnm-fixes" commit. That would've brought edit: oh, some changes here rely on PR #177 in PNM, which in turn relies on PR #1511 in PSY. So those will need to be merged, too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one minor comment before merge
Fix things for PNM interface changes. The exporter tests error--the newly added
winding_group_number
fields don't match--but I'll leave that for @rbolgaryn to fix. Otherwise, things are back to where they were a week ago: 20-30 test failures, all due to low-priority issues (reactive power distribution, issue #201).edit: I also moved the loss factor and distributed slack tests into their own files. If vanilla power flows aren't working, those tests bury those errors behind a wall of similar messages. I don't use
failfast
because it stops the whole testing process, not just the current test set.