-
Notifications
You must be signed in to change notification settings - Fork 548
Rework ConfigDict
numpydoc generation support
#3667
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I overall love this - just found some wee typos / one nitpick.
int | ||
|
||
In addition to common types (like ``int``, ``float``, ``bool``, and | ||
``str``), the config system profides a number of custom domain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rogue typo! Reported upstream.
``str``), the config system profides a number of custom domain | |
``str``), the config system provides a number of custom domain |
|
||
Configuring class hierarchies | ||
============================= | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bit of back-and-forth across these docks - do you want it to be capitalized or not? (Config
or config
)
:py:meth:`generate_yaml_template()`, and | ||
:py:meth:`generate_documentation()`. The simplest is | ||
:py:meth:`display()`, which prints out the current values of the | ||
configuration object (and if it is a container type, all of it's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configuration object (and if it is a container type, all of it's | |
configuration object (and if it is a container type, all of its |
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.solver
Ipopt interface. Promulagating it to the rest of the solvers / transformations is left for a future PR.Changes proposed in this PR:
@document_configdict
for documenting classes derived from ConfigDict@document_class_CONFIG
for documenting CONFIG class attributes (and optionally, methods that use CONFIG for keyword argument resolution@document_configdict
or@document_class_CONFIG
)Executable
andLibrary
factories to be true singletons; support their use as domains in ConfigValuerepn.plugins.nl_writer
andcontrib.solver.solvers.ipopt
to 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: