Skip to content

Commit 521b359

Browse files
committed
add __repr__ for DataGranules
1 parent b0c5cd0 commit 521b359

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

earthaccess/search.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,9 @@ def __eq__(self, other: 'DataGranules') -> bool:
980980
return self.granules == other.granules
981981

982982
# TODO: display methods
983-
def __repr__(self) -> str:
984-
reprs = ", ".join([granule.__repr__() for granule in self.granules])
985-
return f'DataGranules([{reprs}])'
983+
def __repr__(self):
984+
985+
if (count := len(self)) > 0:
986+
return f'DataGranules().parameters({self.params}).load({count})'
987+
988+
return f'DataGranules().parameters({self.params})'

0 commit comments

Comments
 (0)