-
-
Notifications
You must be signed in to change notification settings - Fork 48
Allow also non-functions/classes to be included in module API summary. #24
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
Conversation
@mhvk - can you rebase? I now added the -v flag by default to pytest on Travis and AppVeyor to see full diffs by default. In addition it would be good to add a unit test for this. Finally, please add a changelog entry :) |
@astrofrog - That was useful -- now I saw the actual tests and understood how to test locally, I could make things to pass again. Will now see if I can add a useful new test. |
@astrofrog - I think this is now ready, including a release note and tests. One suggestion from the previous discussion that I did not implement was to make any selection. So right now, if My own feeling is that, since it is opt-in to generate the list for global variables as well, it is OK to expect people that want to use it to spend the time to define |
sphinx_automodapi/automodsumm.py
Outdated
|
||
* ``:global-variables-only:`` | ||
If present, the autosummary table will only contain entries for | ||
functions. This cannot be used at the same time with |
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.
This currently doesn't make sense - do you mean variables instead of functions?
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.
Ah, good old copy & paste. Corrected.
sphinx_automodapi/automodsumm.py
Outdated
``:classes-only:`` . | ||
``:classes-only:`` or ``:global-variables-only:``. | ||
|
||
* ``:global-variables-only:`` |
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.
@mhvk - just out of curiosity, why 'global-variables-only' rather than simply 'variables-only'? Using 'global' is confusing since it's not actually going to include everything in globals()
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.
Hmm, I just followed the suggestion in the previous PR without thinking too much. I think you're right -- might as well call it variables only
. I'll wait a bit in case you have other comments; then will make that change globally and squash the commits together.
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.
@mhvk - no other comments for me, looks good otherwise :)
This is controlled by a new :include-all-objects: directive, which in turn uses a new :variables-only: directive for the summaries.
Thanks! |
Allow also non-functions/classes to be included in module API summary.
Allow also non-functions/classes to be included in module API summary.
This is a rebase with renamed arguments of astropy/astropy-helpers#198, since the automodapi routines now seem to live here.