Skip to content
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

Sorting mixed-type Sets fails in Python3 #325

Closed
jsiirola opened this issue Jan 30, 2018 · 2 comments
Closed

Sorting mixed-type Sets fails in Python3 #325

jsiirola opened this issue Jan 30, 2018 · 2 comments

Comments

@jsiirola
Copy link
Member

PR #305 pointed out an issue with Sets in Python 3: while Pyomo allows mixed-type Sets (i.e., mixing integers and strings in a single set), doing so will likely fail when running under Python 3 due to pervasive sorting to enforce determinism.

We should propagate the more robust sorter added in #305 to the main Set class as a sorted_values() method, and then replace most uses of sorted() with set.sorted_values() throughout the code.

@carldlaird
Copy link
Member

carldlaird commented Jan 30, 2018 via email

@jsiirola
Copy link
Member Author

Agreed. I would like to have a general design discussion as part of #326, and defaulting Sets to ordered is definitely part of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants