-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve facade pattern implementation (#18)
- Loading branch information
Showing
4 changed files
with
14 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
function _get_powermodel_from_powerwatermodel(pwm::AbstractPowerWaterModel) | ||
# Determine the PowerModelsDistribution modeling type. | ||
pmd_type = typeof(pwm).parameters[1] | ||
|
||
function _get_powermodel_from_powerwatermodel(pwm::AbstractPowerWaterModel{PMDT,WMT}) where {PMDT,WMT} | ||
# Power-only variables and constraints. | ||
return pmd_type(pwm.model, pwm.data, pwm.setting, pwm.solution, | ||
return PMDT(pwm.model, pwm.data, pwm.setting, pwm.solution, | ||
pwm.ref, pwm.var, pwm.con, pwm.sol, pwm.sol_proc, pwm.ext) | ||
end | ||
|
||
|
||
function _get_watermodel_from_powerwatermodel(pwm::AbstractPowerWaterModel) | ||
# Determine the WaterModels modeling type. | ||
wm_type = typeof(pwm).parameters[2] | ||
|
||
function _get_watermodel_from_powerwatermodel(pwm::AbstractPowerWaterModel{PMDT,WMT}) where {PMDT,WMT} | ||
# Water-only variables and constraints. | ||
return wm_type(pwm.model, pwm.data, pwm.setting, pwm.solution, | ||
return WMT(pwm.model, pwm.data, pwm.setting, pwm.solution, | ||
pwm.ref, pwm.var, pwm.con, pwm.sol, pwm.sol_proc, pwm.ext) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83e3900
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.
v0.3.1 @JuliaRegistrator register()
83e3900
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.
Registration pull request created: JuliaRegistries/General/74384
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: