-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
375 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "3908cf62-3a4c-4c82-a061-e78f6f2f7097", | ||
"metadata": { | ||
"tags": [ | ||
"remove-input" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"# This cell is removed with the tag: \"remove-input\"\n", | ||
"# As such, it will not be shown in documentation\n", | ||
"\n", | ||
"#import warnings\n", | ||
"#warnings.filterwarnings('ignore')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "034d6a12-81b5-40fe-89a7-59046d378078", | ||
"metadata": {}, | ||
"source": [ | ||
"(Tutorial_Add_bonds)=\n", | ||
"# Add bonds\n", | ||
"\n", | ||
"To be written..." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "19c12010-9573-490a-89fa-f899756609d7", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "804fe4f2f91b418fbaecbfd991719a56", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
}, | ||
"text/plain": [] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"import molsysmt as msm" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "7ebdbcb9-f241-472a-9a5e-63066fbb064b", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"molsys = msm.systems['alanine dipeptide']['alanine_dipeptide.h5msm']" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "623d0cf1-e54f-438e-a7f5-fdab6e56d8af", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"molsys = msm.convert(molsys)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"id": "ec89fe3d-b83c-495b-bc29-c1c1b3f58408", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"msm.build.remove_bonds(molsys)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"id": "5357ae81-d988-48a5-9e5e-d61ce63a0dba", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"0" | ||
] | ||
}, | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"msm.get(molsys, n_bonds=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"id": "4ed0846f-048c-4184-96a1-07b649dcd9cf", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"msm.build.add_bonds(molsys, bonded_atom_pairs=[[0,1], [0,2], [1,4]])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"id": "03abc0cd-29aa-45ac-9da3-bf470bd2d37f", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"3" | ||
] | ||
}, | ||
"execution_count": 8, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"msm.get(molsys, n_bonds=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 9, | ||
"id": "1aa4d0b4-7985-43c1-a41b-d87870271e17", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"bonded_atom_pairs = msm.get(molsys, bonded_atom_pairs=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 13, | ||
"id": "1fa3f835-6ebc-4a17-b021-e1f4ed392785", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"True" | ||
] | ||
}, | ||
"execution_count": 13, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"bonded_atom_pairs == [[0,1], [0,2], [1,4]]" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "ec17414f-e734-49a7-84e0-3fcde8284f4c", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.9" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
Unit and regression test for the is solvate module of the molsysmt package on molsysmt MolSys molecular | ||
systems. | ||
""" | ||
|
||
# Import package, test suite, and other packages as needed | ||
import pytest | ||
import molsysmt as msm | ||
from molsysmt import systems | ||
import numpy as np | ||
|
||
|
||
def test_add_bonds_molsysmt_MolSys_1(): | ||
|
||
molsys = msm.systems['alanine dipeptide']['alanine_dipeptide.h5msm'] | ||
molsys = msm.convert(molsys) | ||
msm.build.remove_bonds(molsys) | ||
msm.build.add_bonds(molsys, bonded_atom_pairs=[[0,1], [0,2], [1,4]]) | ||
n_bonds, bonded_atom_pairs = msm.get(molsys, n_bonds=True, bonded_atom_pairs=True) | ||
|
||
assert n_bonds==3 | ||
assert bonded_atom_pairs==[[0,1], [0,2], [1,4]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.