Skip to content

Commit de73ad0

Browse files
committed
✏️ Wording and beautifying
1 parent 5d9ae0e commit de73ad0

File tree

2 files changed

+163
-27
lines changed

2 files changed

+163
-27
lines changed

docs/clean-prep/tdda.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@
339339
"metadata": {},
340340
"outputs": [],
341341
"source": [
342-
"with open(\"../../data/ignore-iot_constraints.tdda\", \"w\") as f:\n",
342+
"with open(\"../../data/iot_example.json\", \"w\") as f:\n",
343343
" f.write(constraints.to_json())"
344344
]
345345
},
@@ -430,7 +430,7 @@
430430
}
431431
],
432432
"source": [
433-
"!cat ../../data/ignore-iot_constraints.tdda"
433+
"!cat ../../data/iot_example.json"
434434
]
435435
},
436436
{
@@ -633,7 +633,7 @@
633633
"metadata": {},
634634
"outputs": [],
635635
"source": [
636-
"v = verify_df(new_df, '../../data/ignore-iot_constraints.tdda')"
636+
"v = verify_df(new_df, '../../data/iot_example.json')"
637637
]
638638
},
639639
{

docs/clean-prep/voluptuous.ipynb

Lines changed: 160 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@
2727
{
2828
"cell_type": "code",
2929
"execution_count": 1,
30-
"metadata": {},
30+
"metadata": {
31+
"execution": {
32+
"iopub.execute_input": "2025-11-19T14:38:04.007368Z",
33+
"iopub.status.busy": "2025-11-19T14:38:04.007203Z",
34+
"iopub.status.idle": "2025-11-19T14:38:04.449780Z",
35+
"shell.execute_reply": "2025-11-19T14:38:04.449484Z",
36+
"shell.execute_reply.started": "2025-11-19T14:38:04.007347Z"
37+
}
38+
},
3139
"outputs": [],
3240
"source": [
3341
"import logging\n",
@@ -62,7 +70,15 @@
6270
{
6371
"cell_type": "code",
6472
"execution_count": 2,
65-
"metadata": {},
73+
"metadata": {
74+
"execution": {
75+
"iopub.execute_input": "2025-11-19T14:38:04.450310Z",
76+
"iopub.status.busy": "2025-11-19T14:38:04.450179Z",
77+
"iopub.status.idle": "2025-11-19T14:38:04.452317Z",
78+
"shell.execute_reply": "2025-11-19T14:38:04.452038Z",
79+
"shell.execute_reply.started": "2025-11-19T14:38:04.450301Z"
80+
}
81+
},
6682
"outputs": [],
6783
"source": [
6884
"logger = logging.getLogger(0)\n",
@@ -79,7 +95,15 @@
7995
{
8096
"cell_type": "code",
8197
"execution_count": 3,
82-
"metadata": {},
98+
"metadata": {
99+
"execution": {
100+
"iopub.execute_input": "2025-11-19T14:38:04.452881Z",
101+
"iopub.status.busy": "2025-11-19T14:38:04.452768Z",
102+
"iopub.status.idle": "2025-11-19T14:38:04.848950Z",
103+
"shell.execute_reply": "2025-11-19T14:38:04.848149Z",
104+
"shell.execute_reply.started": "2025-11-19T14:38:04.452869Z"
105+
}
106+
},
83107
"outputs": [],
84108
"source": [
85109
"sales = pd.read_csv(\n",
@@ -97,7 +121,15 @@
97121
{
98122
"cell_type": "code",
99123
"execution_count": 4,
100-
"metadata": {},
124+
"metadata": {
125+
"execution": {
126+
"iopub.execute_input": "2025-11-19T14:38:04.850091Z",
127+
"iopub.status.busy": "2025-11-19T14:38:04.849817Z",
128+
"iopub.status.idle": "2025-11-19T14:38:04.864279Z",
129+
"shell.execute_reply": "2025-11-19T14:38:04.863875Z",
130+
"shell.execute_reply.started": "2025-11-19T14:38:04.850064Z"
131+
}
132+
},
101133
"outputs": [
102134
{
103135
"data": {
@@ -212,7 +244,15 @@
212244
{
213245
"cell_type": "code",
214246
"execution_count": 5,
215-
"metadata": {},
247+
"metadata": {
248+
"execution": {
249+
"iopub.execute_input": "2025-11-19T14:38:04.865197Z",
250+
"iopub.status.busy": "2025-11-19T14:38:04.864975Z",
251+
"iopub.status.idle": "2025-11-19T14:38:04.868287Z",
252+
"shell.execute_reply": "2025-11-19T14:38:04.867996Z",
253+
"shell.execute_reply.started": "2025-11-19T14:38:04.865182Z"
254+
}
255+
},
216256
"outputs": [
217257
{
218258
"data": {
@@ -232,7 +272,15 @@
232272
{
233273
"cell_type": "code",
234274
"execution_count": 6,
235-
"metadata": {},
275+
"metadata": {
276+
"execution": {
277+
"iopub.execute_input": "2025-11-19T14:38:04.870019Z",
278+
"iopub.status.busy": "2025-11-19T14:38:04.869911Z",
279+
"iopub.status.idle": "2025-11-19T14:38:04.875494Z",
280+
"shell.execute_reply": "2025-11-19T14:38:04.875138Z",
281+
"shell.execute_reply.started": "2025-11-19T14:38:04.870011Z"
282+
}
283+
},
236284
"outputs": [
237285
{
238286
"data": {
@@ -268,14 +316,22 @@
268316
{
269317
"cell_type": "code",
270318
"execution_count": 7,
271-
"metadata": {},
319+
"metadata": {
320+
"execution": {
321+
"iopub.execute_input": "2025-11-19T14:38:04.876028Z",
322+
"iopub.status.busy": "2025-11-19T14:38:04.875902Z",
323+
"iopub.status.idle": "2025-11-19T14:38:04.878452Z",
324+
"shell.execute_reply": "2025-11-19T14:38:04.878190Z",
325+
"shell.execute_reply.started": "2025-11-19T14:38:04.876018Z"
326+
}
327+
},
272328
"outputs": [],
273329
"source": [
274330
"schema = Schema(\n",
275331
" {\n",
276332
" Required(\"sale_amount\"): All(float, Range(min=2.50, max=1450.99)),\n",
277333
" },\n",
278-
" extra=ALLOW_EXTRA,\n",
334+
" extra = ALLOW_EXTRA,\n",
279335
")"
280336
]
281337
},
@@ -289,7 +345,15 @@
289345
{
290346
"cell_type": "code",
291347
"execution_count": 8,
292-
"metadata": {},
348+
"metadata": {
349+
"execution": {
350+
"iopub.execute_input": "2025-11-19T14:38:04.878780Z",
351+
"iopub.status.busy": "2025-11-19T14:38:04.878712Z",
352+
"iopub.status.idle": "2025-11-19T14:38:04.902865Z",
353+
"shell.execute_reply": "2025-11-19T14:38:04.902576Z",
354+
"shell.execute_reply.started": "2025-11-19T14:38:04.878773Z"
355+
}
356+
},
293357
"outputs": [
294358
{
295359
"name": "stderr",
@@ -382,7 +446,15 @@
382446
{
383447
"cell_type": "code",
384448
"execution_count": 9,
385-
"metadata": {},
449+
"metadata": {
450+
"execution": {
451+
"iopub.execute_input": "2025-11-19T14:38:04.903435Z",
452+
"iopub.status.busy": "2025-11-19T14:38:04.903215Z",
453+
"iopub.status.idle": "2025-11-19T14:38:04.905650Z",
454+
"shell.execute_reply": "2025-11-19T14:38:04.905288Z",
455+
"shell.execute_reply.started": "2025-11-19T14:38:04.903423Z"
456+
}
457+
},
386458
"outputs": [
387459
{
388460
"data": {
@@ -420,31 +492,55 @@
420492
{
421493
"cell_type": "code",
422494
"execution_count": 10,
423-
"metadata": {},
495+
"metadata": {
496+
"execution": {
497+
"iopub.execute_input": "2025-11-19T14:38:04.906190Z",
498+
"iopub.status.busy": "2025-11-19T14:38:04.906111Z",
499+
"iopub.status.idle": "2025-11-19T14:38:04.908096Z",
500+
"shell.execute_reply": "2025-11-19T14:38:04.907735Z",
501+
"shell.execute_reply.started": "2025-11-19T14:38:04.906183Z"
502+
}
503+
},
424504
"outputs": [],
425505
"source": [
426-
"def ValidDate(fmt=\"%Y-%m-%d %H:%M:%S\"):\n",
506+
"def valid_date(fmt=\"%Y-%m-%d %H:%M:%S\"):\n",
427507
" return lambda v: datetime.strptime(v, fmt)"
428508
]
429509
},
430510
{
431511
"cell_type": "code",
432512
"execution_count": 11,
433-
"metadata": {},
513+
"metadata": {
514+
"execution": {
515+
"iopub.execute_input": "2025-11-19T14:38:04.908692Z",
516+
"iopub.status.busy": "2025-11-19T14:38:04.908613Z",
517+
"iopub.status.idle": "2025-11-19T14:38:04.910537Z",
518+
"shell.execute_reply": "2025-11-19T14:38:04.910252Z",
519+
"shell.execute_reply.started": "2025-11-19T14:38:04.908685Z"
520+
}
521+
},
434522
"outputs": [],
435523
"source": [
436524
"schema = Schema(\n",
437525
" {\n",
438-
" Required(\"timestamp\"): All(ValidDate()),\n",
526+
" Required(\"timestamp\"): All(valid_date()),\n",
439527
" },\n",
440-
" extra=ALLOW_EXTRA,\n",
528+
" extra = ALLOW_EXTRA,\n",
441529
")"
442530
]
443531
},
444532
{
445533
"cell_type": "code",
446534
"execution_count": 12,
447-
"metadata": {},
535+
"metadata": {
536+
"execution": {
537+
"iopub.execute_input": "2025-11-19T14:38:04.910877Z",
538+
"iopub.status.busy": "2025-11-19T14:38:04.910813Z",
539+
"iopub.status.idle": "2025-11-19T14:38:04.916340Z",
540+
"shell.execute_reply": "2025-11-19T14:38:04.916070Z",
541+
"shell.execute_reply.started": "2025-11-19T14:38:04.910871Z"
542+
}
543+
},
448544
"outputs": [],
449545
"source": [
450546
"error_count = 0\n",
@@ -461,7 +557,15 @@
461557
{
462558
"cell_type": "code",
463559
"execution_count": 13,
464-
"metadata": {},
560+
"metadata": {
561+
"execution": {
562+
"iopub.execute_input": "2025-11-19T14:38:04.916766Z",
563+
"iopub.status.busy": "2025-11-19T14:38:04.916681Z",
564+
"iopub.status.idle": "2025-11-19T14:38:04.918735Z",
565+
"shell.execute_reply": "2025-11-19T14:38:04.918464Z",
566+
"shell.execute_reply.started": "2025-11-19T14:38:04.916759Z"
567+
}
568+
},
465569
"outputs": [
466570
{
467571
"data": {
@@ -488,10 +592,18 @@
488592
{
489593
"cell_type": "code",
490594
"execution_count": 14,
491-
"metadata": {},
595+
"metadata": {
596+
"execution": {
597+
"iopub.execute_input": "2025-11-19T14:38:04.919086Z",
598+
"iopub.status.busy": "2025-11-19T14:38:04.918980Z",
599+
"iopub.status.idle": "2025-11-19T14:38:04.920824Z",
600+
"shell.execute_reply": "2025-11-19T14:38:04.920624Z",
601+
"shell.execute_reply.started": "2025-11-19T14:38:04.919076Z"
602+
}
603+
},
492604
"outputs": [],
493605
"source": [
494-
"def ValidDate(fmt=\"%Y-%m-%d %H:%M:%S\"):\n",
606+
"def valid_date(fmt=\"%Y-%m-%d %H:%M:%S\"):\n",
495607
" def validation_func(v):\n",
496608
" try:\n",
497609
" assert datetime.strptime(v, fmt) <= datetime.now()\n",
@@ -504,21 +616,37 @@
504616
{
505617
"cell_type": "code",
506618
"execution_count": 15,
507-
"metadata": {},
619+
"metadata": {
620+
"execution": {
621+
"iopub.execute_input": "2025-11-19T14:38:04.921148Z",
622+
"iopub.status.busy": "2025-11-19T14:38:04.921074Z",
623+
"iopub.status.idle": "2025-11-19T14:38:04.922921Z",
624+
"shell.execute_reply": "2025-11-19T14:38:04.922717Z",
625+
"shell.execute_reply.started": "2025-11-19T14:38:04.921134Z"
626+
}
627+
},
508628
"outputs": [],
509629
"source": [
510630
"schema = Schema(\n",
511631
" {\n",
512-
" Required(\"timestamp\"): All(ValidDate()),\n",
632+
" Required(\"timestamp\"): All(valid_date()),\n",
513633
" },\n",
514-
" extra=ALLOW_EXTRA,\n",
634+
" extra = ALLOW_EXTRA,\n",
515635
")"
516636
]
517637
},
518638
{
519639
"cell_type": "code",
520640
"execution_count": 16,
521-
"metadata": {},
641+
"metadata": {
642+
"execution": {
643+
"iopub.execute_input": "2025-11-19T14:38:04.923638Z",
644+
"iopub.status.busy": "2025-11-19T14:38:04.923541Z",
645+
"iopub.status.idle": "2025-11-19T14:38:04.929434Z",
646+
"shell.execute_reply": "2025-11-19T14:38:04.929211Z",
647+
"shell.execute_reply.started": "2025-11-19T14:38:04.923631Z"
648+
}
649+
},
522650
"outputs": [],
523651
"source": [
524652
"error_count = 0\n",
@@ -535,7 +663,15 @@
535663
{
536664
"cell_type": "code",
537665
"execution_count": 17,
538-
"metadata": {},
666+
"metadata": {
667+
"execution": {
668+
"iopub.execute_input": "2025-11-19T14:38:04.929922Z",
669+
"iopub.status.busy": "2025-11-19T14:38:04.929829Z",
670+
"iopub.status.idle": "2025-11-19T14:38:04.932315Z",
671+
"shell.execute_reply": "2025-11-19T14:38:04.932040Z",
672+
"shell.execute_reply.started": "2025-11-19T14:38:04.929914Z"
673+
}
674+
},
539675
"outputs": [
540676
{
541677
"data": {

0 commit comments

Comments
 (0)