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

Teuchos: Preferred way of printing docstrings #6702

Closed
Sbte opened this issue Jan 31, 2020 · 4 comments
Closed

Teuchos: Preferred way of printing docstrings #6702

Sbte opened this issue Jan 31, 2020 · 4 comments
Labels
CLOSED_DUE_TO_INACTIVITY Issue or PR has been closed by the GitHub Actions bot due to inactivity. MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. pkg: Teuchos Issues primarily dealing with the Teuchos Package type: question

Comments

@Sbte
Copy link
Contributor

Sbte commented Jan 31, 2020

Question

@trilinos/teuchos

What is the preferred way of printing docstrings from a parameter list?

For our application, we want to print all parameters that can be set, their default values, and their docstrings. This so we have the documentation of the parameters all in one place. I'm confused as to what would be the right way to obtain those.

I expected validateParameters or validateParametersAndSetDefaults or something alike to set the docstrings, but it seems like only setParameters sets it. If I look at for instance Belos::BlockGmresSolMgr, I see that it has a method getValidParameters that sets the docstrings. Would the "right" way be to implement getValidParameters for every class and recursively call getValidParameters + setParameters for any data members? And then when we want to print them, apparently I have to do this?

Teuchos::ParameterList::PrintOptions po;
po.showDoc(true);

Teuchos::RCP<const Teuchos::ParameterList> pars = c.getValidParameters();
pars.print(std::cout, po);

Also, why are these getValidParameters methods not static so you can get the parameters before you construct the class?

@mayrmt mayrmt added the pkg: Teuchos Issues primarily dealing with the Teuchos Package label Jan 31, 2020
@jhux2
Copy link
Member

jhux2 commented Jan 31, 2020

@trilinos/teuchos

@bartlettroscoe
Copy link
Member

@Sbte, yes you want to implement getValidParameter(). Look at an example of this in:

And you can expand out the list of "Valid Parameters" shown there.

I did not write all of the code that does that and I am not sure that documentation is being kept up-to-date (by cron jobs that did that likely died a long time ago) but you should be able to reverse engineer that.

@github-actions
Copy link

This issue has had no activity for 365 days and is marked for closure. It will be closed after an additional 30 days of inactivity.
If you would like to keep this issue open please add a comment and/or remove the MARKED_FOR_CLOSURE label.
If this issue should be kept open even with no activity beyond the time limits you can add the label DO_NOT_AUTOCLOSE.
If it is ok for this issue to be closed, feel free to go ahead and close it. Please do not add any comments or change any labels or otherwise touch this issue unless your intention is to reset the inactivity counter for an additional year.

@github-actions github-actions bot added the MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. label Nov 14, 2021
@github-actions
Copy link

This issue was closed due to inactivity for 395 days.

@github-actions github-actions bot added the CLOSED_DUE_TO_INACTIVITY Issue or PR has been closed by the GitHub Actions bot due to inactivity. label Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLOSED_DUE_TO_INACTIVITY Issue or PR has been closed by the GitHub Actions bot due to inactivity. MARKED_FOR_CLOSURE Issue or PR is marked for auto-closure by the GitHub Actions bot. pkg: Teuchos Issues primarily dealing with the Teuchos Package type: question
Projects
None yet
Development

No branches or pull requests

4 participants