Skip to content

Conversation

@AnastasiaSliusar
Copy link
Contributor

@AnastasiaSliusar AnastasiaSliusar commented Jun 14, 2024

References

This work is in progress as JEP jupyter/enhancement-proposals#87.
This PR should be reviewed when the JEP has been accepted

Code changes

There are next changes in:

  • Notebook extension
  • Console extension

User-facing changes

  1. When a user clicks on some kernel on Notebook section on Launch panel and that kernel includes custom kernel spec variables that will be used for customization then a user will see the dialog which will suggest to configure the kernel.
  2. When a user has run a kernel and then they wants to change on another kernel, then the user can call another dialog window where they can select a kernel and if this kernel includes custom kernel spec variables the user will be suggested to configure that kernel.
  3. When a user clicks on some kernel on Console section on Launch panel then the user will see the same dialog with suggestions to configure a kernel.
  4. If a user does not select anything and then they run a kernel, and a kernel spec file includes default values then default values will be taken.
  5. If a user does not select anything and then they run a kernel, and a kernel spec file does not include default values and there are kernel variables (for example, "{raw}" in the demo video) inside kernel.json file then these variables will be cleaned and a kernel will be run without them.

Demo video: https://drive.google.com/file/d/16kPyPoowsewuYkj1-3t6q6d-5G23fsQH/view?usp=sharing

How to run

@jupyterlab-probot
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

@krassowski krassowski mentioned this pull request Jun 19, 2024
18 tasks
if (model) {
await sessionContext.changeKernel(model);
if (hasCheckbox && result.isChecked !== null) {
if (model && sessionContext.kernelPreference?.customKernelSpecs) {

Check warning

Code scanning / CodeQL

Useless conditional

This use of variable 'model' always evaluates to true.
sessionContext.kernelPreference.customKernelSpecs = undefined;
}

if (model && dialogResult.custom_kernel_specs) {

Check warning

Code scanning / CodeQL

Useless conditional

This use of variable 'model' always evaluates to true.
};
}

if (model === null && !sessionContext.hasNoKernel) {

Check warning

Code scanning / CodeQL

Comparison between inconvertible types

Variable 'model' is of type object, but it is compared to [an expression](1) of type null.
if (model === null && !sessionContext.hasNoKernel) {
return sessionContext.shutdown();
}
if (model) {

Check warning

Code scanning / CodeQL

Useless conditional

This use of variable 'model' always evaluates to true.
if (model) {
await sessionContext.changeKernel(model);
if (hasCheckbox && result.isChecked !== null) {
if (model && sessionContext.kernelPreference?.customKernelSpecs) {

Check warning

Code scanning / CodeQL

Useless conditional

This use of variable 'model' always evaluates to true.
sessionContext.kernelPreference.customKernelSpecs = undefined;
}

if (model && dialogResult.custom_kernel_specs) {

Check warning

Code scanning / CodeQL

Useless conditional

This use of variable 'model' always evaluates to true.
};
}

if (model === null && !sessionContext.hasNoKernel) {

Check warning

Code scanning / CodeQL

Comparison between inconvertible types

Variable 'model' is of type object, but it is compared to [an expression](1) of type null.
if (model === null && !sessionContext.hasNoKernel) {
return sessionContext.shutdown();
}
if (model) {

Check warning

Code scanning / CodeQL

Useless conditional

This use of variable 'model' always evaluates to true.
@jtpio jtpio modified the milestones: 4.4.0, 4.5.0 Apr 8, 2025
@jtpio jtpio modified the milestones: 4.5.0, 4.6.0 Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants