Skip to content

Commit

Permalink
add __repr__ for DataGranules
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaS11 committed Dec 14, 2024
1 parent b0c5cd0 commit 521b359
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions earthaccess/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,9 @@ def __eq__(self, other: 'DataGranules') -> bool:
return self.granules == other.granules

# TODO: display methods
def __repr__(self) -> str:
reprs = ", ".join([granule.__repr__() for granule in self.granules])
return f'DataGranules([{reprs}])'
def __repr__(self):

if (count := len(self)) > 0:
return f'DataGranules().parameters({self.params}).load({count})'

return f'DataGranules().parameters({self.params})'

0 comments on commit 521b359

Please sign in to comment.