8000 nbfmt: normalize cell execution_count. · tensorflow/docs@6836f7d · GitHub
[go: up one dir, main page]

Skip to content

Commit 6836f7d

Browse files
lambertacopybara-github
authored andcommitted
nbfmt: normalize cell execution_count.
PiperOrigin-RevId: 322451062
1 parent bc9207a commit 6836f7d

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

site/en/tutorials/quickstart/beginner.ipynb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
{
1414
"cell_type": "code",
15-
"execution_count": 0,
15+
"execution_count": null,
1616
"metadata": {
1717
"cellView": "form",
1818
"colab": {},
@@ -108,7 +108,7 @@
108108
},
109109
{
110110
"cell_type": "code",
111-
"execution_count": 0,
111+
"execution_count": null,
112112
"metadata": {
113113
"colab": {},
114114
"colab_type": "code",
@@ -131,7 +131,7 @@
131131
},
132132
{
133133
"cell_type": "code",
134-
"execution_count": 0,
134+
"execution_count": null,
135135
"metadata": {
136136
"colab": {},
137137
"colab_type": "code",
@@ -157,7 +157,7 @@
157157
},
158158
{
159159
"cell_type": "code",
160-
"execution_count": 0,
160+
"execution_count": null,
161161
"metadata": {
162162
"colab": {},
163163
"colab_type": "code",
@@ -185,7 +185,7 @@
185185
},
186186
{
187187
"cell_type": "code",
188-
"execution_count": 0,
188+
"execution_count": null,
189189
"metadata": {
190190
"colab": {},
191191
"colab_type": "code",
@@ -209,7 +209,7 @@
209209
},
210210
{
211211
"cell_type": "code",
212-
"execution_count": 0,
212+
"execution_count": null,
213213
"metadata": {
214214
"colab": {},
215215
"colab_type": "code",
@@ -243,7 +243,7 @@
243243
},
244244
{
245245
"cell_type": "code",
246-
"execution_count": 0,
246+
"execution_count": null,
247247
"metadata": {
248248
"colab": {},
249249
"colab_type": "code",
@@ -269,7 +269,7 @@
269269
},
270270
{
271271
"cell_type": "code",
272-
"execution_count": 0,
272+
"execution_count": null,
273273
"metadata": {
274274
"colab": {},
275275
"colab_type": "code",
@@ -282,7 +282,7 @@
282282
},
283283
{
284284
"cell_type": "code",
285-
"execution_count": 0,
285+
"execution_count": null,
286286
"metadata": {
287287
"colab": {},
288288
"colab_type": "code",
@@ -307,7 +307,7 @@
307307
},
308308
{
309309
"cell_type": "code",
310-
"execution_count": 0,
310+
"execution_count": null,
311311
"metadata": {
312312
"colab": {},
313313
"colab_type": "code",
@@ -330,7 +330,7 @@
330330
},
331331
{
332332
"cell_type": "code",
333-
"execution_count": 0,
333+
"execution_count": null,
334334
"metadata": {
335335
"colab": {},
336336
"colab_type": "code",
@@ -363,7 +363,7 @@
363363
},
364364
{
365365
"cell_type": "code",
366-
"execution_count": 0,
366+
"execution_count": null,
367367
"metadata": {
368368
"colab": {},
369369
"colab_type": "code",
@@ -379,7 +379,7 @@
379379
},
380380
{
381381
"cell_type": "code",
382-
"execution_count": 0,
382+
"execution_count": null,
383383
"metadata": {
384384
"colab": {},
385385
"colab_type": "code",

tools/tensorflow_docs/tools/nbfmt/__main__.py

100755100644
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ def clean_cells(data) -> None:
138138
if cell.get("outputs", None) is None:
139139
cell["outputs"] = []
140140

141+
# Spec allows null or integer, but use null since it's the Colab default.
142+
if cell.get("execution_count") == 0:
143+
cell["execution_count"] = None
144+
141145
if has_outputs:
142146
warn("Removed the existing output cells.")
143147

0 commit comments

Comments
 (0)
0