Skip to content

Commit

Permalink
Add __lt__ to FilePointer to allow for sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
elinscott committed Oct 4, 2024
1 parent f1323e5 commit e29cff7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/koopmans/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def __gt__(self, other):
raise TypeError(f'Cannot compare FilePointer with {type(other)}')
return self.aspath() > other.aspath()

def __lt__(self, other):
return not self > other


class ParentPlaceholder(HasDirectory):
# Placeholder parent for FilePointers that don't have a Workflow/Process/Calculator as a parent
Expand Down

0 comments on commit e29cff7

Please sign in to comment.