-
Notifications
You must be signed in to change notification settings - Fork 67
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
wip: loss factor variable #1238
base: main
Are you sure you want to change the base?
Conversation
Performance Results
|
Co-authored-by: Gabriel Konar-Steenberg <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Konar-Steenberg <[email protected]>
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.
Looks pretty good, left a few comments. If this has a dependency on NREL-Sienna/PowerFlows.jl#98 or other PRs, can you note that in the PR description? Also can you add a description of what this PR does there for future reference?
test/test_simulation_results.jl
Outdated
# here we check if the loss factors are stored in the results, the values are tested in PowerFlows.jl | ||
@test loss_factors !== nothing | ||
|
||
loss_factors = first( |
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.
why are you getting the loss_factors
two different ways?
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.
Just to make sure it works. Should I remove one of them?
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.
Yeah, I would say that the correspondence between read_aux_variable
and read_results_with_keys
is/ought to be tested elsewhere, so you should only need one of them
test/test_simulation_results.jl
Outdated
|
||
# here we check if the loss factors are stored in the results, the values are tested in PowerFlows.jl | ||
@test loss_factors !== nothing | ||
@test nrow(loss_factors) == 576 |
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.
Where does 576
come from? Can we do ... == length(get_components(...
or something instead to avoid hard-coding this?
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.
It is 48 * 12 (see also line 1067). Do you have an idea where it is best to read it from?
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.
It is coming from the file used ("export_48_12") so expressing it as 48 * 12 should be ok
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.
48 * 12
works for me
…s.jl into rb/loss_factors_variable
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Looks good aside from this one comment and the redundant test
test/test_simulation_results.jl
Outdated
# here we check if the loss factors are stored in the results, the values are tested in PowerFlows.jl | ||
@test loss_factors !== nothing | ||
|
||
loss_factors = first( |
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.
Yeah, I would say that the correspondence between read_aux_variable
and read_results_with_keys
is/ought to be tested elsewhere, so you should only need one of them
test/test_simulation_results.jl
Outdated
|
||
# here we check if the loss factors are stored in the results, the values are tested in PowerFlows.jl | ||
@test loss_factors !== nothing | ||
@test nrow(loss_factors) == 576 |
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.
48 * 12
works for me
Co-authored-by: Gabriel Konar-Steenberg <[email protected]>
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.
Looks good from a code quality standpoint. Ideally we'd release https://github.com/NREL-Sienna/PowerFlows.jl/pull/98/files and make sure the tests pass on the CI for this before merging it, but I'll let @jd-lara manage
Here we add the reading of the loss factors after a successful AC power flow calculation in
PowerFlows
as a new auxiliary variablePowerFlowLossFactors
.PowerFlowLossFactors
PowerFlowData
(only ifcalc_loss_factors
was set to true in ACPowerFlow)calc_loss_factors
istrue
and that it is not present when it isfalse
. The values of loss factors are tested only inPowerFlows
This PR depends on NREL-Sienna/PowerFlows.jl#98