Open gibiansky opened 8 years ago
Thanks @gibiansky for the detailed request, really appreciate that. We'll try to improve that and make it easier !
cc @willingc
@gibiansky Huge thanks for documenting your path and helping others avoid future headaches. I've taken your comments and edited them into chunks for someone (possibly me) to work on to improve the docs. Do you mind if we ping you for review when the doc PR(s) are completed?
Thanks!
BlockingKernelClient
.BlockingKernelClient
class, only KernelClient
has docs now.
KernelClient
docsBlockingKernelClient
infoKernelManager
detailed doc
KernelManager
? __init__
constructor What are the **kwargs
?KernelManager()
, something happens, since I can then use kernel_manager.client().channels_running
and get True
, but I have no idea what kernel (if any?) this client is connected to... My next guess is to pass kernel_name="My_kernel_name"
. Tried it, not sure what it does, so giving up here. MultiKernelManager
docs, be
kernel_name
argumentstart_kernel
method! That seems to give me a valid kernel IDget_kernel
gives me a KernelManager
, get_connection_info
with and get valid ports! This is what I've wanted all along! :cake:run_kernel
detail.
*args
are, so I have no idea how to use it.kernel_info
kernel_info_request
kernel_info_reply
. kernel_info
... After googling for a bit I run across client.py
which has a kernel_info
method, and realize that that class is a KernelClient
, not a KernelManager
, and that I can get a client with KernelManager.client()
.client
and run client.kernel_info()
(which I will note is not documented on the client page and I only know about it b/c I read some source). I get back a UUID which I assume is the UUID of the sent message, and I confirm this in the source of client.py
, and now somehow I need to map this UUID to a response message.client.get_shell_msg()
p_metadata
piece, I think.multimanager = MultiKernelManager()
manager = multimanager.get_kernel(multimanager.start_kernel("kernel-name"))
client = manager.client()
client.kernel_info()
print(client.get_shell_msg())
@willingc Yes please feel free to loop me in on any PRs / issues related to things I file.
Please, please mention the following code bits!
client.start_channels()
client.wait_for_ready()
If I understand correctly, accessing client.iopub_channel
creates the channel if its not created yet. This means that you can arbitrarily lose messages at the beginning depending on random timing variation if you don't call those two functions beforehand... because if the kernel sends a message, it may or may not arrive before the iopub channel is created. Not sure that's quite right but it just cost me another two hours... :-/
IMHO things like get_iopub_msg
should just throw an exception if start_channels
hasn't been called, not silently set up the channel... the latter is just asking for trouble like what I've been observing
I'm trying to use
jupyter_client
as a library and am running into some places where I wish the documentation was clearer; I figured I'd file an issue with a small "developer experience report" so that perhaps someone can try and address some of the confusion I went through trying to use the package.BlockingKernelClient
.BlockingKernelClient
class, onlyKernelClient
. It seems like it might be helpful to include that as well (I figure it has roughly the same interface?)KernelManager
? What are the**kwargs
it takes in its__init__
constructor? It seems like if I just make aKernelManager()
, something happens, since I can then usekernel_manager.client().channels_running
and getTrue
, but I have no idea what kernel (if any?) this client is connected to... My next guess is to passkernel_name="My_kernel_name"
. Tried it, not sure what it does, so giving up here.MultiKernelManager
, because it takes akernel_name
argument and astart_kernel
method! That seems to give me a valid kernel ID, and then usingget_kernel
gives me aKernelManager
, which then I can useget_connection_info
with and get valid ports! This is what I've wanted all along!run_kernel
is what I would want to use, but I have no idea what*args
are, so I have no idea how to use it.kernel_info
and send akernel_info_request
and get back thekernel_info_reply
. Unlike a bunch of other messages, there doesn't seem to be a method forkernel_info
... After googling for a bit I run acrossclient.py
which has akernel_info
method, and realize that that class is aKernelClient
, not aKernelManager
, and that I can get a client withKernelManager.client()
. I get a clientclient
and runclient.kernel_info()
(which I will not is not documented on the client page and I only know about it b/c I read some source). I get back a UUID which I assume is the UUID of the sent message, and I confirm this in the source ofclient.py
, and now somehow I need to map this UUID to a response message.client.get_shell_msg()
. I guess technically I should check whether it has the right parent but given that I've only sent one message so far it is more or less guaranteed to be the response I expect if the kernel is behaving at all reasonably.p_metadata
piece, I think.If in reality I just missed a bunch of documentation that already exists, then please point me to it and I'll feel silly; if not then it might be helpful to add bits and pieces to the
jupyter_client
docs to save whoever comes next an hour or two.