From 9ef188519c1e2d8d17f1df85bc8a3338079f540d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Gr=C3=A9goire?= Date: Sun, 30 Nov 2025 12:35:56 -0500 Subject: [PATCH 1/3] Fixed a bad reference to current_lob in before_lob_update --- src/meatpy/market_processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meatpy/market_processor.py b/src/meatpy/market_processor.py index a923e78..05ad8ba 100644 --- a/src/meatpy/market_processor.py +++ b/src/meatpy/market_processor.py @@ -84,7 +84,7 @@ def before_lob_update(self, new_timestamp: Timestamp) -> None: new_timestamp: The new timestamp for the upcoming update """ for x in self.handlers: - x.before_lob_update(self.current_lob, new_timestamp) + x.before_lob_update(self, new_timestamp) def message_event(self, timestamp: Timestamp, message: MarketMessage) -> None: """Notify handlers of a raw message event. From 18052a5c4530025b6c6c6296a2eacea83fe79f25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Gr=C3=A9goire?= Date: Sun, 30 Nov 2025 12:45:17 -0500 Subject: [PATCH 2/3] Updated tests to reflect expected behavior --- tests/test_market_processor.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/test_market_processor.py b/tests/test_market_processor.py index 26f7d8b..8e2b82e 100644 --- a/tests/test_market_processor.py +++ b/tests/test_market_processor.py @@ -74,13 +74,17 @@ def setup_method(self): def test_before_lob_update(self): """Test before_lob_update method.""" self.processor.before_lob_update(self.timestamp) - self.handler.before_lob_update.assert_called_once_with(self.lob, self.timestamp) + self.handler.before_lob_update.assert_called_once_with( + self.processor, self.timestamp + ) def test_before_lob_update_with_no_lob(self): """Test before_lob_update method with no LOB.""" self.processor.current_lob = None self.processor.before_lob_update(self.timestamp) - self.handler.before_lob_update.assert_called_once_with(None, self.timestamp) + self.handler.before_lob_update.assert_called_once_with( + self.processor, self.timestamp + ) def test_message_event(self): """Test message_event method.""" @@ -224,12 +228,16 @@ def test_pre_lob_event(self): """Test pre_lob_event method.""" self.processor.pre_lob_event(self.timestamp) # This method should call before_lob_update on handlers - self.handler.before_lob_update.assert_called_once_with(self.lob, self.timestamp) + self.handler.before_lob_update.assert_called_once_with( + self.processor, self.timestamp + ) def test_pre_lob_event_with_new_snapshot(self): """Test pre_lob_event method with new snapshot flag.""" self.processor.pre_lob_event(self.timestamp, new_snapshot=True) - self.handler.before_lob_update.assert_called_once_with(self.lob, self.timestamp) + self.handler.before_lob_update.assert_called_once_with( + self.processor, self.timestamp + ) class TestMarketProcessorCleanup: From 7c0c641c029370620193fa344c73e413f0fa2ae1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 30 Nov 2025 17:47:24 +0000 Subject: [PATCH 3/3] chore: bump version to 0.2.8 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 67ae55a..0e9e8a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "meatpy" -version = "0.2.7" +version = "0.2.8" description = "Read and process limit order book data" authors = [ { name = "Vincent Grégoire", email = "vincent.gregoire@hec.ca" },