QuantEcon / sphinxcontrib-jupyter

A Sphinx Extension for Generating Jupyter Notebooks
BSD 3-Clause "New" or "Revised" License
76 stars 23 forks source link

Configuration of jupyter_kernels #4

Open mmcky opened 6 years ago

mmcky commented 6 years ago

Currently Jupyter Kernels are configured using the following:

# Configure Jupyter Kernels
jupyter_kernels = {
    "python3": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python3",
            "name": "python3"
            },
        "file_extension": ".py",
    },
    "julia": {
        "kernelspec": {
            "display_name": "Julia 0.6.0",
            "language": "julia",
            "name": "julia-0.6"
            },
        "file_extension": ".jl"
    }
}

Should we build this from a list of simpler options? I think this is a good approach for now as it is a complete set of attributes when defining which kernel to use.


@NickSifniotis (02-August-2017):

Jupiter itself must have the metadata for all its installed kernels lying around somewhere. I'd suggest pulling directly from that data, if possible.


@mmcky (03-August-2017):

https://github.com/jupyter/jupyter/wiki/Jupyter-kernels also to get list of installed kernels on a local machine is jupyter kernelspec list

mmcky commented 6 years ago

As discussed with @NickSifniotis it might be better to implement this using jupyter kernelspec list to obtain available kernels. We would then be able to infer attributes from the respective kernels such as display_name without having to maintain our own settings.

The only downside is that users that wish to generate notebooks for a specific type will need to have the kernel installed. Is there a case for generating notebooks without the kernel installed for the language (most of the time notebooks will be generated and run on the same system).

mmcky commented 6 years ago

@NickSifniotis has this been done?

mmcky commented 5 years ago

@AakashGfude would you mind looking into jupyter kernelspec list to see if we could infer kernel information. I think it lists available kernels on a local machine.