Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cbouy committed Dec 23, 2024
1 parent 02061c0 commit aaede6c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions prolif/residue.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ def __eq__(self, other):

def __lt__(self, other):
def chain_key(chain):
# Handles the case where the two chains are of different types (e.g., None and str)
# Handles the case where the two chains are of different types
# e.g., None from WAT123, and str from ALA42.A
return (chain is not None, chain)

return (chain_key(self.chain), self.number) < (chain_key(other.chain), other.number)

return (chain_key(self.chain), self.number) < (
chain_key(other.chain),
other.number,
)

@classmethod
def from_atom(cls, atom):
Expand Down

0 comments on commit aaede6c

Please sign in to comment.