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

Bugfix: component indexes specified as lists #2765

Merged
merged 3 commits into from
Mar 9, 2023

Conversation

jsiirola
Copy link
Member

@jsiirola jsiirola commented Mar 9, 2023

Fixes #2764

Summary/Motivation:

There was an error resolving unhashable indexes that were convertible to tuples (e.g. passing the index as a list). This PR resolves that bug.

Changes proposed in this PR:

  • correct processing of unhashable indexes that are easily convertable to tuples
  • add a test for indexing components with lists

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.

@jsiirola jsiirola mentioned this pull request Mar 9, 2023
@codecov
Copy link

codecov bot commented Mar 9, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change

Comparison is base (a47fa92) 86.96% compared to head (bdbc14e) 86.96%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2765   +/-   ##
=======================================
  Coverage   86.96%   86.96%           
=======================================
  Files         752      752           
  Lines       86600    86599    -1     
=======================================
+ Hits        75313    75314    +1     
+ Misses      11287    11285    -2     
Flag Coverage Δ
linux 83.95% <100.00%> (+<0.01%) ⬆️
osx 73.37% <100.00%> (-0.01%) ⬇️
other 84.13% <100.00%> (-0.01%) ⬇️
win 81.45% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pyomo/core/base/indexed_component.py 90.24% <100.00%> (-0.03%) ⬇️
pyomo/solvers/plugins/solvers/ASL.py 91.42% <0.00%> (-1.43%) ⬇️
pyomo/contrib/mindtpy/algorithm_base_class.py 81.13% <0.00%> (+0.33%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@blnicho blnicho merged commit 87295e4 into Pyomo:main Mar 9, 2023
@jsiirola jsiirola deleted the index-with-lists branch March 18, 2023 01:10
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.

Indexing error
2 participants