diff --git a/src/velofy/db/forecasts.py b/src/velofy/db/forecasts.py index a7246ef..6981aae 100644 --- a/src/velofy/db/forecasts.py +++ b/src/velofy/db/forecasts.py @@ -184,8 +184,9 @@ class Forecast(meta.Base): def __repr__(self) -> str: """Non-literal text representation.""" cls = self.__class__.__name__ - pixel = f"({self.pixel.n_x}|{self.pixel.n_y})" - return f"<{cls}: {self.prediction} for pixel {pixel} at {self.start_at}>" + return ( + f"<{cls}: {self.prediction} for pixel #{self.pixel_id} at {self.start_at}>" + ) @classmethod def from_dataframe( diff --git a/src/velofy/db/replay/orders.py b/src/velofy/db/replay/orders.py index b59d706..708f3e9 100644 --- a/src/velofy/db/replay/orders.py +++ b/src/velofy/db/replay/orders.py @@ -411,7 +411,7 @@ class ReplayedOrder(meta.Base): def __repr__(self) -> str: """Non-literal text representation.""" - return f"<{self.__class__.__name__}(#{self.actual.id})>" + return f"<{self.__class__.__name__}(#{self.actual_order_id})>" # Convenience properties diff --git a/src/velofy/db/replay/simulations.py b/src/velofy/db/replay/simulations.py index 883e8a6..50b93c3 100644 --- a/src/velofy/db/replay/simulations.py +++ b/src/velofy/db/replay/simulations.py @@ -63,4 +63,4 @@ class ReplaySimulation(meta.Base): def __repr__(self) -> str: """Non-literal text representation.""" cls = self.__class__.__name__ - return f"<{cls}({self.strategy} #{self.run} in {self.city.name})>" + return f"<{cls}({self.strategy} #{self.run} in city #{self.city_id})>" diff --git a/tests/db/replay/test_orders.py b/tests/db/replay/test_orders.py index 8d347f2..967ae0b 100644 --- a/tests/db/replay/test_orders.py +++ b/tests/db/replay/test_orders.py @@ -21,7 +21,7 @@ class TestSpecialMethods: """`ReplayedOrder` has a non-literal text representation.""" result = repr(replayed_order) - assert result == f"" + assert result == f"" @pytest.mark.db diff --git a/tests/db/replay/test_simulations.py b/tests/db/replay/test_simulations.py index ee97549..f03296f 100644 --- a/tests/db/replay/test_simulations.py +++ b/tests/db/replay/test_simulations.py @@ -13,5 +13,5 @@ class TestSpecialMethods: result = repr(simulation) assert result.startswith("" # noqa:E501 + == f"" # noqa:E501 )