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

UPD: Updates for new multi-infrastructure conventions #222

Merged
merged 26 commits into from
Mar 2, 2021

Conversation

tasseff
Copy link
Member

@tasseff tasseff commented Oct 26, 2020

This pull request coincides with the multi-infrastructure branch of InfrastructureModels.jl.

@tasseff tasseff requested a review from rb004f October 26, 2020 17:36
@tasseff tasseff requested a review from ccoffrin October 26, 2020 19:00
@tasseff tasseff marked this pull request as ready for review December 4, 2020 00:10
@tasseff
Copy link
Member Author

tasseff commented Dec 4, 2020

The automated tests will not pass until the new version of InfrastructureModels is released, but this is probably sufficient for a review.

@codecov
Copy link

codecov bot commented Jan 18, 2021

Codecov Report

Merging #222 (d97bfd8) into master (de11ed5) will increase coverage by 0.81%.
The diff coverage is 83.47%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
src/GasModels.jl 25.00% <ø> (ø)
src/core/export.jl 100.00% <ø> (ø)
src/core/unit_converters.jl 0.00% <ø> (ø)
src/form/dwp.jl 76.74% <ø> (+1.74%) ⬆️
src/form/lrdwp.jl 43.47% <ø> (+5.74%) ⬆️
src/io/diagnostics.jl 0.00% <0.00%> (ø)
src/prob/gf.jl 86.95% <ø> (ø)
src/prob/ls.jl 74.41% <ø> (ø)
src/prob/ne.jl 70.00% <ø> (ø)
src/prob/nels.jl 68.33% <ø> (ø)
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de11ed5...e38c121. Read the comment docs.

@tasseff
Copy link
Member Author

tasseff commented Feb 19, 2021

This will close most of #226, aside from the run_ to solve_ renaming, which @ccoffrin has recommended we delay. I think it's safe for me to pass this off to the most frequent contributors for review, editing, and merging.

Copy link
Member

@ccoffrin ccoffrin left a 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.

Comment on lines 25 to 26
couenne_solver = JuMP.with_optimizer(AmplNLWriter.Optimizer("couenne.exe"))
bonmin_solver = JuMP.with_optimizer(AmplNLWriter.Optimizer("bonmin.exe"))
Copy link
Member

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")

Copy link
Member Author

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")
Copy link
Member

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 ~.

Comment on lines +28 to 30
import JuMP: optimizer_with_attributes
export optimizer_with_attributes

Copy link
Member

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.

Comment on lines 22 to 24
_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)
Copy link
Member

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
Comment on lines 27 to 28
var(gm, InfrastructureModels.nw_id_default, :pipe)[32] === nothing
var(gm, InfrastructureModels.nw_id_default, :pipe)[34] === nothing
Copy link
Member

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.

Comment on lines +11 to +12
Logging.disable_logging(Logging.Info)
Logging.disable_logging(Logging.Warn)
Copy link
Member

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.

Copy link
Member Author

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.

tasseff added a commit that referenced this pull request Feb 24, 2021
@tasseff tasseff force-pushed the multi-infrastructure branch from 9d87ecc to e38c121 Compare February 24, 2021 19:13
Copy link
Collaborator

@kaarthiksundar kaarthiksundar left a 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.

@tasseff tasseff merged commit 5b5f62c into master Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants