flwr-nightly 1.26.0.dev20260204__py3-none-any.whl → 1.27.0.dev20260205__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.
@@ -185,7 +185,13 @@ class Bulyan(FedAvg):
185
185
 
186
186
  # Convert to ArrayRecord
187
187
  arrays = ArrayRecord(
188
- dict(zip(array_keys, map(Array, aggregated_ndarrays), strict=True))
188
+ dict(
189
+ zip(
190
+ array_keys,
191
+ (Array(np.asarray(arr)) for arr in aggregated_ndarrays),
192
+ strict=True,
193
+ )
194
+ )
189
195
  )
190
196
 
191
197
  # Aggregate MetricRecords
@@ -22,6 +22,8 @@ from abc import ABC
22
22
  from collections.abc import Iterable
23
23
  from logging import INFO, WARNING
24
24
 
25
+ import numpy as np
26
+
25
27
  from flwr.common import Array, ArrayRecord, ConfigRecord, Message, MetricRecord, log
26
28
  from flwr.common.differential_privacy import (
27
29
  add_gaussian_noise_inplace,
@@ -216,7 +218,13 @@ class DifferentialPrivacyServerSideFixedClipping(DifferentialPrivacyFixedClippin
216
218
  )
217
219
  # Replace content while preserving keys
218
220
  reply.content[arr_name] = ArrayRecord(
219
- dict(zip(record.keys(), map(Array, reply_ndarrays), strict=True))
221
+ dict(
222
+ zip(
223
+ record.keys(),
224
+ (Array(np.asarray(v)) for v in reply_ndarrays),
225
+ strict=True,
226
+ )
227
+ )
220
228
  )
221
229
  log(
222
230
  INFO,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: flwr-nightly
3
- Version: 1.26.0.dev20260204
3
+ Version: 1.27.0.dev20260205
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
@@ -21,7 +21,6 @@ flwr/cli/config/ls.py,sha256=14JvV7llvhKozz19eIrrrWxR6WeXyko8apPFiq4P08E,2661
21
21
  flwr/cli/config_migration.py,sha256=Lc_y6zebVBgRr6JdiPJcyroUjuOG0k7UQEbqISUPC2E,10647
22
22
  flwr/cli/config_utils.py,sha256=LNmbPODWefsEtt4ov63BFtuTcK1Pb8Z-AHt1_haWWdA,7841
23
23
  flwr/cli/constant.py,sha256=MYLI7m9ntwWNkFgEEtKVo1JWX3umf_0EdqY8nJy-83Y,3525
24
- flwr/cli/example.py,sha256=SNTorkKPrx1rOryGREUyZu8TcOc1-vFv1zEddaysdY0,2216
25
24
  flwr/cli/federation/__init__.py,sha256=okxswL4fAjApI9gV_alU1lRkTUcQRbwlzvtUTLz61fE,793
26
25
  flwr/cli/federation/ls.py,sha256=k3FyGrH_xh_OdHqw5oj1S5RTKm8ZBqxeA4m6fEEoQx8,10278
27
26
  flwr/cli/flower_config.py,sha256=YQfuFGW52jf6EoAxWrXQYw6lmuH0j2qsZ0twHRLxx4k,15278
@@ -294,9 +293,9 @@ flwr/server/workflow/secure_aggregation/secaggplus_workflow.py,sha256=_-iDGztBOL
294
293
  flwr/serverapp/__init__.py,sha256=ZujKNXULwhWYQhFnxOOT5Wi9MRq2JCWFhAAj7ouiQ78,884
295
294
  flwr/serverapp/exception.py,sha256=5cuH-2AafvihzosWDdDjuMmHdDqZ1XxHvCqZXNBVklw,1334
296
295
  flwr/serverapp/strategy/__init__.py,sha256=dezK2TKSffjjBVXW18ATRxJLTuQ7I2M1dPuNi5y-_6c,1968
297
- flwr/serverapp/strategy/bulyan.py,sha256=disdrk0vCUPWlDvBlVMvHaral9v_hikxpQetVZV5a_Q,9292
296
+ flwr/serverapp/strategy/bulyan.py,sha256=il4FQfyto2lxAxWztrvHxtWgciT5N9en8MXKRZWEASI,9425
298
297
  flwr/serverapp/strategy/dp_adaptive_clipping.py,sha256=iddSwnw1qxNmtYtckvcfGsnVZ_bmyMMYd6biYmIZ_8s,13599
299
- flwr/serverapp/strategy/dp_fixed_clipping.py,sha256=1zJOxJhNFPIJRXneelCsTlx6La7BQAlquWuofa-oHtc,12696
298
+ flwr/serverapp/strategy/dp_fixed_clipping.py,sha256=6_6nxkWfsyJ7CxX8eGK0zjnOv1g2rSqYrAmDnx7VTNU,12893
300
299
  flwr/serverapp/strategy/fedadagrad.py,sha256=oewW2lxZ3YEo8lAI4KtjU-yp4r3bOFTybq4XjwlXYRg,6185
301
300
  flwr/serverapp/strategy/fedadam.py,sha256=jIUytggs5CUxOZ6ZUnt_ajDxHIa1dwrLbdX-3zQ1oHM,6980
302
301
  flwr/serverapp/strategy/fedavg.py,sha256=rzqQgGQTi-2OQtCZ4k3drmFmQF_GLVCRqATsAOP7uUw,12012
@@ -408,7 +407,7 @@ flwr/supernode/servicer/__init__.py,sha256=lucTzre5WPK7G1YLCfaqg3rbFWdNSb7ZTt-ca
408
407
  flwr/supernode/servicer/clientappio/__init__.py,sha256=7Oy62Y_oijqF7Dxi6tpcUQyOpLc_QpIRZ83NvwmB0Yg,813
409
408
  flwr/supernode/servicer/clientappio/clientappio_servicer.py,sha256=5TOp0SelGqiWzRHfhYpoKzUd7EuVTqt5_PXvnUy7_Ok,11615
410
409
  flwr/supernode/start_client_internal.py,sha256=3MkeDiWZr-SsvACuuAxJi8nYw6GYNKOO6q8b36E3R9k,26250
411
- flwr_nightly-1.26.0.dev20260204.dist-info/METADATA,sha256=e3WZONWWxLHHRCHLnL2DXp_JOdwVUs4HAK28LUNqSYE,14447
412
- flwr_nightly-1.26.0.dev20260204.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
413
- flwr_nightly-1.26.0.dev20260204.dist-info/entry_points.txt,sha256=hxHD2ixb_vJFDOlZV-zB4Ao32_BQlL34ftsDh1GXv14,420
414
- flwr_nightly-1.26.0.dev20260204.dist-info/RECORD,,
410
+ flwr_nightly-1.27.0.dev20260205.dist-info/METADATA,sha256=KJB3b9bu03nkrNjA-gfN1CbNzS5YDT1UkOU8r5XPF20,14447
411
+ flwr_nightly-1.27.0.dev20260205.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
412
+ flwr_nightly-1.27.0.dev20260205.dist-info/entry_points.txt,sha256=hxHD2ixb_vJFDOlZV-zB4Ao32_BQlL34ftsDh1GXv14,420
413
+ flwr_nightly-1.27.0.dev20260205.dist-info/RECORD,,
flwr/cli/example.py DELETED
@@ -1,67 +0,0 @@
1
- # Copyright 2025 Flower Labs GmbH. All Rights Reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- # ==============================================================================
15
- """Flower command line interface `example` command."""
16
-
17
-
18
- import json
19
- import os
20
- import subprocess
21
- import tempfile
22
- import urllib.request
23
-
24
- from .utils import prompt_options
25
-
26
-
27
- def example() -> None:
28
- """Clone a Flower example.
29
-
30
- All examples available in the Flower repository are available through this command.
31
- """
32
- # Load list of examples directly from GitHub
33
- url = "https://api.github.com/repos/adap/flower/git/trees/main"
34
- with urllib.request.urlopen(url) as res:
35
- data = json.load(res)
36
- examples_directory_url = [
37
- item["url"] for item in data["tree"] if item["path"] == "examples"
38
- ][0]
39
-
40
- with urllib.request.urlopen(examples_directory_url) as res:
41
- data = json.load(res)
42
- example_names = [
43
- item["path"]
44
- for item in data["tree"]
45
- if item["path"] not in [".gitignore", "doc"]
46
- ]
47
-
48
- example_name = prompt_options(
49
- "Please select example by typing in the number",
50
- example_names,
51
- )
52
-
53
- with tempfile.TemporaryDirectory() as tmpdirname:
54
- subprocess.check_output(
55
- [
56
- "git",
57
- "clone",
58
- "--depth=1",
59
- "https://github.com/adap/flower.git",
60
- tmpdirname,
61
- ]
62
- )
63
- examples_dir = os.path.join(tmpdirname, "examples", example_name)
64
- subprocess.check_output(["mv", examples_dir, "."])
65
-
66
- print()
67
- print(f"Example ready to use in {os.path.join(os.getcwd(), example_name)}")