Repository: adap/flower

Issue:
Improve docstring for `start_keras_client`



Discussion:

Resolving patch:
diff --git a/src/py/flwr/client/app.py b/src/py/flwr/client/app.py
--- a/src/py/flwr/client/app.py
+++ b/src/py/flwr/client/app.py
@@ -32,7 +32,25 @@ def start_client(
     client: Client,
     grpc_max_message_length: int = GRPC_MAX_MESSAGE_LENGTH,
 ) -> None:
-    """Start a Flower Client which connects to a gRPC server."""
+    """Start a Flower Client which connects to a gRPC server.
+
+    Arguments:
+        server_address: str. The IPv6 address of the server. If the Flower
+            server runs on the same machine on port 8080, then `server_address`
+            would be `"[::]:8080"`.
+        client: flwr.client.Client. An implementation of the abstract base
+            class `flwr.client.Client`.
+        grpc_max_message_length: int (default: 536_870_912, this equals 512MB).
+            The maximum length of gRPC messages that can be exchanged with the
+            Flower server. The default should be sufficient for most models.
+            Users who train very large models might need to increase this
+            value. Note that the Flower server needs to started with the same
+            value (see `flwr.server.start_server`), otherwise it will not know
+            about the increased limit and block larger messages.
+
+    Returns:
+        None.
+    """
     while True:
         sleep_duration: int = 0
         with insecure_grpc_connection(
@@ -61,11 +79,37 @@ def start_client(
         time.sleep(sleep_duration)
 
 
-def start_keras_client(server_address: str, client: KerasClient) -> None:
-    """Start a Flower KerasClient which connects to a gRPC server."""
+def start_keras_client(
+    server_address: str,
+    client: KerasClient,
+    grpc_max_message_length: int = GRPC_MAX_MESSAGE_LENGTH,
+) -> None:
+    """Start a Flower KerasClient which connects to a gRPC server.
+
+    Arguments:
+        server_address: str. The IPv6 address of the server. If the Flower
+            server runs on the same machine on port 8080, then `server_address`
+            would be `"[::]:8080"`.
+        client: flwr.client.KerasClient. An implementation of the abstract base
+            class `flwr.client.KerasClient`.
+        grpc_max_message_length: int (default: 536_870_912, this equals 512MB).
+            The maximum length of gRPC messages that can be exchanged with the
+            Flower server. The default should be sufficient for most models.
+            Users who train very large models might need to increase this
+            value. Note that the Flower server needs to started with the same
+            value (see `flwr.server.start_server`), otherwise it will not know
+            about the increased limit and block larger messages.
+
+    Returns:
+        None.
+    """
 
     # Wrap the Keras client
     flower_client = KerasClientWrapper(client)
 
     # Start
-    start_client(server_address, flower_client)
+    start_client(
+        server_address=server_address,
+        client=flower_client,
+        grpc_max_message_length=grpc_max_message_length,
+    )
diff --git a/src/py/flwr/common/__init__.py b/src/py/flwr/common/__init__.py
--- a/src/py/flwr/common/__init__.py
+++ b/src/py/flwr/common/__init__.py
@@ -29,7 +29,7 @@
 from .typing import Reconnect as Reconnect
 from .typing import Weights as Weights
 
-GRPC_MAX_MESSAGE_LENGTH: int = 536870912  # == 512 * 1024 * 1024
+GRPC_MAX_MESSAGE_LENGTH: int = 536_870_912  # == 512 * 1024 * 1024
 
 __all__ = [
     "bytes_to_ndarray",


Test patch: