flwr-nightly 1.21.0.dev20250904__py3-none-any.whl → 1.21.0.dev20250905__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -140,7 +140,9 @@ class Strategy(ABC):
140
140
  timeout: float = 3600,
141
141
  train_config: Optional[ConfigRecord] = None,
142
142
  evaluate_config: Optional[ConfigRecord] = None,
143
- evaluate_fn: Optional[Callable[[int, ArrayRecord], MetricRecord]] = None,
143
+ evaluate_fn: Optional[
144
+ Callable[[int, ArrayRecord], Optional[MetricRecord]]
145
+ ] = None,
144
146
  ) -> Result:
145
147
  """Execute the federated learning strategy.
146
148
 
@@ -164,11 +166,11 @@ class Strategy(ABC):
164
166
  evaluate_config : ConfigRecord, optional
165
167
  Configuration to be sent to nodes during evaluation rounds.
166
168
  If unset, an empty ConfigRecord will be used.
167
- evaluate_fn : Callable[[int, ArrayRecord], MetricRecord], optional
169
+ evaluate_fn : Callable[[int, ArrayRecord], Optional[MetricRecord]], optional
168
170
  Optional function for centralized evaluation of the global model. Takes
169
- server round number and array record, returns a MetricRecord. If provided,
170
- will be called before the first round and after each round. Defaults to
171
- None.
171
+ server round number and array record, returns a MetricRecord or None. If
172
+ provided, will be called before the first round and after each round.
173
+ Defaults to None.
172
174
 
173
175
  Returns
174
176
  -------
@@ -193,7 +195,8 @@ class Strategy(ABC):
193
195
  if evaluate_fn:
194
196
  res = evaluate_fn(0, initial_arrays)
195
197
  log(INFO, "Initial global evaluation results: %s", res)
196
- result.evaluate_metrics_serverapp[0] = res
198
+ if res is not None:
199
+ result.evaluate_metrics_serverapp[0] = res
197
200
 
198
201
  arrays = initial_arrays
199
202
 
@@ -267,7 +270,8 @@ class Strategy(ABC):
267
270
  log(INFO, "Global evaluation")
268
271
  res = evaluate_fn(current_round, arrays)
269
272
  log(INFO, "\t└──> MetricRecord: %s", res)
270
- result.evaluate_metrics_serverapp[current_round] = res
273
+ if res is not None:
274
+ result.evaluate_metrics_serverapp[current_round] = res
271
275
 
272
276
  log(INFO, "")
273
277
  log(INFO, "Strategy execution finished in %.2fs", time.time() - t_start)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: flwr-nightly
3
- Version: 1.21.0.dev20250904
3
+ Version: 1.21.0.dev20250905
4
4
  Summary: Flower: A Friendly Federated AI Framework
5
5
  License: Apache-2.0
6
6
  Keywords: Artificial Intelligence,Federated AI,Federated Analytics,Federated Evaluation,Federated Learning,Flower,Machine Learning
@@ -338,7 +338,7 @@ flwr/serverapp/strategy/fedavg.py,sha256=C8UUvLTjodMpGRb4PNej5gW2cPbXsPKebGX1zPf
338
338
  flwr/serverapp/strategy/fedopt.py,sha256=aIN5CtgsE88bAodN_M_pf_01a2vMIj9R_7CYwd8VeMU,8481
339
339
  flwr/serverapp/strategy/fedyogi.py,sha256=UQnEKVTpJiB_zbCREfI8CEHiuJMIRmEIu5DV50FG_5s,6657
340
340
  flwr/serverapp/strategy/result.py,sha256=E0Hl2VLnZAgQJjE2GDoKsK7JX-kPPU2KXc47Axt6hGw,4295
341
- flwr/serverapp/strategy/strategy.py,sha256=Frj4VLXOHt7fo18Nh_EvkCUBF8vPR7YxRyx3TD7vV7s,10663
341
+ flwr/serverapp/strategy/strategy.py,sha256=8uJGGm1ROLZERQ_dkRS7Z_rs-yK6XCE0UxXtIdFiEWk,10789
342
342
  flwr/serverapp/strategy/strategy_utils.py,sha256=C8vU8JqKhMylq102x5jjQITzv_X2Khfo-uXkPTpnHms,9779
343
343
  flwr/serverapp/strategy/strategy_utils_tests.py,sha256=taG6HwApwutkjUuMY3R8Ib48Xepw6g5xl9HEB_-leoY,9232
344
344
  flwr/simulation/__init__.py,sha256=Gg6OsP1Z-ixc3-xxzvl7j7rz2Fijy9rzyEPpxgAQCeM,1556
@@ -401,7 +401,7 @@ flwr/supernode/servicer/__init__.py,sha256=lucTzre5WPK7G1YLCfaqg3rbFWdNSb7ZTt-ca
401
401
  flwr/supernode/servicer/clientappio/__init__.py,sha256=7Oy62Y_oijqF7Dxi6tpcUQyOpLc_QpIRZ83NvwmB0Yg,813
402
402
  flwr/supernode/servicer/clientappio/clientappio_servicer.py,sha256=nIHRu38EWK-rpNOkcgBRAAKwYQQWFeCwu0lkO7OPZGQ,10239
403
403
  flwr/supernode/start_client_internal.py,sha256=Y9S1-QlO2WP6eo4JvWzIpfaCoh2aoE7bjEYyxNNnlyg,20777
404
- flwr_nightly-1.21.0.dev20250904.dist-info/METADATA,sha256=9E6SH2cTD1Sm600rg-mXhCYFFqJ_5LbhycC6OYGbr-I,15967
405
- flwr_nightly-1.21.0.dev20250904.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
406
- flwr_nightly-1.21.0.dev20250904.dist-info/entry_points.txt,sha256=hxHD2ixb_vJFDOlZV-zB4Ao32_BQlL34ftsDh1GXv14,420
407
- flwr_nightly-1.21.0.dev20250904.dist-info/RECORD,,
404
+ flwr_nightly-1.21.0.dev20250905.dist-info/METADATA,sha256=j_7UpChhN5B6nRj4Gelt99YjECPo5fbZV8k6K3B86Go,15967
405
+ flwr_nightly-1.21.0.dev20250905.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
406
+ flwr_nightly-1.21.0.dev20250905.dist-info/entry_points.txt,sha256=hxHD2ixb_vJFDOlZV-zB4Ao32_BQlL34ftsDh1GXv14,420
407
+ flwr_nightly-1.21.0.dev20250905.dist-info/RECORD,,