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

Documentation about available options and their structural hierarchy #14364

Open
furushchev opened this issue Mar 6, 2024 · 2 comments
Open

Comments

@furushchev
Copy link

Hi, I'm looking for a list of the available options and I still cannot find in the latest documentation.

There were the pages for them in docs in previous versions:
https://ipython.org/ipython-doc/dev/config/options/index.html

Is there any page that I'm missing or is there any way to get the equivalent information using IPython shell?

i.e. I found the following magic command tells the available options for the TerminalPythonApp class, but I want comprehensive list of available options other than the class as well.

%config TerminalIPythonApp
TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp) options
---------------------------------------------------------------------
TerminalIPythonApp.add_ipython_dir_to_sys_path=<Bool>
...

%config InteractiveShellApp
UsageError: Invalid config statement: 'InteractiveShellApp'
# No information available for the super classes

I found a part of the information is described in the latest docs:
https://ipython.readthedocs.io/en/stable/config/intro.html

But I still feel it difficult to customize options because:

  • There is no list of available options for each class
  • The structural hierarchy of classes is unclear (i.e. I have no idea where is the best place to put option values because the relationship of the similar classes:TerminalIPythonApp, InteractiveShellApp, InteractiveShell)

Thank you!

@krassowski
Copy link
Member

Indeed a page like this: https://jupyter-server.readthedocs.io/en/latest/other/full-config.html could be useful.

It gets created with a custom script in conf.py using traitlet's document_config_options() which used to be used in IPython too but is currently commented out:

def write_doc(name, title, app, preamble=None):
trait_aliases = reverse_aliases(app)
filename = options / (name + ".rst")
with open(filename, "w", encoding="utf-8") as f:
f.write(".. _" + name + "_options:" + "\n\n")
f.write(title + "\n")
f.write(("=" * len(title)) + "\n")
f.write("\n")
if preamble is not None:
f.write(preamble + '\n\n')
#f.write(app.document_config_options())
for c in app._classes_inc_parents():
f.write(class_config_rst_doc(c, trait_aliases))
f.write('\n')
if __name__ == '__main__':
# Touch this file for the make target
Path(generated).write_text("", encoding="utf-8")
write_doc('terminal', 'Terminal IPython options', TerminalIPythonApp())
write_doc('kernel', 'IPython kernel options', IPKernelApp(),
preamble=("These options can be used in :file:`ipython_kernel_config.py`. "
"The kernel also respects any options in `ipython_config.py`"),
)

Ouch commented out for last 7 years. I guess maybe worth sending a PR trying to uncomment it?

@furushchev
Copy link
Author

@krassowski Thank you for the insightful comment!

I've just made a PR to re-enable the pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants