-
Notifications
You must be signed in to change notification settings - Fork 16
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
UPD: Updates for new multi-infrastructure conventions #222
Conversation
The automated tests will not pass until the new version of InfrastructureModels is released, but this is probably sufficient for a review. |
…nfrastructureModels changes.
Codecov Report
@@ Coverage Diff @@
## master #222 +/- ##
==========================================
+ Coverage 77.61% 78.43% +0.81%
==========================================
Files 35 35
Lines 4571 4624 +53
==========================================
+ Hits 3548 3627 +79
+ Misses 1023 997 -26
Continue to review full report at Codecov.
|
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.
Overall works for me. Put in a few minor suggestions.
examples/run_examples.jl
Outdated
couenne_solver = JuMP.with_optimizer(AmplNLWriter.Optimizer("couenne.exe")) | ||
bonmin_solver = JuMP.with_optimizer(AmplNLWriter.Optimizer("bonmin.exe")) |
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.
Should avoid the use of with_optimizer
, I think new syntax in this case is couenne_solver = () -> AmplNLWriter.Optimizer("couenne.exe")
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.
Noted. It looks like these solvers weren't being used, so I also commented them out.
src/core/data.jl
Outdated
@assert data["is_per_unit"] == 1 | ||
comp["is_per_unit"] = data["is_per_unit"] | ||
|
||
if ~haskey(comp, "is_per_unit") && haskey(gm_data, "is_per_unit") |
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.
Not specifically related to this PR but !
is preferable to ~
.
import JuMP: optimizer_with_attributes | ||
export optimizer_with_attributes | ||
|
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.
FYI, here I also added nw_id_default
to exports. But I am still on the fence if that is the best choice.
src/core/transient_variable.jl
Outdated
_IM.sol_component_value(gm, nw, :junction, :density, ids(gm, nw, :junction), rho) | ||
_IM.sol_component_value(gm, gm_it_sym, nw, :junction, :density, ids(gm, nw, :junction), rho) | ||
report && | ||
_IM.sol_component_value(gm, nw, :junction, :pressure, ids(gm, nw, :junction), rho) | ||
_IM.sol_component_value(gm, gm_it_sym, nw, :junction, :pressure, ids(gm, nw, :junction), rho) |
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 is a stylistic point, but in PowerModels we implemented a package specific version of sol_component_value
that is specialized on AbstractPowerModel
, so that pm_it_sym
does not need to be used explicitly within the package.
https://github.com/lanl-ansi/PowerModels.jl/blob/rc-v0.18/src/core/solution.jl#L28
test/data.jl
Outdated
var(gm, InfrastructureModels.nw_id_default, :pipe)[32] === nothing | ||
var(gm, InfrastructureModels.nw_id_default, :pipe)[34] === nothing |
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.
Can be simplified if you choose to export nw_id_default
.
Logging.disable_logging(Logging.Info) | ||
Logging.disable_logging(Logging.Warn) |
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 curious, given that we use Memento for logging, wondering why this is here as well.
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.
Juniper appears to use Logging
instead of Memento
. This is mostly for disabling Juniper info and warning output.
9d87ecc
to
e38c121
Compare
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 great. Thanks Byron.
This pull request coincides with the
multi-infrastructure
branch of InfrastructureModels.jl.