Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a refactor on how the
ref
data structure is built, with the goals of improved model build times and allowing problem formulations to extend the precomputed values before the post method is called.Notable changes,
ref
, which does the fully automatic and generic transformation steps ofdata
intoref
. Seebuild_generic_ref
core_ref!(pm)
can be used to populateref
with the basic info that nearly all models will need. It is called after the GenericPowerModel construct and before the modelpost
method inrun_generic_model
.run
methods can optionally add functions to the list defined byref_extensions
, which will be executed aftercore_ref!(pm)
and beforepost
.The problem formulations OTS, TNEP, and OPB provide example for how this feature can be used. For example see,
ne_branch_ref!
.On a slightly tangential point, also updated how the
dcline
variables are setup to remove the need forarcs_dc_param
and further simplifycore_ref!
.Comments, questions and suggestions are welcome. This will be merged shortly after the MOI transition is made.
CC @frederikgeth, @hakanergun @rb004f, @pseudocubic, @sanderclaeys, @kaarthiksundar