-
Notifications
You must be signed in to change notification settings - Fork 21
refactor ybus code #177
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
refactor ybus code #177
Conversation
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.
I am not convinced that using a macro for the three winding transformer here is necessary. It is way over engineered for a relatively simple function. Please provide more detail as to why this makes sense.
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.
My biggest concern with this code is that I can't tell if those macros will be compiled at pre-compiled or need to wait for a runtime execution.
I'll remove the macros, and put the 3WT code back to how it was. |
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.
We can update this with the name changes in PowerSystems: NREL-Sienna/PowerSystems.jl#1511
return | ||
end | ||
|
||
_get_shunt(br::PSY.ACTransmission, node::Symbol) = |
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.
There is some mild type piracy here but it isn't outrageous
Replace some of the copy-pastes in computing the ybus entries with multiple dispatch. Some of this infrastructure (
_get_angle
,_get_tap
,TransformerWindingDispatch
) could be moved into PSY if desired.(In order to recover the flows after a degree 2 reduction, I need to go from the component to the the 4
y_{ff/tf/ft/tt}
numbers. Since I was refactoring things anyway, I decided to take the time to figure out how to de-duplicate things.)