File tree Expand file tree Collapse file tree 4 files changed +10
-0
lines changed Expand file tree Collapse file tree 4 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ kernelspec - discovering kernels
25
25
The name of the language the kernel implements, to help with picking
26
26
appropriate kernels when loading notebooks.
27
27
28
+ .. attribute :: metadata
29
+
30
+ Additional kernel-specific metadata; clients can use this as needed,
31
+ for instance to aid in kernel selection and filtering.
32
+
28
33
.. attribute :: resource_dir
29
34
30
35
The path to the directory with this kernel's resources, such as icons.
Original file line number Diff line number Diff line change @@ -135,6 +135,8 @@ JSON serialised dictionary containing the following keys and values:
135
135
- **env ** (optional): A dictionary of environment variables to set for the kernel.
136
136
These will be added to the current environment variables before the kernel is
137
137
started.
138
+ - **metadata ** (optional): A dictionary of additional attributes about this
139
+ kernel; used by clients to aid clients in kernel selection.
138
140
139
141
For example, the kernel.json file for IPython looks like this::
140
142
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ class KernelSpec(HasTraits):
28
28
language = Unicode ()
29
29
env = Dict ()
30
30
resource_dir = Unicode ()
31
+ metadata = Dict ()
31
32
32
33
@classmethod
33
34
def from_resource_dir (cls , resource_dir ):
@@ -45,6 +46,7 @@ def to_dict(self):
45
46
env = self .env ,
46
47
display_name = self .display_name ,
47
48
language = self .language ,
49
+ metadata = self .metadata ,
48
50
)
49
51
50
52
return d
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ def test_get_kernel_spec(self):
67
67
self .assertEqual (ks .argv , sample_kernel_json ['argv' ])
68
68
self .assertEqual (ks .display_name , sample_kernel_json ['display_name' ])
69
69
self .assertEqual (ks .env , {})
70
+ self .assertEqual (ks .metadata , {})
70
71
71
72
def test_find_all_specs (self ):
72
73
kernels = self .ksm .get_all_specs ()
You can’t perform that action at this time.
0 commit comments