flwr-nightly 1.20.0.dev20250715__py3-none-any.whl → 1.20.0.dev20250716__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.
@@ -34,9 +34,9 @@ from flwr.common.inflatable import (
34
34
  iterate_object_tree,
35
35
  no_object_id_recompute,
36
36
  )
37
- from flwr.common.inflatable_grpc_utils import (
38
- make_pull_object_fn_grpc,
39
- make_push_object_fn_grpc,
37
+ from flwr.common.inflatable_protobuf_utils import (
38
+ make_pull_object_fn_protobuf,
39
+ make_push_object_fn_protobuf,
40
40
  )
41
41
  from flwr.common.inflatable_utils import (
42
42
  inflate_object_from_contents,
@@ -277,8 +277,8 @@ def grpc_request_response( # pylint: disable=R0913,R0914,R0915,R0917
277
277
  object_tree = response.message_object_trees[0]
278
278
  all_object_contents = pull_objects(
279
279
  [tree.object_id for tree in iterate_object_tree(object_tree)],
280
- pull_object_fn=make_pull_object_fn_grpc(
281
- pull_object_grpc=stub.PullObject,
280
+ pull_object_fn=make_pull_object_fn_protobuf(
281
+ pull_object_protobuf=stub.PullObject,
282
282
  node=node,
283
283
  run_id=run_id,
284
284
  ),
@@ -330,8 +330,8 @@ def grpc_request_response( # pylint: disable=R0913,R0914,R0915,R0917
330
330
  )
331
331
  push_objects(
332
332
  all_objects,
333
- push_object_fn=make_push_object_fn_grpc(
334
- push_object_grpc=stub.PushObject,
333
+ push_object_fn=make_push_object_fn_protobuf(
334
+ push_object_protobuf=stub.PushObject,
335
335
  node=node,
336
336
  run_id=message.metadata.run_id,
337
337
  ),
@@ -14,6 +14,7 @@
14
14
  # ==============================================================================
15
15
  """Contextmanager for a REST request-response channel to the Flower server."""
16
16
 
17
+
17
18
  from collections.abc import Iterator
18
19
  from contextlib import contextmanager
19
20
  from logging import DEBUG, ERROR, INFO, WARN
@@ -33,9 +34,9 @@ from flwr.common.inflatable import (
33
34
  iterate_object_tree,
34
35
  no_object_id_recompute,
35
36
  )
36
- from flwr.common.inflatable_rest_utils import (
37
- make_pull_object_fn_rest,
38
- make_push_object_fn_rest,
37
+ from flwr.common.inflatable_protobuf_utils import (
38
+ make_pull_object_fn_protobuf,
39
+ make_push_object_fn_protobuf,
39
40
  )
40
41
  from flwr.common.inflatable_utils import (
41
42
  inflate_object_from_contents,
@@ -337,8 +338,8 @@ def http_request_response( # pylint: disable=R0913,R0914,R0915,R0917
337
338
  object_tree = res.message_object_trees[0]
338
339
  all_object_contents = pull_objects(
339
340
  [tree.object_id for tree in iterate_object_tree(object_tree)],
340
- pull_object_fn=make_pull_object_fn_rest(
341
- pull_object_rest=fn,
341
+ pull_object_fn=make_pull_object_fn_protobuf(
342
+ pull_object_protobuf=fn,
342
343
  node=node,
343
344
  run_id=run_id,
344
345
  ),
@@ -415,8 +416,8 @@ def http_request_response( # pylint: disable=R0913,R0914,R0915,R0917
415
416
  try:
416
417
  push_objects(
417
418
  all_objects,
418
- push_object_fn=make_push_object_fn_rest(
419
- push_object_rest=fn,
419
+ push_object_fn=make_push_object_fn_protobuf(
420
+ push_object_protobuf=fn,
420
421
  node=node,
421
422
  run_id=message_proto.metadata.run_id,
422
423
  ),
@@ -28,8 +28,8 @@ from flwr.proto.node_pb2 import Node # pylint: disable=E0611
28
28
  from .inflatable_utils import ObjectIdNotPreregisteredError, ObjectUnavailableError
29
29
 
30
30
 
31
- def make_pull_object_fn_grpc(
32
- pull_object_grpc: Callable[[PullObjectRequest], PullObjectResponse],
31
+ def make_pull_object_fn_protobuf(
32
+ pull_object_protobuf: Callable[[PullObjectRequest], PullObjectResponse],
33
33
  node: Node,
34
34
  run_id: int,
35
35
  ) -> Callable[[str], bytes]:
@@ -37,8 +37,9 @@ def make_pull_object_fn_grpc(
37
37
 
38
38
  Parameters
39
39
  ----------
40
- pull_object_grpc : Callable[[PullObjectRequest], PullObjectResponse]
41
- The gRPC function to pull objects, e.g., `FleetStub.PullObject`.
40
+ pull_object_protobuf : Callable[[PullObjectRequest], PullObjectResponse]
41
+ A callable that takes a `PullObjectRequest` and returns a `PullObjectResponse`.
42
+ This function is typically backed by a gRPC client stub.
42
43
  node : Node
43
44
  The node making the request.
44
45
  run_id : int
@@ -54,7 +55,7 @@ def make_pull_object_fn_grpc(
54
55
 
55
56
  def pull_object_fn(object_id: str) -> bytes:
56
57
  request = PullObjectRequest(node=node, run_id=run_id, object_id=object_id)
57
- response: PullObjectResponse = pull_object_grpc(request)
58
+ response: PullObjectResponse = pull_object_protobuf(request)
58
59
  if not response.object_found:
59
60
  raise ObjectIdNotPreregisteredError(object_id)
60
61
  if not response.object_available:
@@ -64,8 +65,8 @@ def make_pull_object_fn_grpc(
64
65
  return pull_object_fn
65
66
 
66
67
 
67
- def make_push_object_fn_grpc(
68
- push_object_grpc: Callable[[PushObjectRequest], PushObjectResponse],
68
+ def make_push_object_fn_protobuf(
69
+ push_object_protobuf: Callable[[PushObjectRequest], PushObjectResponse],
69
70
  node: Node,
70
71
  run_id: int,
71
72
  ) -> Callable[[str, bytes], None]:
@@ -73,8 +74,9 @@ def make_push_object_fn_grpc(
73
74
 
74
75
  Parameters
75
76
  ----------
76
- push_object_grpc : Callable[[PushObjectRequest], PushObjectResponse]
77
- The gRPC function to push objects, e.g., `FleetStub.PushObject`.
77
+ push_object_protobuf : Callable[[PushObjectRequest], PushObjectResponse]
78
+ A callable that takes a `PushObjectRequest` and returns a `PushObjectResponse`.
79
+ This function is typically backed by a gRPC client stub.
78
80
  node : Node
79
81
  The node making the request.
80
82
  run_id : int
@@ -92,7 +94,7 @@ def make_push_object_fn_grpc(
92
94
  request = PushObjectRequest(
93
95
  node=node, run_id=run_id, object_id=object_id, object_content=object_content
94
96
  )
95
- response: PushObjectResponse = push_object_grpc(request)
97
+ response: PushObjectResponse = push_object_protobuf(request)
96
98
  if not response.stored:
97
99
  raise ObjectIdNotPreregisteredError(object_id)
98
100
 
@@ -33,9 +33,9 @@ from flwr.common.inflatable import (
33
33
  get_object_tree,
34
34
  no_object_id_recompute,
35
35
  )
36
- from flwr.common.inflatable_grpc_utils import (
37
- make_pull_object_fn_grpc,
38
- make_push_object_fn_grpc,
36
+ from flwr.common.inflatable_protobuf_utils import (
37
+ make_pull_object_fn_protobuf,
38
+ make_push_object_fn_protobuf,
39
39
  )
40
40
  from flwr.common.inflatable_utils import (
41
41
  inflate_object_from_contents,
@@ -240,8 +240,8 @@ class GrpcGrid(Grid):
240
240
  # Push only object that are not in the store
241
241
  push_objects(
242
242
  all_objects,
243
- push_object_fn=make_push_object_fn_grpc(
244
- push_object_grpc=self._stub.PushObject,
243
+ push_object_fn=make_push_object_fn_protobuf(
244
+ push_object_protobuf=self._stub.PushObject,
245
245
  node=self.node,
246
246
  run_id=run_id,
247
247
  ),
@@ -308,8 +308,8 @@ class GrpcGrid(Grid):
308
308
  msg_id = msg_proto.metadata.message_id
309
309
  all_object_contents = pull_objects(
310
310
  list(res.objects_to_pull[msg_id].object_ids) + [msg_id],
311
- pull_object_fn=make_pull_object_fn_grpc(
312
- pull_object_grpc=self._stub.PullObject,
311
+ pull_object_fn=make_pull_object_fn_protobuf(
312
+ pull_object_protobuf=self._stub.PullObject,
313
313
  node=self.node,
314
314
  run_id=run_id,
315
315
  ),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: flwr-nightly
3
- Version: 1.20.0.dev20250715
3
+ Version: 1.20.0.dev20250716
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
@@ -84,7 +84,7 @@ flwr/client/grpc_adapter_client/__init__.py,sha256=RQWP5mFPROLHKgombiRvPXVWSoVrQ
84
84
  flwr/client/grpc_adapter_client/connection.py,sha256=aj5tTYyE8z2hQLXPPydsJiz8gBDIWLUhfWvqYkAL1L4,3966
85
85
  flwr/client/grpc_rere_client/__init__.py,sha256=i7iS0Lt8B7q0E2L72e4F_YrKm6ClRKnd71PNA6PW2O0,752
86
86
  flwr/client/grpc_rere_client/client_interceptor.py,sha256=zFaVHw6AxeNO-7eCKKb-RxrPa7zbM5Z-2-1Efc4adQY,2451
87
- flwr/client/grpc_rere_client/connection.py,sha256=vPET7CQ0PD4I3arzdumtoHdLHodZ9UVnCkVjlnk_Mkc,13704
87
+ flwr/client/grpc_rere_client/connection.py,sha256=jndP_Z8yNGHocJfucUspk2bcrjPeI3s-nOb1tEeDlT4,13732
88
88
  flwr/client/grpc_rere_client/grpc_adapter.py,sha256=dLGB5GriszAmtgvuFGuz_F7rIwpzLfDxhJ7T3Un-Ce0,6694
89
89
  flwr/client/message_handler/__init__.py,sha256=0lyljDVqre3WljiZbPcwCCf8GiIaSVI_yo_ylEyPwSE,719
90
90
  flwr/client/message_handler/message_handler.py,sha256=X9SXX6et97Lw9_DGD93HKsEBGNjXClcFgc_5aLK0oiU,6541
@@ -98,7 +98,7 @@ flwr/client/mod/secure_aggregation/secaggplus_mod.py,sha256=aKqjZCrikF73y3E-7h40
98
98
  flwr/client/mod/utils.py,sha256=FUgD2TfcWqSeF6jUKZ4i6Ke56U4Nrv85AeVb93s6R9g,1201
99
99
  flwr/client/numpy_client.py,sha256=Qq6ghsIAop2slKqAfgiI5NiHJ4LIxGmrik3Ror4_XVc,9581
100
100
  flwr/client/rest_client/__init__.py,sha256=MBiuK62hj439m9rtwSwI184Hth6Tt5GbmpNMyl3zkZY,735
101
- flwr/client/rest_client/connection.py,sha256=-YyLwCDm3n67ljDmoxYoP9fKZoV28Cb28HRjdZW6m4U,16359
101
+ flwr/client/rest_client/connection.py,sha256=zZ-HYLPCQxKtTo1Sc-n8jkl_GB4bpfViuif8h9HFSqI,16388
102
102
  flwr/client/run_info_store.py,sha256=MaJ3UQ-07hWtK67wnWu0zR29jrk0fsfgJX506dvEOfE,4042
103
103
  flwr/client/typing.py,sha256=Jw3rawDzI_-ZDcRmEQcs5gZModY7oeQlEeltYsdOhlU,1048
104
104
  flwr/clientapp/__init__.py,sha256=zGW4z49Ojzoi1hDiRC7kyhLjijUilc6fqHhtM_ATRVA,719
@@ -123,8 +123,7 @@ flwr/common/exit_handlers.py,sha256=IaqJ60fXZuu7McaRYnoYKtlbH9t4Yl9goNExKqtmQbs,
123
123
  flwr/common/grpc.py,sha256=y70hUFvXkIf3l03xOhlb7qhS6W1UJZRSZqCdB0ir0v8,10381
124
124
  flwr/common/heartbeat.py,sha256=SyEpNDnmJ0lni0cWO67rcoJVKasCLmkNHm3dKLeNrLU,5749
125
125
  flwr/common/inflatable.py,sha256=GDL9oBKs16_yyVdlH6kBf493O5xll_h9V7XB5Mpx1Hc,9524
126
- flwr/common/inflatable_grpc_utils.py,sha256=ZpwtgF1tGD6NwQkCidbhbeBPDBZ1Nx9eGMHQ04eNEE8,3554
127
- flwr/common/inflatable_rest_utils.py,sha256=KiZd06XRiXcl_WewOrag0JTvUQt5kZ74UIsQ3FCAXGc,3580
126
+ flwr/common/inflatable_protobuf_utils.py,sha256=lvKR5jD5P8AlpknD_1BlvUoTuT6Iyd8oodXfUQvjDRU,3746
128
127
  flwr/common/inflatable_utils.py,sha256=yew5VU8po8yZsmoTVxg-tB5vrvnb2mvBAE55qjiOAq8,12840
129
128
  flwr/common/logger.py,sha256=JbRf6E2vQxXzpDBq1T8IDUJo_usu3gjWEBPQ6uKcmdg,13049
130
129
  flwr/common/message.py,sha256=xAL7iZN5-n-xPQpgoSFvxNrzs8fmiiPfoU0DjNQEhRw,19953
@@ -243,7 +242,7 @@ flwr/server/criterion.py,sha256=G4e-6B48Pc7d5rmGVUpIzNKb6UF88O3VmTRuUltgjzM,1061
243
242
  flwr/server/fleet_event_log_interceptor.py,sha256=ifV4gUB_hSg7QPLIrAyDpjciqZBOKb0L0abZno3GTwA,3780
244
243
  flwr/server/grid/__init__.py,sha256=aWZHezoR2UGMJISB_gPMCm2N_2GSbm97A3lAp7ruhRQ,888
245
244
  flwr/server/grid/grid.py,sha256=naGCYt5J6dnmUvrcGkdNyKPe3MBd-0awGm1ALmgahqY,6625
246
- flwr/server/grid/grpc_grid.py,sha256=-SLS1VifRo1uxgjRWQJSshkTm5t0s8Wrj2ZZcbSu86I,13581
245
+ flwr/server/grid/grpc_grid.py,sha256=6w-X6mRyAmaWyrUaBnRp3enM4e63iEMUUWPIRFqO1qw,13609
247
246
  flwr/server/grid/inmemory_grid.py,sha256=RjejYT-d-hHuTs1KSs_5wvOdAWKLus8w5_UAcnGt4iw,6168
248
247
  flwr/server/history.py,sha256=cCkFhBN4GoHsYYNk5GG1Y089eKJh2DH_ZJbYPwLaGyk,5026
249
248
  flwr/server/run_serverapp.py,sha256=v0p6jXj2dFxlRUdoEeF1mnaFd9XRQi6dZCflPY6d3qI,2063
@@ -370,7 +369,7 @@ flwr/supernode/servicer/__init__.py,sha256=lucTzre5WPK7G1YLCfaqg3rbFWdNSb7ZTt-ca
370
369
  flwr/supernode/servicer/clientappio/__init__.py,sha256=7Oy62Y_oijqF7Dxi6tpcUQyOpLc_QpIRZ83NvwmB0Yg,813
371
370
  flwr/supernode/servicer/clientappio/clientappio_servicer.py,sha256=U-uAJ7Yd_BzEqhbpCSgEG9pxX5Zf4RuPVYKimYDvMbU,7176
372
371
  flwr/supernode/start_client_internal.py,sha256=_ZqSfL_j4qn6Cg-P6sv3k_n1ZG62J_teokBxnWrXrPE,18772
373
- flwr_nightly-1.20.0.dev20250715.dist-info/METADATA,sha256=iIDSwZNrjaPU5qYQBFP1TEFZVnJXdIw69KRx9MYSVcI,15966
374
- flwr_nightly-1.20.0.dev20250715.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
375
- flwr_nightly-1.20.0.dev20250715.dist-info/entry_points.txt,sha256=jNpDXGBGgs21RqUxelF_jwGaxtqFwm-MQyfz-ZqSjrA,367
376
- flwr_nightly-1.20.0.dev20250715.dist-info/RECORD,,
372
+ flwr_nightly-1.20.0.dev20250716.dist-info/METADATA,sha256=bp6v4He7vTM-vNpn-EKkSH-QXj2VZN62mGjFq5yWl7g,15966
373
+ flwr_nightly-1.20.0.dev20250716.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
374
+ flwr_nightly-1.20.0.dev20250716.dist-info/entry_points.txt,sha256=jNpDXGBGgs21RqUxelF_jwGaxtqFwm-MQyfz-ZqSjrA,367
375
+ flwr_nightly-1.20.0.dev20250716.dist-info/RECORD,,
@@ -1,99 +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
- """InflatableObject REST utils."""
16
-
17
-
18
- from typing import Callable
19
-
20
- from flwr.proto.message_pb2 import ( # pylint: disable=E0611
21
- PullObjectRequest,
22
- PullObjectResponse,
23
- PushObjectRequest,
24
- PushObjectResponse,
25
- )
26
- from flwr.proto.node_pb2 import Node # pylint: disable=E0611
27
-
28
- from .inflatable_utils import ObjectIdNotPreregisteredError, ObjectUnavailableError
29
-
30
-
31
- def make_pull_object_fn_rest(
32
- pull_object_rest: Callable[[PullObjectRequest], PullObjectResponse],
33
- node: Node,
34
- run_id: int,
35
- ) -> Callable[[str], bytes]:
36
- """Create a pull object function that uses REST to pull objects.
37
-
38
- Parameters
39
- ----------
40
- pull_object_rest : Callable[[PullObjectRequest], PullObjectResponse]
41
- A function that makes a POST request against the `/push-object` REST endpoint
42
- node : Node
43
- The node making the request.
44
- run_id : int
45
- The run ID for the current operation.
46
-
47
- Returns
48
- -------
49
- Callable[[str], bytes]
50
- A function that takes an object ID and returns the object content as bytes.
51
- The function raises `ObjectIdNotPreregisteredError` if the object ID is not
52
- pre-registered, or `ObjectUnavailableError` if the object is not yet available.
53
- """
54
-
55
- def pull_object_fn(object_id: str) -> bytes:
56
- request = PullObjectRequest(node=node, run_id=run_id, object_id=object_id)
57
- response: PullObjectResponse = pull_object_rest(request)
58
- if not response.object_found:
59
- raise ObjectIdNotPreregisteredError(object_id)
60
- if not response.object_available:
61
- raise ObjectUnavailableError(object_id)
62
- return response.object_content
63
-
64
- return pull_object_fn
65
-
66
-
67
- def make_push_object_fn_rest(
68
- push_object_rest: Callable[[PushObjectRequest], PushObjectResponse],
69
- node: Node,
70
- run_id: int,
71
- ) -> Callable[[str, bytes], None]:
72
- """Create a push object function that uses REST to push objects.
73
-
74
- Parameters
75
- ----------
76
- push_object_rest : Callable[[PushObjectRequest], PushObjectResponse]
77
- A function that makes a POST request against the `/pull-object` REST endpoint
78
- node : Node
79
- The node making the request.
80
- run_id : int
81
- The run ID for the current operation.
82
-
83
- Returns
84
- -------
85
- Callable[[str, bytes], None]
86
- A function that takes an object ID and its content as bytes, and pushes it
87
- to the servicer. The function raises `ObjectIdNotPreregisteredError` if
88
- the object ID is not pre-registered.
89
- """
90
-
91
- def push_object_fn(object_id: str, object_content: bytes) -> None:
92
- request = PushObjectRequest(
93
- node=node, run_id=run_id, object_id=object_id, object_content=object_content
94
- )
95
- response: PushObjectResponse = push_object_rest(request)
96
- if not response.stored:
97
- raise ObjectIdNotPreregisteredError(object_id)
98
-
99
- return push_object_fn