Send omit_sections to IPython to choose which sections of documentation you don't want #809
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.
This PR brings to ipykernel a recent IPython PR ipython/ipython#13343 which allows us to customize IPython's responses to
infoandinspectmessages by specifying which documentation sections we don't want. For example,numpy.sinreturns the following sections:and with the new
omit_sectionskeyword argument, we can for example specify that we are not interested in theFile,String form, andTypesections, thereby saving runtime and bandwidth by not generating those documentation sections.In this present PR, we enable ipykernel's
inspectmessage to take advantage ofomit_sections. If the client providesomit_sectionsin its request, we'll pass it on to IPython.Nota bene if merged, this PR should be released with an ipykernel that depends on IPython 8.0, the milestone @Carreau has set in ipython/ipython#13343.
To test this using JupyterLab for example:
Original ipykernel:
This PR with customized JupyterLab to omit numerous sections:
Recommended triage:
enhancement?