From 6df3e86c8b46a818b113d293fa4f95f304ffa8e4 Mon Sep 17 00:00:00 2001 From: Adam Narozniak <51029327+adam-narozniak@users.noreply.github.com> Date: Sat, 7 Oct 2023 17:51:00 +0200 Subject: [PATCH] Fix return types in Strategy docs (#2432) --- doc/source/ref-changelog.md | 4 ++++ src/py/flwr/server/strategy/strategy.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/source/ref-changelog.md b/doc/source/ref-changelog.md index 7355b4123347..eefd215503f8 100644 --- a/doc/source/ref-changelog.md +++ b/doc/source/ref-changelog.md @@ -8,6 +8,10 @@ ### What's new? +- **Fix the incorrect return types of Strategy** ([#2432](https://github.com/adap/flower/pull/2432/files)) + + The types of the return values in the docstrings in two methods (`aggregate_fit` and `aggregate_evaluate`) now match the hint types in the code. + - **Unify client API** ([#2303](https://github.com/adap/flower/pull/2303)) Using the `client_fn`, Flower clients can interchangeably run as standalone processes (i.e. via `start_client`) or in simulation (i.e. via `start_simulation`) without requiring changes to how the client class is defined and instantiated. diff --git a/src/py/flwr/server/strategy/strategy.py b/src/py/flwr/server/strategy/strategy.py index 95d61993e02e..a2c774fe2506 100644 --- a/src/py/flwr/server/strategy/strategy.py +++ b/src/py/flwr/server/strategy/strategy.py @@ -95,7 +95,7 @@ def aggregate_fit( Returns ------- - parameters : Optional[Parameters] + parameters : Tuple[Optional[Parameters], Dict[str, Scalar]] If parameters are returned, then the server will treat these as the new global model parameters (i.e., it will replace the previous parameters with the ones returned from this method). If `None` is @@ -156,7 +156,7 @@ def aggregate_evaluate( Returns ------- - aggregation_result : Optional[float] + aggregation_result : Tuple[Optional[float], Dict[str, Scalar]] The aggregated evaluation result. Aggregation typically uses some variant of a weighted average. """