Skip to content

Commit

Permalink
chore: ruff & PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Croydon-Brixton authored Dec 10, 2024
1 parent 13252f5 commit 7ff00ed
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/biotite/structure/atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def _del_element(self, index):
else:
raise TypeError(f"Index must be integer, not '{type(index).__name__}'")

def equal_annotations(self, item, equal_nan: bool = True):
def equal_annotations(self, item, equal_nan=True):
"""
Check, if this object shares equal annotation arrays with the
given :class:`AtomArray` or :class:`AtomArrayStack`.
Expand All @@ -255,8 +255,13 @@ def equal_annotations(self, item, equal_nan: bool = True):
if not self.equal_annotation_categories(item):
return False
for name in self._annot:
# ... allowing `nan` values causes type-casting, which is only possible for floating-point arrays
allow_nan = equal_nan if np.issubdtype(self._annot[name].dtype, np.floating) else False
# ... allowing `nan` values causes type-casting, which is
# only possible for floating-point arrays
allow_nan = (
equal_nan
if np.issubdtype(self._annot[name].dtype, np.floating)
else False
)
if not np.array_equal(
self._annot[name],
item._annot[name],
Expand Down

0 comments on commit 7ff00ed

Please sign in to comment.