Skip to content

Commit

Permalink
Some tests added
Browse files Browse the repository at this point in the history
  • Loading branch information
dprada committed Dec 21, 2024
1 parent 8642b10 commit 03f8129
Show file tree
Hide file tree
Showing 7 changed files with 227 additions and 147 deletions.
124 changes: 83 additions & 41 deletions docs/contents/user/tools/structure/align_principal_axes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "54b3043c3363436e8c477185c720171e",
"model_id": "20f49781ec7f44b395bf402cf46c3308",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -76,37 +76,37 @@
"text/html": [
"<style type=\"text/css\">\n",
"</style>\n",
"<table id=\"T_ae249\">\n",
"<table id=\"T_1ef9c\">\n",
" <thead>\n",
" <tr>\n",
" <th id=\"T_ae249_level0_col0\" class=\"col_heading level0 col0\" >form</th>\n",
" <th id=\"T_ae249_level0_col1\" class=\"col_heading level0 col1\" >n_atoms</th>\n",
" <th id=\"T_ae249_level0_col2\" class=\"col_heading level0 col2\" >n_groups</th>\n",
" <th id=\"T_ae249_level0_col3\" class=\"col_heading level0 col3\" >n_components</th>\n",
" <th id=\"T_ae249_level0_col4\" class=\"col_heading level0 col4\" >n_chains</th>\n",
" <th id=\"T_ae249_level0_col5\" class=\"col_heading level0 col5\" >n_molecules</th>\n",
" <th id=\"T_ae249_level0_col6\" class=\"col_heading level0 col6\" >n_entities</th>\n",
" <th id=\"T_ae249_level0_col7\" class=\"col_heading level0 col7\" >n_lipids</th>\n",
" <th id=\"T_ae249_level0_col8\" class=\"col_heading level0 col8\" >n_structures</th>\n",
" <th id=\"T_1ef9c_level0_col0\" class=\"col_heading level0 col0\" >form</th>\n",
" <th id=\"T_1ef9c_level0_col1\" class=\"col_heading level0 col1\" >n_atoms</th>\n",
" <th id=\"T_1ef9c_level0_col2\" class=\"col_heading level0 col2\" >n_groups</th>\n",
" <th id=\"T_1ef9c_level0_col3\" class=\"col_heading level0 col3\" >n_components</th>\n",
" <th id=\"T_1ef9c_level0_col4\" class=\"col_heading level0 col4\" >n_chains</th>\n",
" <th id=\"T_1ef9c_level0_col5\" class=\"col_heading level0 col5\" >n_molecules</th>\n",
" <th id=\"T_1ef9c_level0_col6\" class=\"col_heading level0 col6\" >n_entities</th>\n",
" <th id=\"T_1ef9c_level0_col7\" class=\"col_heading level0 col7\" >n_lipids</th>\n",
" <th id=\"T_1ef9c_level0_col8\" class=\"col_heading level0 col8\" >n_structures</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td id=\"T_ae249_row0_col0\" class=\"data row0 col0\" >molsysmt.MolSys</td>\n",
" <td id=\"T_ae249_row0_col1\" class=\"data row0 col1\" >134</td>\n",
" <td id=\"T_ae249_row0_col2\" class=\"data row0 col2\" >1</td>\n",
" <td id=\"T_ae249_row0_col3\" class=\"data row0 col3\" >1</td>\n",
" <td id=\"T_ae249_row0_col4\" class=\"data row0 col4\" >1</td>\n",
" <td id=\"T_ae249_row0_col5\" class=\"data row0 col5\" >1</td>\n",
" <td id=\"T_ae249_row0_col6\" class=\"data row0 col6\" >1</td>\n",
" <td id=\"T_ae249_row0_col7\" class=\"data row0 col7\" >1</td>\n",
" <td id=\"T_ae249_row0_col8\" class=\"data row0 col8\" >1</td>\n",
" <td id=\"T_1ef9c_row0_col0\" class=\"data row0 col0\" >molsysmt.MolSys</td>\n",
" <td id=\"T_1ef9c_row0_col1\" class=\"data row0 col1\" >134</td>\n",
" <td id=\"T_1ef9c_row0_col2\" class=\"data row0 col2\" >1</td>\n",
" <td id=\"T_1ef9c_row0_col3\" class=\"data row0 col3\" >1</td>\n",
" <td id=\"T_1ef9c_row0_col4\" class=\"data row0 col4\" >1</td>\n",
" <td id=\"T_1ef9c_row0_col5\" class=\"data row0 col5\" >1</td>\n",
" <td id=\"T_1ef9c_row0_col6\" class=\"data row0 col6\" >1</td>\n",
" <td id=\"T_1ef9c_row0_col7\" class=\"data row0 col7\" >1</td>\n",
" <td id=\"T_1ef9c_row0_col8\" class=\"data row0 col8\" >1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n"
],
"text/plain": [
"<pandas.io.formats.style.Styler at 0x7bc414a348d0>"
"<pandas.io.formats.style.Styler at 0x77e2b33c1650>"
]
},
"execution_count": 5,
Expand All @@ -130,28 +130,53 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"id": "922d611e-686b-46f3-a603-bed5a9adffb4",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 0.09213962 -0.02624376 -0.9954002 ] 13.378581090770417\n",
"[0.56239734 0.82631277 0.03027277] 73.67866342245162\n",
"[-0.82171742 0.56259975 -0.09089556] 78.32952437971095\n"
]
}
],
"source": [
"for ii in range(3):\n",
" print(axes[0,ii], momenta[0,ii])"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"id": "095cb193-a067-4940-8a4d-2c0ca5d34d80",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "084c007ef8544482935ea4edc6e29bca",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"NGLWidget()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"msm.view(molsys)"
"msm.view(molsys, standard=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"id": "b46c0c26-d4be-41a5-a9fb-c9b97dd5bad2",
"metadata": {},
"outputs": [],
Expand All @@ -161,7 +186,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"id": "5d29c2f5-b9ab-494e-bf26-a71de19c00c2",
"metadata": {},
"outputs": [],
Expand All @@ -171,32 +196,49 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"id": "2f4e8bdb-7f79-4c72-883b-536f7ba02ee0",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[1.00000000e+00 2.87221485e-16 8.58936055e-17] 13.37858109077042\n",
"[-2.87221485e-16 1.00000000e+00 -3.60822483e-15] 73.67866342245169\n",
"[-8.58936055e-17 3.60822483e-15 1.00000000e+00] 78.32952437971095\n"
]
}
],
"source": [
"for ii in range(3):\n",
" print(axes[0,ii], momenta[0,ii])"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"id": "40ec81fa-54be-4eee-8073-d7f07af8beaf",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2e4a5ff4b81b407ca312515e6a7d0d36",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"NGLWidget()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"msm.view(molsys_2)"
"msm.view(molsys_2, standard=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "485d758d-833b-425f-ad77-552d37ad421e",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
81 changes: 44 additions & 37 deletions docs/contents/user/tools/structure/flip.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6dbe2e2188ea41f2b7f3e349cbbb88bc",
"model_id": "24a76bc0966a4df2adfad995994c1946",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -42,7 +42,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -53,52 +53,52 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<style type=\"text/css\">\n",
"</style>\n",
"<table id=\"T_d015b\">\n",
"<table id=\"T_d2197\">\n",
" <thead>\n",
" <tr>\n",
" <th id=\"T_d015b_level0_col0\" class=\"col_heading level0 col0\" >index</th>\n",
" <th id=\"T_d015b_level0_col1\" class=\"col_heading level0 col1\" >id</th>\n",
" <th id=\"T_d015b_level0_col2\" class=\"col_heading level0 col2\" >name</th>\n",
" <th id=\"T_d015b_level0_col3\" class=\"col_heading level0 col3\" >type</th>\n",
" <th id=\"T_d015b_level0_col4\" class=\"col_heading level0 col4\" >n atoms</th>\n",
" <th id=\"T_d015b_level0_col5\" class=\"col_heading level0 col5\" >component index</th>\n",
" <th id=\"T_d015b_level0_col6\" class=\"col_heading level0 col6\" >chain index</th>\n",
" <th id=\"T_d015b_level0_col7\" class=\"col_heading level0 col7\" >molecule index</th>\n",
" <th id=\"T_d015b_level0_col8\" class=\"col_heading level0 col8\" >molecule type</th>\n",
" <th id=\"T_d015b_level0_col9\" class=\"col_heading level0 col9\" >entity index</th>\n",
" <th id=\"T_d015b_level0_col10\" class=\"col_heading level0 col10\" >entity name</th>\n",
" <th id=\"T_d2197_level0_col0\" class=\"col_heading level0 col0\" >index</th>\n",
" <th id=\"T_d2197_level0_col1\" class=\"col_heading level0 col1\" >id</th>\n",
" <th id=\"T_d2197_level0_col2\" class=\"col_heading level0 col2\" >name</th>\n",
" <th id=\"T_d2197_level0_col3\" class=\"col_heading level0 col3\" >type</th>\n",
" <th id=\"T_d2197_level0_col4\" class=\"col_heading level0 col4\" >n atoms</th>\n",
" <th id=\"T_d2197_level0_col5\" class=\"col_heading level0 col5\" >component index</th>\n",
" <th id=\"T_d2197_level0_col6\" class=\"col_heading level0 col6\" >chain index</th>\n",
" <th id=\"T_d2197_level0_col7\" class=\"col_heading level0 col7\" >molecule index</th>\n",
" <th id=\"T_d2197_level0_col8\" class=\"col_heading level0 col8\" >molecule type</th>\n",
" <th id=\"T_d2197_level0_col9\" class=\"col_heading level0 col9\" >entity index</th>\n",
" <th id=\"T_d2197_level0_col10\" class=\"col_heading level0 col10\" >entity name</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <td id=\"T_d015b_row0_col0\" class=\"data row0 col0\" >0</td>\n",
" <td id=\"T_d015b_row0_col1\" class=\"data row0 col1\" >1</td>\n",
" <td id=\"T_d015b_row0_col2\" class=\"data row0 col2\" >POPC</td>\n",
" <td id=\"T_d015b_row0_col3\" class=\"data row0 col3\" >lipid</td>\n",
" <td id=\"T_d015b_row0_col4\" class=\"data row0 col4\" >134</td>\n",
" <td id=\"T_d015b_row0_col5\" class=\"data row0 col5\" >0</td>\n",
" <td id=\"T_d015b_row0_col6\" class=\"data row0 col6\" >0</td>\n",
" <td id=\"T_d015b_row0_col7\" class=\"data row0 col7\" >0</td>\n",
" <td id=\"T_d015b_row0_col8\" class=\"data row0 col8\" >lipid</td>\n",
" <td id=\"T_d015b_row0_col9\" class=\"data row0 col9\" >0</td>\n",
" <td id=\"T_d015b_row0_col10\" class=\"data row0 col10\" >POPC</td>\n",
" <td id=\"T_d2197_row0_col0\" class=\"data row0 col0\" >0</td>\n",
" <td id=\"T_d2197_row0_col1\" class=\"data row0 col1\" >1</td>\n",
" <td id=\"T_d2197_row0_col2\" class=\"data row0 col2\" >POPC</td>\n",
" <td id=\"T_d2197_row0_col3\" class=\"data row0 col3\" >lipid</td>\n",
" <td id=\"T_d2197_row0_col4\" class=\"data row0 col4\" >134</td>\n",
" <td id=\"T_d2197_row0_col5\" class=\"data row0 col5\" >0</td>\n",
" <td id=\"T_d2197_row0_col6\" class=\"data row0 col6\" >0</td>\n",
" <td id=\"T_d2197_row0_col7\" class=\"data row0 col7\" >0</td>\n",
" <td id=\"T_d2197_row0_col8\" class=\"data row0 col8\" >lipid</td>\n",
" <td id=\"T_d2197_row0_col9\" class=\"data row0 col9\" >0</td>\n",
" <td id=\"T_d2197_row0_col10\" class=\"data row0 col10\" >POPC</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n"
],
"text/plain": [
"<pandas.io.formats.style.Styler at 0x7f5f340af280>"
"<pandas.io.formats.style.Styler at 0x7d9c46c7b310>"
]
},
"execution_count": 8,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -109,7 +109,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -119,7 +119,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand All @@ -131,10 +131,10 @@
"$arr[,0,:,:] = \\begin{pmatrix} & & \\end{pmatrix}\\ \\mathrm{nanometer}$"
],
"text/plain": [
"array([[[0., 0., 2.]]]) <Unit('nanometer')>"
"<Quantity([[[0. 0. 2.]]], 'nanometer')>"
]
},
"execution_count": 10,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -145,7 +145,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -154,7 +154,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand All @@ -166,17 +166,24 @@
"$arr[,0,:,:] = \\begin{pmatrix} & & \\end{pmatrix}\\ \\mathrm{nanometer}$"
],
"text/plain": [
"array([[[ 0., 0., -2.]]]) <Unit('nanometer')>"
"<Quantity([[[ 0. 0. -2.]]], 'nanometer')>"
]
},
"execution_count": 12,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"msm.get(molsys2, selection='atom_name==\"P\"', coordinates=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -195,7 +202,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
"version": "3.11.10"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 03f8129

Please sign in to comment.