diff --git a/HISTORY.rst b/HISTORY.rst index 592d063b..ca7a1a5b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,14 @@ Release History --------------- +2.6.7 (2024-11-01) ++++++++++++++++++++ + +**Improvements** + +- Revert `time_updated` changes +- docs fixed + 2.6.6 (2024-10-31) +++++++++++++++++++ diff --git a/docs/index.md b/docs/index.md index 483638d8..31c96b3f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -68,7 +68,7 @@ from betfairlightweight.resources import MarketBook class ExampleStrategy(BaseStrategy): - def start(self) -> None: + def start(self, flumine) -> None: print("starting strategy 'ExampleStrategy'") def check_market_book(self, market: Market, market_book: MarketBook) -> bool: diff --git a/docs/quickstart.md b/docs/quickstart.md index 03489e9a..d9b5fad1 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -27,7 +27,7 @@ from flumine import BaseStrategy class ExampleStrategy(BaseStrategy): - def start(self): + def start(self, flumine): # subscribe to streams print("starting strategy 'ExampleStrategy'") diff --git a/flumine/__version__.py b/flumine/__version__.py index 186823d0..761a8b11 100644 --- a/flumine/__version__.py +++ b/flumine/__version__.py @@ -1,6 +1,6 @@ __title__ = "flumine" __description__ = "Betting trading framework" __url__ = "https://github.com/betcode-org/flumine" -__version__ = "2.6.6" +__version__ = "2.6.7" __author__ = "Liam Pauling" __license__ = "MIT" diff --git a/flumine/streams/datastream.py b/flumine/streams/datastream.py index ba8f2074..5417f3d1 100644 --- a/flumine/streams/datastream.py +++ b/flumine/streams/datastream.py @@ -3,7 +3,6 @@ from tenacity import retry from betfairlightweight import StreamListener, filters, BetfairError from betfairlightweight.streaming.stream import BaseStream as BFBaseStream -from betfairlightweight.utils import utcnow from .basestream import BaseStream from ..events.events import RawDataEvent @@ -36,14 +35,6 @@ def on_process(self, caches: list, publish_time: Optional[int] = None) -> None: output = RawDataEvent(caches) self.output_queue.put(output) - def _update_clk(self, data: dict) -> None: - (initial_clk, clk) = (data.get("initialClk"), data.get("clk")) - if initial_clk: - self._initial_clk = initial_clk - if clk: - self._clk = clk - # remove time_updated - def __str__(self): return "FlumineStream" @@ -81,7 +72,6 @@ def _process(self, data: list, publish_time: int) -> bool: ) self._updates_processed += 1 - self.time_updated = utcnow() self.on_process([self.unique_id, self._clk, publish_time, data]) return False @@ -103,7 +93,6 @@ def _process(self, data: list, publish_time: int) -> bool: ) self._updates_processed += 1 - self.time_updated = utcnow() self.on_process([self.unique_id, self._clk, publish_time, data]) return False @@ -125,7 +114,6 @@ def _process(self, data: list, publish_time: int) -> bool: ) self._updates_processed += 1 - self.time_updated = utcnow() self.on_process([self.unique_id, self._clk, publish_time, data]) return False @@ -147,7 +135,6 @@ def _process(self, data: list, publish_time: int) -> bool: ) self._updates_processed += 1 - self.time_updated = utcnow() self.on_process([self.unique_id, self._clk, publish_time, data]) return False diff --git a/tests/test_streams.py b/tests/test_streams.py index ee36b7b2..dd70a025 100644 --- a/tests/test_streams.py +++ b/tests/test_streams.py @@ -778,7 +778,6 @@ def test__process(self, mock_cache): self.stream._cumulative_runner_tv, ) mock_cache().update_cache.assert_called_with(update[0], 12345, active=True) - self.assertIsNotNone(self.stream.time_updated) @mock.patch("flumine.streams.historicalstream.MarketBookCache") def test__process_inplay(self, mock_cache): @@ -995,7 +994,6 @@ def test__process(self, mock_create_time): self.assertEqual(self.stream._updates_processed, 1) self.assertTrue(self.stream._caches["1.23"].inplay) mock_create_time.assert_called_with(11111111111111, "13.10") - self.assertIsNotNone(self.stream.time_updated) @mock.patch( "flumine.streams.historicalstream.create_time", @@ -1044,7 +1042,6 @@ def test__process(self): ) self.assertEqual(len(self.stream._caches), 1) self.assertEqual(self.stream._updates_processed, 1) - self.assertIsNotNone(self.stream.time_updated) class TestHistoricListener(unittest.TestCase):