-
Notifications
You must be signed in to change notification settings - Fork 55
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
Why is the kernel client class pinned to AsyncKernelClient? #116
Comments
Hi Kevin, |
Hi David - thanks for the quick response. Because I'm really going through Papermill here, I am specifying So is the reason for this forced override purely to ensure an async kernel client is used even in the classic case where a synchronous kernel manager is used? That seems to be the case since the default value for the If nbclient requires an async kernel client (and a subclass of if self.km.client_class == 'jupyter_client.client.KernelClient':
self.km.client_class = 'jupyter_client.asynchronous.AsyncKernelClient' This way, other kernel managers can bring their own async kernel client implementations. |
Yes, this looks good to me. Thanks for looking into it Kevin! |
It might be nice for KernelManagers to be able to optionally supply a suggested KernelClient class so we could let a kernel manager assignment alone apply sane default client associations when the user isn't sure. |
Isn't it why we have |
Yes. That's what I get for a quick response from my phone without thinking. Apologies and ignore that comment. |
No worries Matthew! My question was really for me to check if I understood correctly 😃 |
Addressed by #117 |
Hello - great project folks!
I'm trying to bring my own kernel manager class for running a notebook through papermill which needs a specific kernel client class. However, nbclient is forcing the use of AsyncKernelClient despite my kernel manager specifying that a different client class be used. I suspect this is to trigger the use of
AsyncKernelClient
even when the synchronous jupyter_client KernelManager class is used but would like to get a better understanding.If this is the reason, it seems like this forced override should be conveyed via a configuration option so that custom kernel client classes can be used. In reading through #10, I didn't find any discussion of this particular line of code - which I also found surprising since the kernel manager class is already responsible for determining its corresponding kernel client class.
I'm happy to submit a PR that introduces a boolean to trigger this override - or something to that effect - so long as there's an ability to use the desired kernel client class specified by the kernel manager. Thanks.
The text was updated successfully, but these errors were encountered: