Skip to content

Commit 8ee9cd4

Browse files
committed
add cleanup cell for demo notebook
1 parent 98dd2f7 commit 8ee9cd4

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

demo.ipynb

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,6 @@
376376
"# Make a temporary download directory in your current working directory\n",
377377
"cwd = os.getcwd()\n",
378378
"dl_dir = os.path.join(cwd, 'tmp_dl_dir')\n",
379-
"# Make sure to use a new directory\n",
380-
"while os.path.exists(dl_dir):\n",
381-
" dl_dir = dl_dir+'1'\n",
382379
"\n",
383380
"# Download all the WFDB content\n",
384381
"wfdb.dl_database('ahadb', dl_dir=dl_dir)\n",
@@ -525,6 +522,34 @@
525522
"comparitor.plot(title='xqrs detected qrs vs reference annotations')"
526523
]
527524
},
525+
{
526+
"cell_type": "code",
527+
"execution_count": null,
528+
"metadata": {},
529+
"outputs": [],
530+
"source": []
531+
},
532+
{
533+
"cell_type": "code",
534+
"execution_count": null,
535+
"metadata": {},
536+
"outputs": [],
537+
"source": [
538+
"# Cleanup for all demos\n",
539+
"for file in ['100x.hea', '100.dat', # demo 10\n",
540+
" 'ecg-record.hea', 'ecg-record.dat', # demo 11 \n",
541+
" 'test01_00s_framex.hea', 'test01_00s.dat', # demo 12\n",
542+
" '100.cpy', # demo 13\n",
543+
" 'b001.cpy', # demo 14\n",
544+
" ]:\n",
545+
" if os.path.isfile(file):\n",
546+
" os.remove(file)\n",
547+
"\n",
548+
"dl_dir = os.path.join(cwd, 'tmp_dl_dir') # demo 17, 18\n",
549+
"if os.path.isdir(dl_dir):\n",
550+
" shutil.rmtree(dl_dir)"
551+
]
552+
},
528553
{
529554
"cell_type": "code",
530555
"execution_count": null,

0 commit comments

Comments
 (0)