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 23, 2024
1 parent 3cec39f commit f0e200f
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 28 deletions.
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": "1e89da9f146c4d0fb4667d405f7e5b5c",
"model_id": "fc8b56fda4bd48509a680626ea2ad898",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -93,23 +93,6 @@
"id": "a3d5ed12-0081-4c28-8078-5ce59947a1a8",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[autoreload of molsysmt.element.group.amino_acid.get_bonded_atom_pairs failed: Traceback (most recent call last):\n",
" File \"/conda/miniconda3/envs/MolSysMT@uibcdf_3.12/lib/python3.12/site-packages/IPython/extensions/autoreload.py\", line 276, in check\n",
" superreload(m, reload, self.old_objects)\n",
" File \"/conda/miniconda3/envs/MolSysMT@uibcdf_3.12/lib/python3.12/site-packages/IPython/extensions/autoreload.py\", line 500, in superreload\n",
" update_generic(old_obj, new_obj)\n",
" File \"/conda/miniconda3/envs/MolSysMT@uibcdf_3.12/lib/python3.12/site-packages/IPython/extensions/autoreload.py\", line 397, in update_generic\n",
" update(a, b)\n",
" File \"/conda/miniconda3/envs/MolSysMT@uibcdf_3.12/lib/python3.12/site-packages/IPython/extensions/autoreload.py\", line 309, in update_function\n",
" setattr(old, name, getattr(new, name))\n",
"ValueError: get_bonded_atom_pairs() requires a code object with 0 free vars, not 2\n",
"]\n"
]
},
{
"data": {
"text/plain": [
Expand Down Expand Up @@ -176,14 +159,6 @@
"atom_indices = list(range(10, 10+len(atom_names)))\n",
"msm.element.group.amino_acid.get_bonded_atom_pairs('VAL', atom_names, atom_indices=atom_indices)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ec9d2016-b9ae-4f7d-bfdc-5808f3d85d0b",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion molsysmt/_private/digestion/argument/bonded_atom_pairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def digest_bonded_atom_pairs(bonded_atom_pairs, caller=None):
for sublist in bonded_atom_pairs:
if not (isinstance(sublist, list) and len(sublist) == 2):
raise ArgumentError('bonded_atom_pairs', value=bonded_atom_pairs, caller=caller, message=None)
if not all(isinstance(item, int) for item in sublist):
if not all(isinstance(item, (int, np.integer)) for item in sublist):
print('aa')
raise ArgumentError('bonded_atom_pairs', value=bonded_atom_pairs, caller=caller, message=None)
return np.array(bonded_atom_pairs)
Expand Down
1 change: 0 additions & 1 deletion molsysmt/build/add_missing_bonds.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def add_missing_bonds(molecular_system, threshold='2 angstroms', selection='all'
bonds = get_missing_bonds(molecular_system, threshold=threshold, selection=selection,
structure_index=structure_index, syntax=syntax,
skip_digestion=True)

return add_bonds(molecular_system, bonds, in_place=in_place, skip_digestion=True)

else:
Expand Down
File renamed without changes.

0 comments on commit f0e200f

Please sign in to comment.