--
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.
Gabe
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-developers+unsubscribe@googlegroups.com.
I feel pretty strongly that switching Python versions should not cause a user’s model to perform differently. So, regardless of the Python version we should output the same model (in the same order) to the solver. That would imply an “option 3: continue to do what we have done in the past to ensure determinism across platforms”
john
--
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.
Yes. I am advocating that we should be more conservative than Python when it comes to determinism. This is both for our own sanity (a single set of tests) and because as has been pointed out to me on numerous occasions, Pyomo is a math programming environment and our core users are OR/optimization folks and not CS/Python programmers. That said, I would be happy with eventually moving to insertion order as the default for all discrete sets. I argue for staying with sorted order for the time being because (a) that is what the writers are already doing, (b) it breaks less code (we are not yet as deterministic as we would like to be in the rest of the code – like in transformations), and (c) you advocated using OrderedDict, which is painfully slow in Python 2.7 [and despite the push for 3.x, 2.7 is still the fastest python environment].
In the set-rewrite branch, I have started prototyping a slightly different (and more robust/consistent) approach to sets, and am (re)learning some things along the way. The first is that “sorted” only makes sense in the context of discrete sets (a distinction that is confounded with “concrete/virtual” on master). This is causing me to rethink some of our approaches to storage and iteration in IndexedComponents – especially for IndexedComponents indexed by non-discrete or semi-nondiscrete sets (think “RangeSet * Any”). The other is that we should rely on a common sorting interface (and NOT directly use Python’s `sorted` function). We frequently confound “sorted” with “ordered”. Some things – like the determinism flags – draw this distinction (usually as “deterministic” vs “sorted”). I think this should be more prominently called out in the API.
Finally, there is nothing that prevents Pyomo from sorting noncomparable values. Pyomo already has a `sorted_robust` method that will deterministically sort lists of mixed-type objects. In set-rewrite, this utility is used for the `sorted()` method on discrete sets (and can be extended in that context to deterministically order types that support no comparison operators at all by sorting by insertion order). That said, the preceding paragraph implies that `sorted_robust` (which I have never liked the name of) should be renamed something closer to `robust_ordered()` (and the `sorted()` method on new Sets should be `ordered(sorted=bool)`.
john
From: pyomo-de...@googlegroups.com [mailto:pyomo-de...@googlegroups.com]
On Behalf Of Bill Hart
Sent: Friday, July 06, 2018 9:22 PM
To: Pyomo Developers <pyomo-de...@googlegroups.com>
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.