--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
I'm inclined to allow += for E. Named expressions are different from other components, and we currently allow users to use named expressions in equations. If:3 + model.Eis valid, then why notmodel.E += 3?
On Tuesday, December 5, 2017 at 8:09:03 AM UTC-7, Laird, Carl Damon wrote:
This is a little strange since Expression (Cap E) is a Component. I don’t think we support += for any other component (at least not in a way that means the same as this). We only support this type of operation on (little e) expressions.
Maybe we should not allow this and only support model.e.expr += ?
Thoughts?
To be pedantic, you are asking if:
m.e = Expression(expr=3)m.e += m.x
Should give m.e as an Expression (capital E) containing the expression (little e) 3 + m.x, whereas it currently results in an Expression containing the expression 3 + m.e?
The current behavior is probably not what the user wanted ... a self-referential Expression is not good (walkers will recourse infinitely). To fix it, I suppose we would need to map all __i<OP>__ methods to convert things like “m.e += foo” to “m.e.expr += foo”?
John
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
Bill,
I don’t think that anyone is suggesting that _ExpressionData does not expose the normal __add__ and __radd__ methods (and mul, sub, and div) from NumericValue. So “m.E +3” would still work.
The question is what to do about the __iadd__ (and imul, isub, idiv) methods. I see two options:
# class _ExpressionData(NumericValue):
def __iadd__(self, val):
self.expr += val
return self
I think I prefer option 2…
[Side note: this is solely to do with Expression components and has nothing to do with the expression tree system]
john
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
Bill,
I am confused by “several ways to implement this”. Why would you do anything other than implementing the __i<OP>__ methods on _ExpressionData? This shouldn’t touch the expression system at all. IMHO, this is a bug with Expression and should be implemented as a separate PR against master that we can put together and approve pretty quickly.
john
From: pyomo-de...@googlegroups.com [mailto:pyomo-de...@googlegroups.com]
On Behalf Of Bill Hart
Sent: Tuesday, December 05, 2017 11:46 AM
To: Pyomo Developers <pyomo-de...@googlegroups.com>
Subject: Re: [EXTERNAL] Re: Operators on SimpleExpression?
John:
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.
Bill,
I am confused by “several ways to implement this”. Why would you do anything other than implementing the __i<OP>__ methods on _ExpressionData? This shouldn’t touch the expression system at all. IMHO, this is a bug with Expression and should be implemented as a separate PR against master that we can put together and approve pretty quickly.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyomo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-develope...@googlegroups.com.