Skip to content

Commit f8052fe

Browse files
committed
Cleaned example for clustering
1 parent 73b25c0 commit f8052fe

1 file changed

Lines changed: 14 additions & 39 deletions

File tree

docs/source/notebooks/04_cluster_extraction.ipynb

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@
322322
"dct = periodic_nearest_neighbors_by_atom(u, # Universe with all frames from which we want to extract clusters\n",
323323
" \"Rh\", # Source atom from which we will search for neighbors\n",
324324
" a, # Cubic cell dimension\n",
325-
" # Cluster sizes we want (increasing the number here doesn't change how long the function takes)\n",
325+
" # Cluster sizes we want\n",
326326
" [0, 1, 2, 3, 4, 8, 12, 16],\n",
327327
" # Additional arguments to be passed to the atomic two body calculation\n",
328328
" # Note that it is critical to increase dmax (in compute_atom_two)!!!\n",
@@ -451,39 +451,17 @@
451451
"metadata": {},
452452
"outputs": [],
453453
"source": [
454-
"exatomic.UniverseWidget(dct[8])"
455-
]
456-
},
457-
{
458-
"cell_type": "code",
459-
"execution_count": 18,
460-
"metadata": {},
461-
"outputs": [
462-
{
463-
"data": {
464-
"application/vnd.jupyter.widget-view+json": {
465-
"model_id": "a6affab55b674876b30baaca3aa1b092",
466-
"version_major": 2,
467-
"version_minor": 0
468-
},
469-
"text/plain": [
470-
"UniverseWidget(active_scene_indices=[0], children=(GUIBox(children=(Button(description=' Close', icon='trash',…"
471-
]
472-
},
473-
"metadata": {},
474-
"output_type": "display_data"
475-
}
476-
],
477-
"source": [
478-
"exatomic.UniverseWidget(dct[16])"
454+
"exatomic.UniverseWidget(dct[0]) # Just the analyte"
479455
]
480456
},
481457
{
482458
"cell_type": "code",
483459
"execution_count": null,
484460
"metadata": {},
485461
"outputs": [],
486-
"source": []
462+
"source": [
463+
"exatomic.UniverseWidget(dct[16]) # View the universe with 16 nearest molecules"
464+
]
487465
},
488466
{
489467
"cell_type": "markdown",
@@ -494,15 +472,15 @@
494472
},
495473
{
496474
"cell_type": "code",
497-
"execution_count": 8,
475+
"execution_count": 15,
498476
"metadata": {},
499477
"outputs": [
500478
{
501479
"name": "stdout",
502480
"output_type": "stream",
503481
"text": [
504-
"CPU times: user 20.9 s, sys: 3.75 s, total: 24.6 s\n",
505-
"Wall time: 24.9 s\n"
482+
"CPU times: user 3.17 s, sys: 281 ms, total: 3.45 s\n",
483+
"Wall time: 3.51 s\n"
506484
]
507485
}
508486
],
@@ -514,16 +492,16 @@
514492
},
515493
{
516494
"cell_type": "code",
517-
"execution_count": 9,
495+
"execution_count": 16,
518496
"metadata": {},
519497
"outputs": [
520498
{
521499
"data": {
522500
"text/plain": [
523-
"86.07053661346436"
501+
"10.53761100769043"
524502
]
525503
},
526-
"execution_count": 9,
504+
"execution_count": 16,
527505
"metadata": {},
528506
"output_type": "execute_result"
529507
}
@@ -532,17 +510,14 @@
532510
"u.memory_usage().sum()/1024**2 # RAM usage (MB)"
533511
]
534512
},
535-
{
536-
"cell_type": "markdown",
537-
"metadata": {},
538-
"source": []
539-
},
540513
{
541514
"cell_type": "code",
542515
"execution_count": null,
543516
"metadata": {},
544517
"outputs": [],
545-
"source": []
518+
"source": [
519+
"exatomic.UniverseWidget(u)"
520+
]
546521
},
547522
{
548523
"cell_type": "code",

0 commit comments

Comments
 (0)