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

Fix list() and tabulate() for existing optimization items with specific run-request #107

Merged
merged 6 commits into from
Aug 9, 2024

Conversation

glatterf42
Copy link
Member

@glatterf42 glatterf42 commented Aug 2, 2024

Also while working on the GAMS transport tutorial, I discovered that all optimization items had inconsistent behavior in the facade layer: run.optimization.scalar.tabulate() would list all scalars of all runs, while ...list() would list only those of the run the scalars belong to. The latter is clearly desired, so this PR fixes the inconsistency and adds tests to confirm.

Since Parameter, Equation, and Variable have not yet landed on main, I'll include corresponding changes in their pending PRs.

@glatterf42 glatterf42 added the bug Something isn't working label Aug 2, 2024
@glatterf42 glatterf42 self-assigned this Aug 2, 2024
@glatterf42 glatterf42 changed the title Fix list() and tabulate() for optimization items with specific run-request Fix list() and tabulate() for existing optimization items with specific run-request Aug 5, 2024
@glatterf42 glatterf42 marked this pull request as ready for review August 5, 2024 07:57
@glatterf42 glatterf42 force-pushed the fix/list-tabulate-optimization-run branch from 7a93073 to 35ec82d Compare August 5, 2024 08:03
Copy link
Member

@danielhuppmann danielhuppmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @glatterf42, good catch! I made a few comments on streamlining the tests for the indexsets, does also apply to the other types...

tests/core/test_indexset.py Outdated Show resolved Hide resolved
tests/core/test_indexset.py Outdated Show resolved Hide resolved
tests/core/test_indexset.py Outdated Show resolved Hide resolved
tests/utils.py Outdated Show resolved Hide resolved
tests/core/test_indexset.py Outdated Show resolved Hide resolved
Copy link
Member

@danielhuppmann danielhuppmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor suggestions, then good to go as far as can tell!

tests/utils.py Outdated Show resolved Hide resolved
@glatterf42 glatterf42 merged commit f57d533 into main Aug 9, 2024
10 checks passed
@glatterf42 glatterf42 deleted the fix/list-tabulate-optimization-run branch August 9, 2024 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants