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

User Provided JuMP Models #401

Merged
merged 2 commits into from
Oct 19, 2018
Merged

User Provided JuMP Models #401

merged 2 commits into from
Oct 19, 2018

Conversation

ccoffrin
Copy link
Member

@ccoffrin ccoffrin commented Oct 19, 2018

CC @jd-lara

Closes #400

@codecov
Copy link

codecov bot commented Oct 19, 2018

Codecov Report

Merging #401 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #401      +/-   ##
==========================================
+ Coverage   96.83%   96.84%   +<.01%     
==========================================
  Files          51       52       +1     
  Lines        6956     6974      +18     
==========================================
+ Hits         6736     6754      +18     
  Misses        220      220
Impacted Files Coverage Δ
src/core/base.jl 99.47% <ø> (ø) ⬆️
test/runtests.jl 100% <100%> (ø) ⬆️
test/model.jl 100% <100%> (ø)

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 6473fef...5e1b451. Read the comment docs.

@ccoffrin ccoffrin merged commit 3605c5f into master Oct 19, 2018
@ccoffrin ccoffrin deleted the ext-jump-model branch October 19, 2018 04:29
@frederikgeth
Copy link
Collaborator

cool feature!

@ccoffrin
Copy link
Member Author

@rb004f, I think this feature addresses the gas-grid coupling you wanted to do.

@rb004f
Copy link
Collaborator

rb004f commented Oct 22, 2018

Yes, this is step towards what we need to do to support multiple infrastructures cleanly. At the moment, this specific aspect is addressed in GasGridModels.jl with this function, this will be cleaner.

function build_generic_model(pdata::Dict{String,Any}, gdata::Dict{String,Any}, power_model_constructor, gas_model_constructor, post_method; kwargs...)
gm = gas_model_constructor(gdata; kwargs...)
pm = power_model_constructor(pdata)

add_junction_generators(pm, gm)

# a bit of a hack for now
gas_grid_per_unit(gm.data, pm.data)

# unify all the optimization models... a little bit of a hack...
pm.model = gm.model
    
post_method(pm, gm; kwargs...) 
return pm, gm

end

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