Skip to content

Commit

Permalink
Merge pull request #251 from OpenBioSim/fix_250
Browse files Browse the repository at this point in the history
Improve error mesage when attempting to extract all dummy selection.
  • Loading branch information
lohedges authored Feb 29, 2024
2 parents 848e90c + 6e106dd commit 6414428
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,11 @@ def _extractMolecule(self, property_map={}, is_lambda1=False):
try:
search_result = mol.search(query, property_map)
except:
search_result = []
msg = "All atoms in the selection are dummies. Unable to extract."
if _isVerbose():
raise _IncompatibleError(msg) from e
else:
raise _IncompatibleError(msg) from None

# If there are no dummies, then simply return this molecule.
if len(search_result) == mol.nAtoms():
Expand Down
6 changes: 5 additions & 1 deletion python/BioSimSpace/_SireWrappers/_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,11 @@ def _extractMolecule(self, property_map={}, is_lambda1=False):
try:
search_result = mol.search(query, property_map)
except:
search_result = []
msg = "All atoms in the selection are dummies. Unable to extract."
if _isVerbose():
raise _IncompatibleError(msg) from e
else:
raise _IncompatibleError(msg) from None

# If there are no dummies, then simply return this molecule.
if len(search_result) == mol.nAtoms():
Expand Down

0 comments on commit 6414428

Please sign in to comment.