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

docs(framework) Update client_fn docstrings to new signature #3793

Merged
merged 1 commit into from
Jul 13, 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
2 changes: 1 addition & 1 deletion src/py/flwr/client/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class `flwr.client.Client` (default: None)
Starting an SSL-enabled gRPC client using system certificates:

>>> def client_fn(context: Context):
>>> return FlowerClient()
>>> return FlowerClient().to_client()
>>>
>>> start_client(
>>> server_address=localhost:8080,
Expand Down
2 changes: 1 addition & 1 deletion src/py/flwr/client/client_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class ClientApp:
>>> class FlowerClient(NumPyClient):
>>> # ...
>>>
>>> def client_fn(node_id: int, partition_id: Optional[int]):
>>> def client_fn(context: Context):
>>> return FlowerClient().to_client()
>>>
>>> app = ClientApp(client_fn)
Expand Down
6 changes: 3 additions & 3 deletions src/py/flwr/simulation/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ def start_simulation(
Parameters
----------
client_fn : ClientFnExt
A function creating Client instances. The function must have the signature
`client_fn(node_id: int, partition_id: Optional[int]). It should return
a single client instance of type Client. Note that the created client
A function creating `Client` instances. The function must have the signature
`client_fn(context: Context). It should return
a single client instance of type `Client`. Note that the created client
instances are ephemeral and will often be destroyed after a single method
invocation. Since client instances are not long-lived, they should not attempt
to carry state over method invocations. Any state required by the instance
Expand Down