Skip to content

Commit 8d9dc00

Browse files
fix: use fixed dates in Faker for reproducible notebook outputs
Replace relative date strings ('-35y', '-4y') and date_of_birth() with fixed date() bounds so that Faker generates identical dates regardless of when the notebook is executed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 066e6ee commit 8d9dc00

2 files changed

Lines changed: 579 additions & 577 deletions

File tree

src/tutorials/examples/languages.ipynb

Lines changed: 97 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,25 @@
3030
"id": "cell-setup",
3131
"metadata": {
3232
"execution": {
33-
"iopub.execute_input": "2026-02-19T18:33:13.922476Z",
34-
"iopub.status.busy": "2026-02-19T18:33:13.922226Z",
35-
"iopub.status.idle": "2026-02-19T18:33:14.264072Z",
36-
"shell.execute_reply": "2026-02-19T18:33:14.263675Z"
33+
"iopub.execute_input": "2026-02-19T20:41:15.942708Z",
34+
"iopub.status.busy": "2026-02-19T20:41:15.942598Z",
35+
"iopub.status.idle": "2026-02-19T20:41:16.282481Z",
36+
"shell.execute_reply": "2026-02-19T20:41:16.282148Z"
3737
}
3838
},
3939
"outputs": [
4040
{
4141
"name": "stdout",
4242
"output_type": "stream",
4343
"text": [
44-
"[2026-02-19 18:33:14] DataJoint 2.1.1 connected to postgres@postgres:5432\n"
44+
"[2026-02-19 20:41:16] DataJoint 2.1.1 connected to postgres@postgres:5432\n"
4545
]
4646
}
4747
],
4848
"source": [
4949
"import datajoint as dj\n",
5050
"import numpy as np\n",
51+
"from datetime import date\n",
5152
"from faker import Faker\n",
5253
"\n",
5354
"dj.config['display.limit'] = 8\n",
@@ -74,10 +75,10 @@
7475
"id": "cell-language",
7576
"metadata": {
7677
"execution": {
77-
"iopub.execute_input": "2026-02-19T18:33:14.265507Z",
78-
"iopub.status.busy": "2026-02-19T18:33:14.265301Z",
79-
"iopub.status.idle": "2026-02-19T18:33:14.288274Z",
80-
"shell.execute_reply": "2026-02-19T18:33:14.287897Z"
78+
"iopub.execute_input": "2026-02-19T20:41:16.283596Z",
79+
"iopub.status.busy": "2026-02-19T20:41:16.283444Z",
80+
"iopub.status.idle": "2026-02-19T20:41:16.299667Z",
81+
"shell.execute_reply": "2026-02-19T20:41:16.299359Z"
8182
}
8283
},
8384
"outputs": [],
@@ -112,10 +113,10 @@
112113
"id": "cell-cefr",
113114
"metadata": {
114115
"execution": {
115-
"iopub.execute_input": "2026-02-19T18:33:14.289602Z",
116-
"iopub.status.busy": "2026-02-19T18:33:14.289476Z",
117-
"iopub.status.idle": "2026-02-19T18:33:14.305275Z",
118-
"shell.execute_reply": "2026-02-19T18:33:14.304815Z"
116+
"iopub.execute_input": "2026-02-19T20:41:16.300657Z",
117+
"iopub.status.busy": "2026-02-19T20:41:16.300576Z",
118+
"iopub.status.idle": "2026-02-19T20:41:16.312296Z",
119+
"shell.execute_reply": "2026-02-19T20:41:16.311994Z"
119120
}
120121
},
121122
"outputs": [],
@@ -152,10 +153,10 @@
152153
"id": "cell-show-lookups",
153154
"metadata": {
154155
"execution": {
155-
"iopub.execute_input": "2026-02-19T18:33:14.306324Z",
156-
"iopub.status.busy": "2026-02-19T18:33:14.306221Z",
157-
"iopub.status.idle": "2026-02-19T18:33:14.310036Z",
158-
"shell.execute_reply": "2026-02-19T18:33:14.309706Z"
156+
"iopub.execute_input": "2026-02-19T20:41:16.313157Z",
157+
"iopub.status.busy": "2026-02-19T20:41:16.313083Z",
158+
"iopub.status.idle": "2026-02-19T20:41:16.316382Z",
159+
"shell.execute_reply": "2026-02-19T20:41:16.316138Z"
159160
}
160161
},
161162
"outputs": [
@@ -218,10 +219,10 @@
218219
"id": "cell-person",
219220
"metadata": {
220221
"execution": {
221-
"iopub.execute_input": "2026-02-19T18:33:14.311079Z",
222-
"iopub.status.busy": "2026-02-19T18:33:14.310979Z",
223-
"iopub.status.idle": "2026-02-19T18:33:14.318020Z",
224-
"shell.execute_reply": "2026-02-19T18:33:14.317677Z"
222+
"iopub.execute_input": "2026-02-19T20:41:16.317206Z",
223+
"iopub.status.busy": "2026-02-19T20:41:16.317125Z",
224+
"iopub.status.idle": "2026-02-19T20:41:16.323546Z",
225+
"shell.execute_reply": "2026-02-19T20:41:16.323373Z"
225226
}
226227
},
227228
"outputs": [],
@@ -243,10 +244,10 @@
243244
"id": "cell-proficiency",
244245
"metadata": {
245246
"execution": {
246-
"iopub.execute_input": "2026-02-19T18:33:14.319124Z",
247-
"iopub.status.busy": "2026-02-19T18:33:14.319033Z",
248-
"iopub.status.idle": "2026-02-19T18:33:14.329936Z",
249-
"shell.execute_reply": "2026-02-19T18:33:14.329611Z"
247+
"iopub.execute_input": "2026-02-19T20:41:16.324379Z",
248+
"iopub.status.busy": "2026-02-19T20:41:16.324304Z",
249+
"iopub.status.idle": "2026-02-19T20:41:16.332510Z",
250+
"shell.execute_reply": "2026-02-19T20:41:16.332291Z"
250251
}
251252
},
252253
"outputs": [],
@@ -268,10 +269,10 @@
268269
"id": "cell-diagram",
269270
"metadata": {
270271
"execution": {
271-
"iopub.execute_input": "2026-02-19T18:33:14.331049Z",
272-
"iopub.status.busy": "2026-02-19T18:33:14.330945Z",
273-
"iopub.status.idle": "2026-02-19T18:33:14.542104Z",
274-
"shell.execute_reply": "2026-02-19T18:33:14.541744Z"
272+
"iopub.execute_input": "2026-02-19T20:41:16.333252Z",
273+
"iopub.status.busy": "2026-02-19T20:41:16.333184Z",
274+
"iopub.status.idle": "2026-02-19T20:41:16.589367Z",
275+
"shell.execute_reply": "2026-02-19T20:41:16.589021Z"
275276
}
276277
},
277278
"outputs": [
@@ -358,7 +359,7 @@
358359
"</svg>"
359360
],
360361
"text/plain": [
361-
"<datajoint.diagram.Diagram at 0xffff7742b4a0>"
362+
"<datajoint.diagram.Diagram at 0xffff644f34a0>"
362363
]
363364
},
364365
"execution_count": 7,
@@ -396,10 +397,10 @@
396397
"id": "cell-populate-person",
397398
"metadata": {
398399
"execution": {
399-
"iopub.execute_input": "2026-02-19T18:33:14.543080Z",
400-
"iopub.status.busy": "2026-02-19T18:33:14.542992Z",
401-
"iopub.status.idle": "2026-02-19T18:33:14.573706Z",
402-
"shell.execute_reply": "2026-02-19T18:33:14.573483Z"
400+
"iopub.execute_input": "2026-02-19T20:41:16.590230Z",
401+
"iopub.status.busy": "2026-02-19T20:41:16.590156Z",
402+
"iopub.status.idle": "2026-02-19T20:41:16.621462Z",
403+
"shell.execute_reply": "2026-02-19T20:41:16.621218Z"
403404
}
404405
},
405406
"outputs": [
@@ -477,21 +478,21 @@
477478
" <thead> <tr> <th> <span id=\"primary\" title=\"unique identifier\">person_id</span></th><th><span id=\"nonprimary\" title=\"\">name</span></th><th><span id=\"nonprimary\" title=\"\">date_of_birth</span> </th> </tr> </thead>\n",
478479
" <tbody> <tr> <td>0</td>\n",
479480
"<td>Allison Hill</td>\n",
480-
"<td>1966-12-18</td></tr><tr><td>1</td>\n",
481+
"<td>1967-08-10</td></tr><tr><td>1</td>\n",
481482
"<td>Megan Mcclain</td>\n",
482-
"<td>1959-09-28</td></tr><tr><td>2</td>\n",
483+
"<td>1960-07-09</td></tr><tr><td>2</td>\n",
483484
"<td>Allen Robinson</td>\n",
484-
"<td>1981-12-01</td></tr><tr><td>3</td>\n",
485+
"<td>1982-04-12</td></tr><tr><td>3</td>\n",
485486
"<td>Cristian Santos</td>\n",
486-
"<td>1984-01-06</td></tr><tr><td>4</td>\n",
487+
"<td>1984-05-03</td></tr><tr><td>4</td>\n",
487488
"<td>Kevin Pacheco</td>\n",
488-
"<td>1955-06-24</td></tr><tr><td>5</td>\n",
489+
"<td>1956-05-03</td></tr><tr><td>5</td>\n",
489490
"<td>Melissa Peterson</td>\n",
490-
"<td>1963-05-17</td></tr><tr><td>6</td>\n",
491+
"<td>1964-02-01</td></tr><tr><td>6</td>\n",
491492
"<td>Gabrielle Davis</td>\n",
492-
"<td>1960-04-05</td></tr><tr><td>7</td>\n",
493+
"<td>1961-01-10</td></tr><tr><td>7</td>\n",
493494
"<td>Lindsey Roman</td>\n",
494-
"<td>1993-10-23</td> </tr> </tbody>\n",
495+
"<td>1993-12-11</td> </tr> </tbody>\n",
495496
" </table>\n",
496497
" <p>...</p>\n",
497498
" <p>Total: 200</p></div>\n",
@@ -500,14 +501,14 @@
500501
"text/plain": [
501502
"*person_id name date_of_birth \n",
502503
"+-----------+ +------------+ +------------+\n",
503-
"0 Allison Hill 1966-12-18 \n",
504-
"1 Megan Mcclain 1959-09-28 \n",
505-
"2 Allen Robinson 1981-12-01 \n",
506-
"3 Cristian Santo 1984-01-06 \n",
507-
"4 Kevin Pacheco 1955-06-24 \n",
508-
"5 Melissa Peters 1963-05-17 \n",
509-
"6 Gabrielle Davi 1960-04-05 \n",
510-
"7 Lindsey Roman 1993-10-23 \n",
504+
"0 Allison Hill 1967-08-10 \n",
505+
"1 Megan Mcclain 1960-07-09 \n",
506+
"2 Allen Robinson 1982-04-12 \n",
507+
"3 Cristian Santo 1984-05-03 \n",
508+
"4 Kevin Pacheco 1956-05-03 \n",
509+
"5 Melissa Peters 1964-02-01 \n",
510+
"6 Gabrielle Davi 1961-01-10 \n",
511+
"7 Lindsey Roman 1993-12-11 \n",
511512
" ...\n",
512513
" (Total: 200)"
513514
]
@@ -528,8 +529,8 @@
528529
" {\n",
529530
" 'person_id': i,\n",
530531
" 'name': fake.name(),\n",
531-
" 'date_of_birth': fake.date_of_birth(\n",
532-
" minimum_age=18, maximum_age=70)\n",
532+
" 'date_of_birth': fake.date_between(\n",
533+
" start_date=date(1956, 1, 1), end_date=date(2008, 1, 1))\n",
533534
" }\n",
534535
" for i in range(n_people)\n",
535536
")\n",
@@ -544,10 +545,10 @@
544545
"id": "cell-populate-prof",
545546
"metadata": {
546547
"execution": {
547-
"iopub.execute_input": "2026-02-19T18:33:14.574639Z",
548-
"iopub.status.busy": "2026-02-19T18:33:14.574552Z",
549-
"iopub.status.idle": "2026-02-19T18:33:14.624904Z",
550-
"shell.execute_reply": "2026-02-19T18:33:14.624663Z"
548+
"iopub.execute_input": "2026-02-19T20:41:16.622288Z",
549+
"iopub.status.busy": "2026-02-19T20:41:16.622210Z",
550+
"iopub.status.idle": "2026-02-19T20:41:16.668197Z",
551+
"shell.execute_reply": "2026-02-19T20:41:16.667974Z"
551552
}
552553
},
553554
"outputs": [
@@ -708,10 +709,10 @@
708709
"id": "cell-q1",
709710
"metadata": {
710711
"execution": {
711-
"iopub.execute_input": "2026-02-19T18:33:14.625759Z",
712-
"iopub.status.busy": "2026-02-19T18:33:14.625672Z",
713-
"iopub.status.idle": "2026-02-19T18:33:14.631046Z",
714-
"shell.execute_reply": "2026-02-19T18:33:14.630749Z"
712+
"iopub.execute_input": "2026-02-19T20:41:16.669057Z",
713+
"iopub.status.busy": "2026-02-19T20:41:16.668977Z",
714+
"iopub.status.idle": "2026-02-19T20:41:16.673381Z",
715+
"shell.execute_reply": "2026-02-19T20:41:16.673140Z"
715716
}
716717
},
717718
"outputs": [
@@ -837,10 +838,10 @@
837838
"id": "cell-q2",
838839
"metadata": {
839840
"execution": {
840-
"iopub.execute_input": "2026-02-19T18:33:14.631894Z",
841-
"iopub.status.busy": "2026-02-19T18:33:14.631810Z",
842-
"iopub.status.idle": "2026-02-19T18:33:14.637059Z",
843-
"shell.execute_reply": "2026-02-19T18:33:14.636830Z"
841+
"iopub.execute_input": "2026-02-19T20:41:16.674143Z",
842+
"iopub.status.busy": "2026-02-19T20:41:16.674066Z",
843+
"iopub.status.idle": "2026-02-19T20:41:16.678475Z",
844+
"shell.execute_reply": "2026-02-19T20:41:16.678232Z"
844845
}
845846
},
846847
"outputs": [
@@ -962,10 +963,10 @@
962963
"id": "cell-q3",
963964
"metadata": {
964965
"execution": {
965-
"iopub.execute_input": "2026-02-19T18:33:14.637864Z",
966-
"iopub.status.busy": "2026-02-19T18:33:14.637797Z",
967-
"iopub.status.idle": "2026-02-19T18:33:14.642102Z",
968-
"shell.execute_reply": "2026-02-19T18:33:14.641635Z"
966+
"iopub.execute_input": "2026-02-19T20:41:16.679190Z",
967+
"iopub.status.busy": "2026-02-19T20:41:16.679119Z",
968+
"iopub.status.idle": "2026-02-19T20:41:16.683230Z",
969+
"shell.execute_reply": "2026-02-19T20:41:16.682984Z"
969970
}
970971
},
971972
"outputs": [
@@ -1099,10 +1100,10 @@
10991100
"id": "cell-q4",
11001101
"metadata": {
11011102
"execution": {
1102-
"iopub.execute_input": "2026-02-19T18:33:14.643096Z",
1103-
"iopub.status.busy": "2026-02-19T18:33:14.642990Z",
1104-
"iopub.status.idle": "2026-02-19T18:33:14.650066Z",
1105-
"shell.execute_reply": "2026-02-19T18:33:14.649813Z"
1103+
"iopub.execute_input": "2026-02-19T20:41:16.683981Z",
1104+
"iopub.status.busy": "2026-02-19T20:41:16.683898Z",
1105+
"iopub.status.idle": "2026-02-19T20:41:16.689461Z",
1106+
"shell.execute_reply": "2026-02-19T20:41:16.689174Z"
11061107
}
11071108
},
11081109
"outputs": [
@@ -1247,10 +1248,10 @@
12471248
"id": "cell-q5",
12481249
"metadata": {
12491250
"execution": {
1250-
"iopub.execute_input": "2026-02-19T18:33:14.650901Z",
1251-
"iopub.status.busy": "2026-02-19T18:33:14.650824Z",
1252-
"iopub.status.idle": "2026-02-19T18:33:14.654952Z",
1253-
"shell.execute_reply": "2026-02-19T18:33:14.654700Z"
1251+
"iopub.execute_input": "2026-02-19T20:41:16.690156Z",
1252+
"iopub.status.busy": "2026-02-19T20:41:16.690084Z",
1253+
"iopub.status.idle": "2026-02-19T20:41:16.694550Z",
1254+
"shell.execute_reply": "2026-02-19T20:41:16.694297Z"
12541255
}
12551256
},
12561257
"outputs": [
@@ -1368,10 +1369,10 @@
13681369
"id": "cell-q6",
13691370
"metadata": {
13701371
"execution": {
1371-
"iopub.execute_input": "2026-02-19T18:33:14.655690Z",
1372-
"iopub.status.busy": "2026-02-19T18:33:14.655610Z",
1373-
"iopub.status.idle": "2026-02-19T18:33:14.660062Z",
1374-
"shell.execute_reply": "2026-02-19T18:33:14.659784Z"
1372+
"iopub.execute_input": "2026-02-19T20:41:16.695308Z",
1373+
"iopub.status.busy": "2026-02-19T20:41:16.695231Z",
1374+
"iopub.status.idle": "2026-02-19T20:41:16.699492Z",
1375+
"shell.execute_reply": "2026-02-19T20:41:16.699234Z"
13751376
}
13761377
},
13771378
"outputs": [
@@ -1498,10 +1499,10 @@
14981499
"id": "cell-q7",
14991500
"metadata": {
15001501
"execution": {
1501-
"iopub.execute_input": "2026-02-19T18:33:14.660959Z",
1502-
"iopub.status.busy": "2026-02-19T18:33:14.660887Z",
1503-
"iopub.status.idle": "2026-02-19T18:33:14.664948Z",
1504-
"shell.execute_reply": "2026-02-19T18:33:14.664715Z"
1502+
"iopub.execute_input": "2026-02-19T20:41:16.700166Z",
1503+
"iopub.status.busy": "2026-02-19T20:41:16.700101Z",
1504+
"iopub.status.idle": "2026-02-19T20:41:16.703403Z",
1505+
"shell.execute_reply": "2026-02-19T20:41:16.703164Z"
15051506
}
15061507
},
15071508
"outputs": [
@@ -1629,10 +1630,10 @@
16291630
"id": "cell-q8",
16301631
"metadata": {
16311632
"execution": {
1632-
"iopub.execute_input": "2026-02-19T18:33:14.665691Z",
1633-
"iopub.status.busy": "2026-02-19T18:33:14.665627Z",
1634-
"iopub.status.idle": "2026-02-19T18:33:14.669960Z",
1635-
"shell.execute_reply": "2026-02-19T18:33:14.669738Z"
1633+
"iopub.execute_input": "2026-02-19T20:41:16.704109Z",
1634+
"iopub.status.busy": "2026-02-19T20:41:16.704044Z",
1635+
"iopub.status.idle": "2026-02-19T20:41:16.708560Z",
1636+
"shell.execute_reply": "2026-02-19T20:41:16.708285Z"
16361637
}
16371638
},
16381639
"outputs": [
@@ -1758,10 +1759,10 @@
17581759
"id": "cell-q9",
17591760
"metadata": {
17601761
"execution": {
1761-
"iopub.execute_input": "2026-02-19T18:33:14.670746Z",
1762-
"iopub.status.busy": "2026-02-19T18:33:14.670666Z",
1763-
"iopub.status.idle": "2026-02-19T18:33:14.676049Z",
1764-
"shell.execute_reply": "2026-02-19T18:33:14.675826Z"
1762+
"iopub.execute_input": "2026-02-19T20:41:16.709319Z",
1763+
"iopub.status.busy": "2026-02-19T20:41:16.709246Z",
1764+
"iopub.status.idle": "2026-02-19T20:41:16.714415Z",
1765+
"shell.execute_reply": "2026-02-19T20:41:16.714166Z"
17651766
}
17661767
},
17671768
"outputs": [
@@ -1925,10 +1926,10 @@
19251926
"id": "cell-cleanup",
19261927
"metadata": {
19271928
"execution": {
1928-
"iopub.execute_input": "2026-02-19T18:33:14.676973Z",
1929-
"iopub.status.busy": "2026-02-19T18:33:14.676892Z",
1930-
"iopub.status.idle": "2026-02-19T18:33:14.680976Z",
1931-
"shell.execute_reply": "2026-02-19T18:33:14.680719Z"
1929+
"iopub.execute_input": "2026-02-19T20:41:16.715158Z",
1930+
"iopub.status.busy": "2026-02-19T20:41:16.715086Z",
1931+
"iopub.status.idle": "2026-02-19T20:41:16.718367Z",
1932+
"shell.execute_reply": "2026-02-19T20:41:16.718155Z"
19321933
}
19331934
},
19341935
"outputs": [],

0 commit comments

Comments
 (0)