Extend valid types for PyROS solver argument uncertain_params#3439
Extend valid types for PyROS solver argument uncertain_params#3439blnicho merged 46 commits intoPyomo:mainfrom
uncertain_params#3439Conversation
…o into pyros-vars-as-params
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3439 +/- ##
==========================================
+ Coverage 88.19% 88.47% +0.28%
==========================================
Files 880 880
Lines 100594 100639 +45
==========================================
+ Hits 88715 89044 +329
+ Misses 11879 11595 -284
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…o into pyros-vars-as-params
jsiirola
left a comment
There was a problem hiding this comment.
One question that should probably be addressed before merging. The other two are enhancements, but not strictly necessary.
| if isinstance(obj, VarData): | ||
| obj.fix() | ||
| uncertain_param_var_idxs.append(idx) |
There was a problem hiding this comment.
Do you need to make sure that the Var has a value here? We allow Vars with lower == upper to be uncertain Params even if they don't have a current (numeric) value, correct?
There was a problem hiding this comment.
I do not believe we need to ensure the Var has a value here, as:
- The nominal value of the uncertain parameter represented by the
Varwas already obtained (accounting for the state of theVar) inutil.validate_uncertainty_specification(see line 977 @ 7dec651) - Immediately after this loop:
- The previously obtained nominal value is used to initialize the newly constructed
Paramthat is to be substituted for theVar - The
Paramis substituted for theVar, and (apart from cloning theVarwhen the working model is cloned) theVaris not subsequently used to set up subproblem components
- The previously obtained nominal value is used to initialize the newly constructed
…o into pyros-vars-as-params
Summary/Motivation:
Motivated by recent user feedback, this PR adds support for the speciifcation of
VarandVarDataobjects as (entries of) the argumentuncertain_paramstocontrib.pyros.PyROS.solve(). Thus, the argumentuncertain_paramscan now be aParam,ParamData,Var, orVarDatainstance, or an iterable sequence of such instances. AllVarDataobjects derived fromuncertain_paramsshould be fixed by the user in advance of invoking PyROS.Note that if
uncertain_paramsis of typeVar/VarData, or otherwise hasVarorVarDataentries, then there may be an appreciable computational overhead during the PyROS solver preprocessing step for models with large numbers ofConstraint,Expression, and/orObjectivecomponents in which theVar/VarDataobjects appear.Changes proposed in this PR:
VarandVarDataobjects inuncertain_paramsargumentTODO (after #3434 merged)
Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: