Skip to content

Commit

Permalink
check anisous type and len before concat
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmkrieger committed Nov 3, 2023
1 parent de369b1 commit 38e7f9d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions prody/atomic/atomgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,12 @@ def __add__(self, other):
if self._n_csets:
if self._n_csets == other._n_csets:
new.setCoords(np.concatenate((self._coords, other._coords), 1))
if self._anisous is not None and other._anisous is not None:
new.setAnisous(np.concatenate((self._anisous, other._anisous), 1))
this = self._anisous
that = other._anisous
if this is not None and that is not None:
if (isinstance(this, np.ndarray) and isinstance(that, np.ndarray)
and len(this) > 0 and len(that) > 0):
new.setAnisous(np.concatenate((self._anisous, other._anisous), 1))
if self._n_csets > 1:
LOGGER.info('All {0} coordinate sets are copied to '
'{1}.'.format(self._n_csets, new.getTitle()))
Expand Down

0 comments on commit 38e7f9d

Please sign in to comment.