Skip to content

Support initialization of indexed Set from scalar functions returning dicts#3664

Merged
blnicho merged 19 commits intoPyomo:mainfrom
jsiirola:set-init
Jul 18, 2025
Merged

Support initialization of indexed Set from scalar functions returning dicts#3664
blnicho merged 19 commits intoPyomo:mainfrom
jsiirola:set-init

Conversation

@jsiirola
Copy link
Copy Markdown
Member

Fixes # .

Summary/Motivation:

This is an extended version of #3363: merging this PR will automatically merge & close #3363. See the original PR for an excellent discussion / motivation.

This updated PR contains some minor changes to the original:

  • resolve errors when initializing abstract sets from external data
  • clarify some changes to the Set documentation
  • resolve conflicts with the current state of main

As part of going through this PR, it became apparent that a larger PR should be put together that standardizes how we resolve Initializers in this context (for example, a similar change should probably be added to handling dimen and domain). However, that change started to become more involved, so I am proposing that we fix the current issue here and defer a more general update to the initializers (including finally propagating the use of Initializer to the rest of the Components) to a subsequent PR.

Changes proposed in this PR:

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 requested review from blnicho and mrmundt July 17, 2025 13:53
Copy link
Copy Markdown
Contributor

@mrmundt mrmundt left a comment

Choose a reason for hiding this comment

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

A+ updates to the docs.

@blnicho blnicho merged commit e9cfccd into Pyomo:main Jul 18, 2025
86 of 91 checks passed
@jsiirola jsiirola deleted the set-init branch August 1, 2025 21:55
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.

4 participants