diff --git a/src/decentralizepy/communication/TCP.py b/src/decentralizepy/communication/TCP.py index ade6104366ef57a63058e2113740a296dc759144..8c754fd0c92530713331d47671e692623c7f3045 100644 --- a/src/decentralizepy/communication/TCP.py +++ b/src/decentralizepy/communication/TCP.py @@ -87,8 +87,7 @@ class TCP(Communication): def receive(self): if len(self.peer_deque) != 0: - resp = self.peer_deque[0] - self.peer_deque.popleft() + resp = self.peer_deque.popleft() return resp sender, recv = self.router.recv_multipart() diff --git a/src/decentralizepy/sharing/Sharing.py b/src/decentralizepy/sharing/Sharing.py index ed63f8579ca61abc63eee315e915ba63b5187da8..25167ff3cf3440565a6ac952e14a6ba240bdb2ef 100644 --- a/src/decentralizepy/sharing/Sharing.py +++ b/src/decentralizepy/sharing/Sharing.py @@ -137,7 +137,7 @@ class Sharing: for i, n in enumerate(self.peer_deques): degree, iteration, data = self.peer_deques[n].popleft() logging.debug( - "Averaging model from neighbor {} of iteration {}".format(i, iteration) + "Averaging model from neighbor {} of iteration {}".format(n, iteration) ) data = self.deserialized_model(data) weight = 1 / (max(len(self.peer_deques), degree) + 1) # Metro-Hastings