Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert time_updated changes #773

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
+++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'")

Expand Down
2 changes: 1 addition & 1 deletion flumine/__version__.py
Original file line number Diff line number Diff line change
@@ -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"
13 changes: 0 additions & 13 deletions flumine/streams/datastream.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down
3 changes: 0 additions & 3 deletions tests/test_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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):
Expand Down
Loading