From 977898d6348c2564b5f838048ca0021ad74b5b6d Mon Sep 17 00:00:00 2001 From: ljwoods2 Date: Thu, 28 Nov 2024 13:43:08 -0700 Subject: [PATCH] specify bytes --- imdclient/IMDClient.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/imdclient/IMDClient.py b/imdclient/IMDClient.py index 359f9d2..afe3552 100644 --- a/imdclient/IMDClient.py +++ b/imdclient/IMDClient.py @@ -42,7 +42,7 @@ class IMDClient: socket_bufsize : int, (optional) Size of the socket buffer in bytes. Default is to use the system default buffer_size : int (optional) - IMDFramebuffer will be filled with as many :class:`IMDFrame` fit in `buffer_size` [``10MB``] + IMDFramebuffer will be filled with as many :class:`IMDFrame` fit in `buffer_size` bytes [``10MB``] **kwargs : dict (optional) Additional keyword arguments to pass to the :class:`BaseIMDProducer` and :class:`IMDFrameBuffer` """ @@ -146,9 +146,7 @@ def _connect_to_server(self, host, port, socket_bufsize): # /proc/sys/net/core/rmem_default # Max (linux): # /proc/sys/net/core/rmem_max - conn.setsockopt( - socket.SOL_SOCKET, socket.SO_RCVBUF, socket_bufsize - ) + conn.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, socket_bufsize) try: logger.debug(f"IMDClient: Connecting to {host}:{port}") conn.connect((host, port)) @@ -682,9 +680,7 @@ def __init__( raise ValueError("pause_empty_proportion must be between 0 and 1") self._pause_empty_proportion = pause_empty_proportion if unpause_empty_proportion < 0 or unpause_empty_proportion > 1: - raise ValueError( - "unpause_empty_proportion must be between 0 and 1" - ) + raise ValueError("unpause_empty_proportion must be between 0 and 1") self._unpause_empty_proportion = unpause_empty_proportion if buffer_size <= 0: @@ -751,9 +747,7 @@ def wait_for_space(self): logger.debug("IMDProducer: Noticing consumer finished") raise EOFError except Exception as e: - logger.debug( - f"IMDProducer: Error waiting for space in buffer: {e}" - ) + logger.debug(f"IMDProducer: Error waiting for space in buffer: {e}") def pop_empty_imdframe(self): logger.debug("IMDProducer: Getting empty frame") @@ -799,9 +793,7 @@ def pop_full_imdframe(self): imdf = self._full_q.get() else: with self._full_imdf_avail: - while ( - self._full_q.qsize() == 0 and not self._producer_finished - ): + while self._full_q.qsize() == 0 and not self._producer_finished: self._full_imdf_avail.wait() if self._producer_finished and self._full_q.qsize() == 0: