-
Notifications
You must be signed in to change notification settings - Fork 526
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
Update IDAES branch from pyomo/master #154
Conversation
When walking large trees, this will return as soon as the outcome is determined - and can avoid walking the entire tree.
Interpreters that do not support getrefcount now automatically default to pyomo4 expressions.
- cleaning up _GetItemExpression._potentially_variable - check _potentially_variable when extracting linear components from expressions.
Completely rearchitecting the Pyomo4 expressions to rely on getrefcount() if it is available. If it is not, it removes the implicit "in-place" operations for improved safety.
Completely redesigning the refrence count detection to centralize all refrence count checks upon initial entry to the expression generation code. This also centralizes some initial type checking, conversion, and management into the clone_if_needed functions. Much of this is also mirrored in the _parent_expr verification logic (for pypy).
Re-adding clone-detection tests from coopr3 expressions (now that reference count-based cloning is supported).
These are failing because of an issue with pyomo.extras.
…parser attempted to cast the string 'None' to a float
The current pyomo script implicit model identification logic will error if there are multiple (python) variables that point to models. This will catch and ignore situations where the variables all point to the same model; for example: m = model = ConcreteModel() or model = ConcreteModel() inst = model.create_instance()
…ion is mapped to the 'executable' keyword for SolverFactory
Add exponential function support to symbolic module and add documentation
(Sympy converts integers to floating point.)
Codecov Report
@@ Coverage Diff @@
## IDAES #154 +/- ##
=========================================
+ Coverage 60% 60.22% +0.21%
=========================================
Files 421 423 +2
Lines 54723 54854 +131
=========================================
+ Hits 32838 33034 +196
+ Misses 21885 21820 -65
Continue to review full report at Codecov.
|
I'm okay with this. I think we will have a minor issue with ExternalFunctions related to the AMPLFUNC environment variable, but we need to work that out anyway, and it won't break any tests. Otherwise I think this works fine for my stuff. |
My only concern is the same one John has. Otherwise, I would like to update to the new master for the fix to solving indexed blocks. |
I am looking at #153 right now. @andrewlee94: are you referring to #73? I will take a look at that next. |
I am fine with this if John and Andrew are. I think @ksbeattie was going to be "gatekeeper", at least initially. |
(Re)Generate the _op_template map for each call to the NL writer. This allows the expression system to be switched after the writer is first loaded.
Shallow copying os.environ does not create an independent dictionary.
Detect spaces and quote the string when generating the AMPLFUNC environment variable.
I believe I did agree to be the "gatekeeper" for these PRs. As in, I was supposed to be the one making the request. I appear to have fallen down in that regard for this request. As such, I'm ok with merging this PR as clearly everyone is ok with it. I'll make a point of driving these requests in the future from the IDAES team. |
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.
Seems to work fine for me.
I am recreating @qtothec's PR (#152) now that #151 has been merged with master.
As @qtothec pointed out: IDAES/models will begin to fail tests if the fix to symbolic.py isn't merged in, because of a switch to using the Pyomo differentiate() function rather than going through CasADi.
Attn:
@eslickj
@andrewlee94
@tony121psu
@dangunter