Skip to content

Commit 2834bb9

Browse files
committed
Update example
1 parent 6322120 commit 2834bb9

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

jupyter-parameterized-kernel-spec/jupyter-parameterized-kernel-specs.md

+24-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Some of the chosen parameter values can be saved in e.g. the notebook metadata s
2222

2323
## Detailed Explanation
2424

25-
As described in previous sections, we propose to parameterize the kernel specs file. In the example shown below, we can see the kernel specs file from the kernel xeus-cling. We suggest changing the last parameter of the execution command `-std=c++11` to have a variable `-std=${cpp_version}` and adding a new object `parameters` to the metadata of the kernel specs.
25+
As described in previous sections, we propose to parameterize the kernel specs file. In the example shown below, we can see the kernel specs file from the kernel xeus-cling. We suggest changing the last parameter of the execution command `-std=c++11` to have a variable `-std=${parameters.cpp_version}` and adding a new object `parameters` to the metadata of the kernel specs.
2626

2727
```=json
2828
{
@@ -33,6 +33,9 @@ As described in previous sections, we propose to parameterize the kernel specs f
3333
"{connection_file}",
3434
"-std=c++11"
3535
],
36+
env: [
37+
"XEUS_LOGLEVEL=ERROR"
38+
],
3639
"language": "C++11"
3740
}
3841
```
@@ -43,16 +46,33 @@ As described in previous sections, we propose to parameterize the kernel specs f
4346
"/home/user/micromamba/envs/kernel_spec/bin/xcpp",
4447
"-f",
4548
"{connection_file}",
46-
"-std=${parameters.cpp_version}"
49+
"-std={parameters.cpp_version}"
50+
],
51+
env: [
52+
"XEUS_LOGLEVEL={parameters.xeus_log_level}"
4753
],
4854
"language": "C++"
4955
"metadata": {
5056
"parameters": {
5157
"cpp_version": {
5258
"type": "string",
53-
"default": 'C++14',
54-
"enum": ['C++11', 'C++14', 'C++17'],
59+
"default": "C++14",
60+
"enum": ["C++11", "C++14", "C++17"],
61+
"save": true
62+
},
63+
"xeus_log_level": {
64+
"type": "string",
65+
"default": "ERROR",
66+
"enum": ["TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"],
5567
"save": true
68+
},
69+
"spark_provisioner": {
70+
"title": "Spark Provisioner Parameters"
71+
"type": "object",
72+
"properties": {
73+
"cpus": {"type": "number", "minimum": 0.5, "maximum": 8.0, "default": 4.0, "description": "The number of CPUs to use for this kernel"},
74+
"memory": {"type": "integer", "minimum": 2, "maximum": 1024, "default": 8, "description": "The number of GB to reserve for memory for this kernel"}
75+
}
5676
}
5777
}
5878
},

0 commit comments

Comments
 (0)