Skip to content

Commit

Permalink
Better MultiTileStore representation
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Dec 18, 2024
1 parent ec8e168 commit b725191
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tilecloud_chain/multitilestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ def apply(key: tuple[str, str], tiles: Iterator[Tile]) -> Iterator[Tile]:

return chain.from_iterable(starmap(apply, groupby(tiles, self._get_layer)))

def __str__(self) -> str:
"""Return a string representation of the object."""
stores = {store.__class__.__name__ for store in self.stores.values() if store is not None}
return f"{self.__class__.__name__}({', '.join(stores)})"

def __repr__(self) -> str:
"""Return a string representation of the object."""
return str(self)

@staticmethod
def _get_layer(tile: Tile | None) -> tuple[str, str]:
assert tile is not None
Expand Down

0 comments on commit b725191

Please sign in to comment.