From 4a012d18505267e3b714d02b665131a39eb262ad Mon Sep 17 00:00:00 2001 From: Gully Date: Fri, 16 Sep 2016 13:46:47 +0530 Subject: [PATCH] Changing the return structure of the tickData from array to dictionary For efficient handling of the tickdata --- kiteconnect/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kiteconnect/__init__.py b/kiteconnect/__init__.py index 65f100db..3a4fbf32 100644 --- a/kiteconnect/__init__.py +++ b/kiteconnect/__init__.py @@ -833,7 +833,7 @@ def _on_message(self, ws, message): def _parse_binary(self, bin): """Parse binary data to a (list of) ticks structure.""" packets = self._split_packets(bin) # split data to individual ticks packet - data = [] + data = {} for packet in packets: instrument_token = self._unpack_int(packet, 0, 4) @@ -916,7 +916,7 @@ def _parse_binary(self, bin): }) d["depth"] = depth - data.append(d) + data[instrument_token]=d return data