Skip to content

Commit 9bf95e2

Browse files
committed
add nbstripout --drop-empty-cells --keep-output commit hook
1 parent c2406c9 commit 9bf95e2

File tree

2 files changed

+21
-53
lines changed

2 files changed

+21
-53
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ default_stages: [commit]
55

66
default_install_hook_types: [pre-commit, commit-msg]
77

8-
# ignore generated doc and dependency lock files
9-
exclude: ^(docs/.+|.*lock.*|.*\.(svg|js|css))$
8+
# ignore generated docs and dependency lock files, the directory
9+
# jupyterlab-extension/ and all SVG, JS and CSS files
10+
exclude: ^(docs/.+|.*lock.*|jupyterlab-extension/.+|.*\.(svg|js|css))$
1011

1112
repos:
1213
- repo: https://github.com/PyCQA/isort
@@ -72,3 +73,9 @@ repos:
7273
- id: nbqa-isort
7374
- id: nbqa-flake8
7475
args: [--ignore=E402]
76+
77+
- repo: https://github.com/kynan/nbstripout
78+
rev: 0.6.0
79+
hooks:
80+
- id: nbstripout
81+
args: [--drop-empty-cells, --keep-output]

tests/test_pythreejs/pythreejs_test.ipynb

Lines changed: 12 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
{
1414
"cell_type": "code",
15-
"execution_count": 13,
15+
"execution_count": null,
1616
"metadata": {},
1717
"outputs": [],
1818
"source": [
@@ -39,24 +39,9 @@
3939
},
4040
{
4141
"cell_type": "code",
42-
"execution_count": 16,
42+
"execution_count": null,
4343
"metadata": {},
44-
"outputs": [
45-
{
46-
"data": {
47-
"application/vnd.jupyter.widget-view+json": {
48-
"model_id": "61daa80c4325446a868441ded2a719a8",
49-
"version_major": 2,
50-
"version_minor": 0
51-
},
52-
"text/plain": [
53-
"Renderer(background='white', camera=OrthographicCamera(bottom=-11.600923499999997, left=-11.600923499999997, n…"
54-
]
55-
},
56-
"metadata": {},
57-
"output_type": "display_data"
58-
}
59-
],
44+
"outputs": [],
6045
"source": [
6146
"view(chgcar.structure)"
6247
]
@@ -70,38 +55,9 @@
7055
},
7156
{
7257
"cell_type": "code",
73-
"execution_count": 17,
58+
"execution_count": null,
7459
"metadata": {},
75-
"outputs": [
76-
{
77-
"data": {
78-
"application/vnd.jupyter.widget-view+json": {
79-
"model_id": "beb7329819834dbf9a27698d073259c2",
80-
"version_major": 2,
81-
"version_minor": 0
82-
},
83-
"text/plain": [
84-
"Renderer(background='white', camera=OrthographicCamera(bottom=-11.600923499999997, left=-11.600923499999997, n…"
85-
]
86-
},
87-
"metadata": {},
88-
"output_type": "display_data"
89-
},
90-
{
91-
"data": {
92-
"application/vnd.jupyter.widget-view+json": {
93-
"model_id": "02c8fb82565c4e11acd396342877efe3",
94-
"version_major": 2,
95-
"version_minor": 0
96-
},
97-
"text/plain": [
98-
"Renderer(background='white', camera=OrthographicCamera(bottom=-11.600923499999997, left=-11.600923499999997, n…"
99-
]
100-
},
101-
"metadata": {},
102-
"output_type": "display_data"
103-
}
104-
],
60+
"outputs": [],
10561
"source": [
10662
"view(chgcar, isolvl=0.01)\n",
10763
"view(chgcar, isolvl=0.001)"
@@ -110,7 +66,7 @@
11066
],
11167
"metadata": {
11268
"kernelspec": {
113-
"display_name": "Python 3",
69+
"display_name": "Python 3.10.5 64-bit",
11470
"language": "python",
11571
"name": "python3"
11672
},
@@ -124,7 +80,12 @@
12480
"name": "python",
12581
"nbconvert_exporter": "python",
12682
"pygments_lexer": "ipython3",
127-
"version": "3.7.4"
83+
"version": "3.10.5"
84+
},
85+
"vscode": {
86+
"interpreter": {
87+
"hash": "8022b3e932e045c760cb4633b91dd1cb8bc60d104ca9808334cbd1645adbe837"
88+
}
12889
}
12990
},
13091
"nbformat": 4,

0 commit comments

Comments
 (0)