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

Extend sorted_robust API #1

Merged

Conversation

jsiirola
Copy link

@jsiirola jsiirola commented Mar 9, 2021

Summary/Motivation:

The idea of your PR is generlly good, however, the sort in _component_data_iter really needs to use the itemgetter(0) so that sorting doesn't accidentally compare component data objects (the second item in the tuple).

This PR updates the sorted_robust() API so that it supports the key= and reverse= arguments and puts the `itemgetter)0) back in. ...plus this adds a test of the problematic behavior from Pyomo#1845

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:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@PierreAttard PierreAttard merged commit 45632e6 into PierreAttard:sorted-robust-write Mar 9, 2021
@jsiirola jsiirola deleted the sorted-robust-write branch March 10, 2021 17:30
PierreAttard pushed a commit that referenced this pull request Aug 9, 2021
Further minor polishing fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants