Rework ConfigDict numpydoc generation support#3667
Merged
blnicho merged 33 commits intoPyomo:mainfrom Aug 1, 2025
Merged
Conversation
mrmundt
requested changes
Jul 28, 2025
Contributor
mrmundt
left a comment
There was a problem hiding this comment.
I overall love this - just found some wee typos / one nitpick.
|
|
||
| Configuring class hierarchies | ||
| ============================= | ||
|
|
Contributor
There was a problem hiding this comment.
There is a bit of back-and-forth across these docks - do you want it to be capitalized or not? (Config or config)
mrmundt
approved these changes
Jul 29, 2025
blnicho
approved these changes
Aug 1, 2025
Member
blnicho
left a comment
There was a problem hiding this comment.
This is really neat! I have a couple minor questions but otherwise I think this looks good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes # .
Summary/Motivation:
This PR is a significant overhaul of the utilities for converting ConfigDict objects unto numpydoc documentation strings. This was motivated by #3641, where it was pointed out that it is difficult / impossible to cleanly document CONFIG class attributes and nested ConfigDict objects.
This PR demonstrates the new use / formatting using the NLWriter and the
contrib.solverIpopt interface. Promulagating it to the rest of the solvers / transformations is left for a future PR.Changes proposed in this PR:
@document_configdictfor documenting classes derived from ConfigDict@document_class_CONFIGfor documenting CONFIG class attributes (and optionally, methods that use CONFIG for keyword argument resolution@document_configdictor@document_class_CONFIG)ExecutableandLibraryfactories to be true singletons; support their use as domains in ConfigValuerepn.plugins.nl_writerandcontrib.solver.solvers.ipoptto the new system (as demonstrators / test cases).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: