Skip to content

NotebookClient does not create new KernelManager on default init #325

@cab938

Description

@cab938

The documentation and source for the NotebookClient indicates that the KernelManager parameter is optional and if one isn't passed in then a new one will be created. Here is the source link:

km : KernelManager (optional)

However, inspecting the init function it doesn't appear that this is true. Here is an MWE demonstrating that not passing in a KernelManager results in a client.kc==None situation:

from nbclient import NotebookClient
import nbformat

notebook = nbformat.reads(open('test.ipynb','r').read(), as_version=4)

# Create a NotebookClient without a KernelManager
client = NotebookClient(notebook, kernel_name="python3")
assert client.km != None

The result is:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions