flwr-nightly 1.17.0.dev20250319__py3-none-any.whl → 1.17.0.dev20250321__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.
- flwr/cli/run/run.py +5 -9
- flwr/client/app.py +6 -4
- flwr/client/client_app.py +10 -12
- flwr/client/clientapp/app.py +2 -2
- flwr/client/grpc_client/connection.py +24 -21
- flwr/client/message_handler/message_handler.py +27 -27
- flwr/client/mod/__init__.py +2 -2
- flwr/client/mod/centraldp_mods.py +7 -7
- flwr/client/mod/comms_mods.py +16 -22
- flwr/client/mod/localdp_mod.py +4 -4
- flwr/client/mod/secure_aggregation/secaggplus_mod.py +31 -31
- flwr/client/run_info_store.py +2 -2
- flwr/common/__init__.py +12 -4
- flwr/common/config.py +4 -4
- flwr/common/constant.py +1 -1
- flwr/common/context.py +4 -4
- flwr/common/message.py +269 -101
- flwr/common/record/__init__.py +8 -4
- flwr/common/record/{parametersrecord.py → arrayrecord.py} +75 -32
- flwr/common/record/{configsrecord.py → configrecord.py} +75 -29
- flwr/common/record/conversion_utils.py +1 -1
- flwr/common/record/{metricsrecord.py → metricrecord.py} +78 -32
- flwr/common/record/recorddict.py +288 -0
- flwr/common/recorddict_compat.py +410 -0
- flwr/common/secure_aggregation/secaggplus_constants.py +1 -1
- flwr/common/serde.py +66 -71
- flwr/common/typing.py +8 -8
- flwr/proto/exec_pb2.py +3 -3
- flwr/proto/exec_pb2.pyi +3 -3
- flwr/proto/message_pb2.py +12 -12
- flwr/proto/message_pb2.pyi +9 -9
- flwr/proto/recorddict_pb2.py +70 -0
- flwr/proto/{recordset_pb2.pyi → recorddict_pb2.pyi} +35 -35
- flwr/proto/run_pb2.py +31 -31
- flwr/proto/run_pb2.pyi +3 -3
- flwr/server/compat/grid_client_proxy.py +31 -31
- flwr/server/grid/grid.py +3 -3
- flwr/server/grid/grpc_grid.py +15 -23
- flwr/server/grid/inmemory_grid.py +14 -20
- flwr/server/superlink/fleet/vce/backend/backend.py +2 -2
- flwr/server/superlink/fleet/vce/backend/raybackend.py +2 -2
- flwr/server/superlink/fleet/vce/vce_api.py +1 -3
- flwr/server/superlink/linkstate/in_memory_linkstate.py +5 -5
- flwr/server/superlink/linkstate/linkstate.py +4 -4
- flwr/server/superlink/linkstate/sqlite_linkstate.py +21 -25
- flwr/server/superlink/linkstate/utils.py +18 -15
- flwr/server/superlink/serverappio/serverappio_servicer.py +3 -3
- flwr/server/superlink/simulation/simulationio_servicer.py +2 -2
- flwr/server/utils/validator.py +4 -4
- flwr/server/workflow/default_workflows.py +34 -41
- flwr/server/workflow/secure_aggregation/secaggplus_workflow.py +37 -39
- flwr/simulation/app.py +2 -2
- flwr/simulation/ray_transport/ray_actor.py +4 -2
- flwr/simulation/ray_transport/ray_client_proxy.py +34 -32
- flwr/simulation/run_simulation.py +5 -5
- flwr/superexec/deployment.py +4 -4
- flwr/superexec/exec_servicer.py +2 -2
- flwr/superexec/executor.py +3 -3
- flwr/superexec/simulation.py +3 -3
- {flwr_nightly-1.17.0.dev20250319.dist-info → flwr_nightly-1.17.0.dev20250321.dist-info}/METADATA +1 -1
- {flwr_nightly-1.17.0.dev20250319.dist-info → flwr_nightly-1.17.0.dev20250321.dist-info}/RECORD +66 -66
- flwr/common/record/recordset.py +0 -209
- flwr/common/recordset_compat.py +0 -418
- flwr/proto/recordset_pb2.py +0 -70
- /flwr/proto/{recordset_pb2_grpc.py → recorddict_pb2_grpc.py} +0 -0
- /flwr/proto/{recordset_pb2_grpc.pyi → recorddict_pb2_grpc.pyi} +0 -0
- {flwr_nightly-1.17.0.dev20250319.dist-info → flwr_nightly-1.17.0.dev20250321.dist-info}/LICENSE +0 -0
- {flwr_nightly-1.17.0.dev20250319.dist-info → flwr_nightly-1.17.0.dev20250321.dist-info}/WHEEL +0 -0
- {flwr_nightly-1.17.0.dev20250319.dist-info → flwr_nightly-1.17.0.dev20250321.dist-info}/entry_points.txt +0 -0
flwr/common/recordset_compat.py
DELETED
@@ -1,418 +0,0 @@
|
|
1
|
-
# Copyright 2024 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
|
-
"""RecordSet utilities."""
|
16
|
-
|
17
|
-
|
18
|
-
from collections import OrderedDict
|
19
|
-
from collections.abc import Mapping
|
20
|
-
from typing import Union, cast, get_args
|
21
|
-
|
22
|
-
from . import Array, ConfigsRecord, MetricsRecord, ParametersRecord, RecordSet
|
23
|
-
from .typing import (
|
24
|
-
Code,
|
25
|
-
ConfigsRecordValues,
|
26
|
-
EvaluateIns,
|
27
|
-
EvaluateRes,
|
28
|
-
FitIns,
|
29
|
-
FitRes,
|
30
|
-
GetParametersIns,
|
31
|
-
GetParametersRes,
|
32
|
-
GetPropertiesIns,
|
33
|
-
GetPropertiesRes,
|
34
|
-
MetricsRecordValues,
|
35
|
-
Parameters,
|
36
|
-
Scalar,
|
37
|
-
Status,
|
38
|
-
)
|
39
|
-
|
40
|
-
EMPTY_TENSOR_KEY = "_empty"
|
41
|
-
|
42
|
-
|
43
|
-
def parametersrecord_to_parameters(
|
44
|
-
record: ParametersRecord, keep_input: bool
|
45
|
-
) -> Parameters:
|
46
|
-
"""Convert ParameterRecord to legacy Parameters.
|
47
|
-
|
48
|
-
Warnings
|
49
|
-
--------
|
50
|
-
Because `Arrays` in `ParametersRecord` encode more information of the
|
51
|
-
array-like or tensor-like data (e.g their datatype, shape) than `Parameters` it
|
52
|
-
might not be possible to reconstruct such data structures from `Parameters` objects
|
53
|
-
alone. Additional information or metadata must be provided from elsewhere.
|
54
|
-
|
55
|
-
Parameters
|
56
|
-
----------
|
57
|
-
record : ParametersRecord
|
58
|
-
The record to be conveted into Parameters.
|
59
|
-
keep_input : bool
|
60
|
-
A boolean indicating whether entries in the record should be deleted from the
|
61
|
-
input dictionary immediately after adding them to the record.
|
62
|
-
|
63
|
-
Returns
|
64
|
-
-------
|
65
|
-
parameters : Parameters
|
66
|
-
The parameters in the legacy format Parameters.
|
67
|
-
"""
|
68
|
-
parameters = Parameters(tensors=[], tensor_type="")
|
69
|
-
|
70
|
-
for key in list(record.keys()):
|
71
|
-
if key != EMPTY_TENSOR_KEY:
|
72
|
-
parameters.tensors.append(record[key].data)
|
73
|
-
|
74
|
-
if not parameters.tensor_type:
|
75
|
-
# Setting from first array in record. Recall the warning in the docstrings
|
76
|
-
# of this function.
|
77
|
-
parameters.tensor_type = record[key].stype
|
78
|
-
|
79
|
-
if not keep_input:
|
80
|
-
del record[key]
|
81
|
-
|
82
|
-
return parameters
|
83
|
-
|
84
|
-
|
85
|
-
def parameters_to_parametersrecord(
|
86
|
-
parameters: Parameters, keep_input: bool
|
87
|
-
) -> ParametersRecord:
|
88
|
-
"""Convert legacy Parameters into a single ParametersRecord.
|
89
|
-
|
90
|
-
Because there is no concept of names in the legacy Parameters, arbitrary keys will
|
91
|
-
be used when constructing the ParametersRecord. Similarly, the shape and data type
|
92
|
-
won't be recorded in the Array objects.
|
93
|
-
|
94
|
-
Parameters
|
95
|
-
----------
|
96
|
-
parameters : Parameters
|
97
|
-
Parameters object to be represented as a ParametersRecord.
|
98
|
-
keep_input : bool
|
99
|
-
A boolean indicating whether parameters should be deleted from the input
|
100
|
-
Parameters object (i.e. a list of serialized NumPy arrays) immediately after
|
101
|
-
adding them to the record.
|
102
|
-
|
103
|
-
Returns
|
104
|
-
-------
|
105
|
-
ParametersRecord
|
106
|
-
The ParametersRecord containing the provided parameters.
|
107
|
-
"""
|
108
|
-
tensor_type = parameters.tensor_type
|
109
|
-
|
110
|
-
num_arrays = len(parameters.tensors)
|
111
|
-
ordered_dict = OrderedDict()
|
112
|
-
for idx in range(num_arrays):
|
113
|
-
if keep_input:
|
114
|
-
tensor = parameters.tensors[idx]
|
115
|
-
else:
|
116
|
-
tensor = parameters.tensors.pop(0)
|
117
|
-
ordered_dict[str(idx)] = Array(
|
118
|
-
data=tensor, dtype="", stype=tensor_type, shape=[]
|
119
|
-
)
|
120
|
-
|
121
|
-
if num_arrays == 0:
|
122
|
-
ordered_dict[EMPTY_TENSOR_KEY] = Array(
|
123
|
-
data=b"", dtype="", stype=tensor_type, shape=[]
|
124
|
-
)
|
125
|
-
return ParametersRecord(ordered_dict, keep_input=keep_input)
|
126
|
-
|
127
|
-
|
128
|
-
def _check_mapping_from_recordscalartype_to_scalar(
|
129
|
-
record_data: Mapping[str, Union[ConfigsRecordValues, MetricsRecordValues]]
|
130
|
-
) -> dict[str, Scalar]:
|
131
|
-
"""Check mapping `common.*RecordValues` into `common.Scalar` is possible."""
|
132
|
-
for value in record_data.values():
|
133
|
-
if not isinstance(value, get_args(Scalar)):
|
134
|
-
raise TypeError(
|
135
|
-
"There is not a 1:1 mapping between `common.Scalar` types and those "
|
136
|
-
"supported in `common.ConfigsRecordValues` or "
|
137
|
-
"`common.ConfigsRecordValues`. Consider casting your values to a type "
|
138
|
-
"supported by the `common.RecordSet` infrastructure. "
|
139
|
-
f"You used type: {type(value)}"
|
140
|
-
)
|
141
|
-
return cast(dict[str, Scalar], record_data)
|
142
|
-
|
143
|
-
|
144
|
-
def _recordset_to_fit_or_evaluate_ins_components(
|
145
|
-
recordset: RecordSet,
|
146
|
-
ins_str: str,
|
147
|
-
keep_input: bool,
|
148
|
-
) -> tuple[Parameters, dict[str, Scalar]]:
|
149
|
-
"""Derive Fit/Evaluate Ins from a RecordSet."""
|
150
|
-
# get Array and construct Parameters
|
151
|
-
parameters_record = recordset.parameters_records[f"{ins_str}.parameters"]
|
152
|
-
|
153
|
-
parameters = parametersrecord_to_parameters(
|
154
|
-
parameters_record, keep_input=keep_input
|
155
|
-
)
|
156
|
-
|
157
|
-
# get config dict
|
158
|
-
config_record = recordset.configs_records[f"{ins_str}.config"]
|
159
|
-
# pylint: disable-next=protected-access
|
160
|
-
config_dict = _check_mapping_from_recordscalartype_to_scalar(config_record)
|
161
|
-
|
162
|
-
return parameters, config_dict
|
163
|
-
|
164
|
-
|
165
|
-
def _fit_or_evaluate_ins_to_recordset(
|
166
|
-
ins: Union[FitIns, EvaluateIns], keep_input: bool
|
167
|
-
) -> RecordSet:
|
168
|
-
recordset = RecordSet()
|
169
|
-
|
170
|
-
ins_str = "fitins" if isinstance(ins, FitIns) else "evaluateins"
|
171
|
-
parametersrecord = parameters_to_parametersrecord(ins.parameters, keep_input)
|
172
|
-
recordset.parameters_records[f"{ins_str}.parameters"] = parametersrecord
|
173
|
-
|
174
|
-
recordset.configs_records[f"{ins_str}.config"] = ConfigsRecord(
|
175
|
-
ins.config # type: ignore
|
176
|
-
)
|
177
|
-
|
178
|
-
return recordset
|
179
|
-
|
180
|
-
|
181
|
-
def _embed_status_into_recordset(
|
182
|
-
res_str: str, status: Status, recordset: RecordSet
|
183
|
-
) -> RecordSet:
|
184
|
-
status_dict: dict[str, ConfigsRecordValues] = {
|
185
|
-
"code": int(status.code.value),
|
186
|
-
"message": status.message,
|
187
|
-
}
|
188
|
-
# we add it to a `ConfigsRecord`` because the `status.message`` is a string
|
189
|
-
# and `str` values aren't supported in `MetricsRecords`
|
190
|
-
recordset.configs_records[f"{res_str}.status"] = ConfigsRecord(status_dict)
|
191
|
-
return recordset
|
192
|
-
|
193
|
-
|
194
|
-
def _extract_status_from_recordset(res_str: str, recordset: RecordSet) -> Status:
|
195
|
-
status = recordset.configs_records[f"{res_str}.status"]
|
196
|
-
code = cast(int, status["code"])
|
197
|
-
return Status(code=Code(code), message=str(status["message"]))
|
198
|
-
|
199
|
-
|
200
|
-
def recordset_to_fitins(recordset: RecordSet, keep_input: bool) -> FitIns:
|
201
|
-
"""Derive FitIns from a RecordSet object."""
|
202
|
-
parameters, config = _recordset_to_fit_or_evaluate_ins_components(
|
203
|
-
recordset,
|
204
|
-
ins_str="fitins",
|
205
|
-
keep_input=keep_input,
|
206
|
-
)
|
207
|
-
|
208
|
-
return FitIns(parameters=parameters, config=config)
|
209
|
-
|
210
|
-
|
211
|
-
def fitins_to_recordset(fitins: FitIns, keep_input: bool) -> RecordSet:
|
212
|
-
"""Construct a RecordSet from a FitIns object."""
|
213
|
-
return _fit_or_evaluate_ins_to_recordset(fitins, keep_input)
|
214
|
-
|
215
|
-
|
216
|
-
def recordset_to_fitres(recordset: RecordSet, keep_input: bool) -> FitRes:
|
217
|
-
"""Derive FitRes from a RecordSet object."""
|
218
|
-
ins_str = "fitres"
|
219
|
-
parameters = parametersrecord_to_parameters(
|
220
|
-
recordset.parameters_records[f"{ins_str}.parameters"], keep_input=keep_input
|
221
|
-
)
|
222
|
-
|
223
|
-
num_examples = cast(
|
224
|
-
int, recordset.metrics_records[f"{ins_str}.num_examples"]["num_examples"]
|
225
|
-
)
|
226
|
-
configs_record = recordset.configs_records[f"{ins_str}.metrics"]
|
227
|
-
# pylint: disable-next=protected-access
|
228
|
-
metrics = _check_mapping_from_recordscalartype_to_scalar(configs_record)
|
229
|
-
status = _extract_status_from_recordset(ins_str, recordset)
|
230
|
-
|
231
|
-
return FitRes(
|
232
|
-
status=status, parameters=parameters, num_examples=num_examples, metrics=metrics
|
233
|
-
)
|
234
|
-
|
235
|
-
|
236
|
-
def fitres_to_recordset(fitres: FitRes, keep_input: bool) -> RecordSet:
|
237
|
-
"""Construct a RecordSet from a FitRes object."""
|
238
|
-
recordset = RecordSet()
|
239
|
-
|
240
|
-
res_str = "fitres"
|
241
|
-
|
242
|
-
recordset.configs_records[f"{res_str}.metrics"] = ConfigsRecord(
|
243
|
-
fitres.metrics # type: ignore
|
244
|
-
)
|
245
|
-
recordset.metrics_records[f"{res_str}.num_examples"] = MetricsRecord(
|
246
|
-
{"num_examples": fitres.num_examples},
|
247
|
-
)
|
248
|
-
recordset.parameters_records[f"{res_str}.parameters"] = (
|
249
|
-
parameters_to_parametersrecord(
|
250
|
-
fitres.parameters,
|
251
|
-
keep_input,
|
252
|
-
)
|
253
|
-
)
|
254
|
-
|
255
|
-
# status
|
256
|
-
recordset = _embed_status_into_recordset(res_str, fitres.status, recordset)
|
257
|
-
|
258
|
-
return recordset
|
259
|
-
|
260
|
-
|
261
|
-
def recordset_to_evaluateins(recordset: RecordSet, keep_input: bool) -> EvaluateIns:
|
262
|
-
"""Derive EvaluateIns from a RecordSet object."""
|
263
|
-
parameters, config = _recordset_to_fit_or_evaluate_ins_components(
|
264
|
-
recordset,
|
265
|
-
ins_str="evaluateins",
|
266
|
-
keep_input=keep_input,
|
267
|
-
)
|
268
|
-
|
269
|
-
return EvaluateIns(parameters=parameters, config=config)
|
270
|
-
|
271
|
-
|
272
|
-
def evaluateins_to_recordset(evaluateins: EvaluateIns, keep_input: bool) -> RecordSet:
|
273
|
-
"""Construct a RecordSet from a EvaluateIns object."""
|
274
|
-
return _fit_or_evaluate_ins_to_recordset(evaluateins, keep_input)
|
275
|
-
|
276
|
-
|
277
|
-
def recordset_to_evaluateres(recordset: RecordSet) -> EvaluateRes:
|
278
|
-
"""Derive EvaluateRes from a RecordSet object."""
|
279
|
-
ins_str = "evaluateres"
|
280
|
-
|
281
|
-
loss = cast(int, recordset.metrics_records[f"{ins_str}.loss"]["loss"])
|
282
|
-
|
283
|
-
num_examples = cast(
|
284
|
-
int, recordset.metrics_records[f"{ins_str}.num_examples"]["num_examples"]
|
285
|
-
)
|
286
|
-
configs_record = recordset.configs_records[f"{ins_str}.metrics"]
|
287
|
-
|
288
|
-
# pylint: disable-next=protected-access
|
289
|
-
metrics = _check_mapping_from_recordscalartype_to_scalar(configs_record)
|
290
|
-
status = _extract_status_from_recordset(ins_str, recordset)
|
291
|
-
|
292
|
-
return EvaluateRes(
|
293
|
-
status=status, loss=loss, num_examples=num_examples, metrics=metrics
|
294
|
-
)
|
295
|
-
|
296
|
-
|
297
|
-
def evaluateres_to_recordset(evaluateres: EvaluateRes) -> RecordSet:
|
298
|
-
"""Construct a RecordSet from a EvaluateRes object."""
|
299
|
-
recordset = RecordSet()
|
300
|
-
|
301
|
-
res_str = "evaluateres"
|
302
|
-
# loss
|
303
|
-
recordset.metrics_records[f"{res_str}.loss"] = MetricsRecord(
|
304
|
-
{"loss": evaluateres.loss},
|
305
|
-
)
|
306
|
-
|
307
|
-
# num_examples
|
308
|
-
recordset.metrics_records[f"{res_str}.num_examples"] = MetricsRecord(
|
309
|
-
{"num_examples": evaluateres.num_examples},
|
310
|
-
)
|
311
|
-
|
312
|
-
# metrics
|
313
|
-
recordset.configs_records[f"{res_str}.metrics"] = ConfigsRecord(
|
314
|
-
evaluateres.metrics, # type: ignore
|
315
|
-
)
|
316
|
-
|
317
|
-
# status
|
318
|
-
recordset = _embed_status_into_recordset(
|
319
|
-
f"{res_str}", evaluateres.status, recordset
|
320
|
-
)
|
321
|
-
|
322
|
-
return recordset
|
323
|
-
|
324
|
-
|
325
|
-
def recordset_to_getparametersins(recordset: RecordSet) -> GetParametersIns:
|
326
|
-
"""Derive GetParametersIns from a RecordSet object."""
|
327
|
-
config_record = recordset.configs_records["getparametersins.config"]
|
328
|
-
# pylint: disable-next=protected-access
|
329
|
-
config_dict = _check_mapping_from_recordscalartype_to_scalar(config_record)
|
330
|
-
|
331
|
-
return GetParametersIns(config=config_dict)
|
332
|
-
|
333
|
-
|
334
|
-
def getparametersins_to_recordset(getparameters_ins: GetParametersIns) -> RecordSet:
|
335
|
-
"""Construct a RecordSet from a GetParametersIns object."""
|
336
|
-
recordset = RecordSet()
|
337
|
-
|
338
|
-
recordset.configs_records["getparametersins.config"] = ConfigsRecord(
|
339
|
-
getparameters_ins.config, # type: ignore
|
340
|
-
)
|
341
|
-
return recordset
|
342
|
-
|
343
|
-
|
344
|
-
def getparametersres_to_recordset(
|
345
|
-
getparametersres: GetParametersRes, keep_input: bool
|
346
|
-
) -> RecordSet:
|
347
|
-
"""Construct a RecordSet from a GetParametersRes object."""
|
348
|
-
recordset = RecordSet()
|
349
|
-
res_str = "getparametersres"
|
350
|
-
parameters_record = parameters_to_parametersrecord(
|
351
|
-
getparametersres.parameters, keep_input=keep_input
|
352
|
-
)
|
353
|
-
recordset.parameters_records[f"{res_str}.parameters"] = parameters_record
|
354
|
-
|
355
|
-
# status
|
356
|
-
recordset = _embed_status_into_recordset(
|
357
|
-
res_str, getparametersres.status, recordset
|
358
|
-
)
|
359
|
-
|
360
|
-
return recordset
|
361
|
-
|
362
|
-
|
363
|
-
def recordset_to_getparametersres(
|
364
|
-
recordset: RecordSet, keep_input: bool
|
365
|
-
) -> GetParametersRes:
|
366
|
-
"""Derive GetParametersRes from a RecordSet object."""
|
367
|
-
res_str = "getparametersres"
|
368
|
-
parameters = parametersrecord_to_parameters(
|
369
|
-
recordset.parameters_records[f"{res_str}.parameters"], keep_input=keep_input
|
370
|
-
)
|
371
|
-
|
372
|
-
status = _extract_status_from_recordset(res_str, recordset)
|
373
|
-
return GetParametersRes(status=status, parameters=parameters)
|
374
|
-
|
375
|
-
|
376
|
-
def recordset_to_getpropertiesins(recordset: RecordSet) -> GetPropertiesIns:
|
377
|
-
"""Derive GetPropertiesIns from a RecordSet object."""
|
378
|
-
config_record = recordset.configs_records["getpropertiesins.config"]
|
379
|
-
# pylint: disable-next=protected-access
|
380
|
-
config_dict = _check_mapping_from_recordscalartype_to_scalar(config_record)
|
381
|
-
|
382
|
-
return GetPropertiesIns(config=config_dict)
|
383
|
-
|
384
|
-
|
385
|
-
def getpropertiesins_to_recordset(getpropertiesins: GetPropertiesIns) -> RecordSet:
|
386
|
-
"""Construct a RecordSet from a GetPropertiesRes object."""
|
387
|
-
recordset = RecordSet()
|
388
|
-
recordset.configs_records["getpropertiesins.config"] = ConfigsRecord(
|
389
|
-
getpropertiesins.config, # type: ignore
|
390
|
-
)
|
391
|
-
return recordset
|
392
|
-
|
393
|
-
|
394
|
-
def recordset_to_getpropertiesres(recordset: RecordSet) -> GetPropertiesRes:
|
395
|
-
"""Derive GetPropertiesRes from a RecordSet object."""
|
396
|
-
res_str = "getpropertiesres"
|
397
|
-
config_record = recordset.configs_records[f"{res_str}.properties"]
|
398
|
-
# pylint: disable-next=protected-access
|
399
|
-
properties = _check_mapping_from_recordscalartype_to_scalar(config_record)
|
400
|
-
|
401
|
-
status = _extract_status_from_recordset(res_str, recordset=recordset)
|
402
|
-
|
403
|
-
return GetPropertiesRes(status=status, properties=properties)
|
404
|
-
|
405
|
-
|
406
|
-
def getpropertiesres_to_recordset(getpropertiesres: GetPropertiesRes) -> RecordSet:
|
407
|
-
"""Construct a RecordSet from a GetPropertiesRes object."""
|
408
|
-
recordset = RecordSet()
|
409
|
-
res_str = "getpropertiesres"
|
410
|
-
recordset.configs_records[f"{res_str}.properties"] = ConfigsRecord(
|
411
|
-
getpropertiesres.properties, # type: ignore
|
412
|
-
)
|
413
|
-
# status
|
414
|
-
recordset = _embed_status_into_recordset(
|
415
|
-
res_str, getpropertiesres.status, recordset
|
416
|
-
)
|
417
|
-
|
418
|
-
return recordset
|
flwr/proto/recordset_pb2.py
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
-
# source: flwr/proto/recordset.proto
|
4
|
-
# Protobuf Python Version: 4.25.1
|
5
|
-
"""Generated protocol buffer code."""
|
6
|
-
from google.protobuf import descriptor as _descriptor
|
7
|
-
from google.protobuf import descriptor_pool as _descriptor_pool
|
8
|
-
from google.protobuf import symbol_database as _symbol_database
|
9
|
-
from google.protobuf.internal import builder as _builder
|
10
|
-
# @@protoc_insertion_point(imports)
|
11
|
-
|
12
|
-
_sym_db = _symbol_database.Default()
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x66lwr/proto/recordset.proto\x12\nflwr.proto\"\x1a\n\nDoubleList\x12\x0c\n\x04vals\x18\x01 \x03(\x01\"\x18\n\x08SintList\x12\x0c\n\x04vals\x18\x01 \x03(\x12\"\x18\n\x08UintList\x12\x0c\n\x04vals\x18\x01 \x03(\x04\"\x18\n\x08\x42oolList\x12\x0c\n\x04vals\x18\x01 \x03(\x08\"\x1a\n\nStringList\x12\x0c\n\x04vals\x18\x01 \x03(\t\"\x19\n\tBytesList\x12\x0c\n\x04vals\x18\x01 \x03(\x0c\"B\n\x05\x41rray\x12\r\n\x05\x64type\x18\x01 \x01(\t\x12\r\n\x05shape\x18\x02 \x03(\x05\x12\r\n\x05stype\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\"\xd8\x01\n\x12MetricsRecordValue\x12\x10\n\x06\x64ouble\x18\x01 \x01(\x01H\x00\x12\x10\n\x06sint64\x18\x02 \x01(\x12H\x00\x12\x10\n\x06uint64\x18\x03 \x01(\x04H\x00\x12-\n\x0b\x64ouble_list\x18\x15 \x01(\x0b\x32\x16.flwr.proto.DoubleListH\x00\x12)\n\tsint_list\x18\x16 \x01(\x0b\x32\x14.flwr.proto.SintListH\x00\x12)\n\tuint_list\x18\x17 \x01(\x0b\x32\x14.flwr.proto.UintListH\x00\x42\x07\n\x05value\"\x92\x03\n\x12\x43onfigsRecordValue\x12\x10\n\x06\x64ouble\x18\x01 \x01(\x01H\x00\x12\x10\n\x06sint64\x18\x02 \x01(\x12H\x00\x12\x10\n\x06uint64\x18\x03 \x01(\x04H\x00\x12\x0e\n\x04\x62ool\x18\x04 \x01(\x08H\x00\x12\x10\n\x06string\x18\x05 \x01(\tH\x00\x12\x0f\n\x05\x62ytes\x18\x06 \x01(\x0cH\x00\x12-\n\x0b\x64ouble_list\x18\x15 \x01(\x0b\x32\x16.flwr.proto.DoubleListH\x00\x12)\n\tsint_list\x18\x16 \x01(\x0b\x32\x14.flwr.proto.SintListH\x00\x12)\n\tuint_list\x18\x17 \x01(\x0b\x32\x14.flwr.proto.UintListH\x00\x12)\n\tbool_list\x18\x18 \x01(\x0b\x32\x14.flwr.proto.BoolListH\x00\x12-\n\x0bstring_list\x18\x19 \x01(\x0b\x32\x16.flwr.proto.StringListH\x00\x12+\n\nbytes_list\x18\x1a \x01(\x0b\x32\x15.flwr.proto.BytesListH\x00\x42\x07\n\x05value\"M\n\x10ParametersRecord\x12\x11\n\tdata_keys\x18\x01 \x03(\t\x12&\n\x0b\x64\x61ta_values\x18\x02 \x03(\x0b\x32\x11.flwr.proto.Array\"\x8f\x01\n\rMetricsRecord\x12\x31\n\x04\x64\x61ta\x18\x01 \x03(\x0b\x32#.flwr.proto.MetricsRecord.DataEntry\x1aK\n\tDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12-\n\x05value\x18\x02 \x01(\x0b\x32\x1e.flwr.proto.MetricsRecordValue:\x02\x38\x01\"\x8f\x01\n\rConfigsRecord\x12\x31\n\x04\x64\x61ta\x18\x01 \x03(\x0b\x32#.flwr.proto.ConfigsRecord.DataEntry\x1aK\n\tDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12-\n\x05value\x18\x02 \x01(\x0b\x32\x1e.flwr.proto.ConfigsRecordValue:\x02\x38\x01\"\x97\x03\n\tRecordSet\x12\x39\n\nparameters\x18\x01 \x03(\x0b\x32%.flwr.proto.RecordSet.ParametersEntry\x12\x33\n\x07metrics\x18\x02 \x03(\x0b\x32\".flwr.proto.RecordSet.MetricsEntry\x12\x33\n\x07\x63onfigs\x18\x03 \x03(\x0b\x32\".flwr.proto.RecordSet.ConfigsEntry\x1aO\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1c.flwr.proto.ParametersRecord:\x02\x38\x01\x1aI\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.flwr.proto.MetricsRecord:\x02\x38\x01\x1aI\n\x0c\x43onfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.flwr.proto.ConfigsRecord:\x02\x38\x01\x62\x06proto3')
|
18
|
-
|
19
|
-
_globals = globals()
|
20
|
-
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
21
|
-
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.recordset_pb2', _globals)
|
22
|
-
if _descriptor._USE_C_DESCRIPTORS == False:
|
23
|
-
DESCRIPTOR._options = None
|
24
|
-
_globals['_METRICSRECORD_DATAENTRY']._options = None
|
25
|
-
_globals['_METRICSRECORD_DATAENTRY']._serialized_options = b'8\001'
|
26
|
-
_globals['_CONFIGSRECORD_DATAENTRY']._options = None
|
27
|
-
_globals['_CONFIGSRECORD_DATAENTRY']._serialized_options = b'8\001'
|
28
|
-
_globals['_RECORDSET_PARAMETERSENTRY']._options = None
|
29
|
-
_globals['_RECORDSET_PARAMETERSENTRY']._serialized_options = b'8\001'
|
30
|
-
_globals['_RECORDSET_METRICSENTRY']._options = None
|
31
|
-
_globals['_RECORDSET_METRICSENTRY']._serialized_options = b'8\001'
|
32
|
-
_globals['_RECORDSET_CONFIGSENTRY']._options = None
|
33
|
-
_globals['_RECORDSET_CONFIGSENTRY']._serialized_options = b'8\001'
|
34
|
-
_globals['_DOUBLELIST']._serialized_start=42
|
35
|
-
_globals['_DOUBLELIST']._serialized_end=68
|
36
|
-
_globals['_SINTLIST']._serialized_start=70
|
37
|
-
_globals['_SINTLIST']._serialized_end=94
|
38
|
-
_globals['_UINTLIST']._serialized_start=96
|
39
|
-
_globals['_UINTLIST']._serialized_end=120
|
40
|
-
_globals['_BOOLLIST']._serialized_start=122
|
41
|
-
_globals['_BOOLLIST']._serialized_end=146
|
42
|
-
_globals['_STRINGLIST']._serialized_start=148
|
43
|
-
_globals['_STRINGLIST']._serialized_end=174
|
44
|
-
_globals['_BYTESLIST']._serialized_start=176
|
45
|
-
_globals['_BYTESLIST']._serialized_end=201
|
46
|
-
_globals['_ARRAY']._serialized_start=203
|
47
|
-
_globals['_ARRAY']._serialized_end=269
|
48
|
-
_globals['_METRICSRECORDVALUE']._serialized_start=272
|
49
|
-
_globals['_METRICSRECORDVALUE']._serialized_end=488
|
50
|
-
_globals['_CONFIGSRECORDVALUE']._serialized_start=491
|
51
|
-
_globals['_CONFIGSRECORDVALUE']._serialized_end=893
|
52
|
-
_globals['_PARAMETERSRECORD']._serialized_start=895
|
53
|
-
_globals['_PARAMETERSRECORD']._serialized_end=972
|
54
|
-
_globals['_METRICSRECORD']._serialized_start=975
|
55
|
-
_globals['_METRICSRECORD']._serialized_end=1118
|
56
|
-
_globals['_METRICSRECORD_DATAENTRY']._serialized_start=1043
|
57
|
-
_globals['_METRICSRECORD_DATAENTRY']._serialized_end=1118
|
58
|
-
_globals['_CONFIGSRECORD']._serialized_start=1121
|
59
|
-
_globals['_CONFIGSRECORD']._serialized_end=1264
|
60
|
-
_globals['_CONFIGSRECORD_DATAENTRY']._serialized_start=1189
|
61
|
-
_globals['_CONFIGSRECORD_DATAENTRY']._serialized_end=1264
|
62
|
-
_globals['_RECORDSET']._serialized_start=1267
|
63
|
-
_globals['_RECORDSET']._serialized_end=1674
|
64
|
-
_globals['_RECORDSET_PARAMETERSENTRY']._serialized_start=1445
|
65
|
-
_globals['_RECORDSET_PARAMETERSENTRY']._serialized_end=1524
|
66
|
-
_globals['_RECORDSET_METRICSENTRY']._serialized_start=1526
|
67
|
-
_globals['_RECORDSET_METRICSENTRY']._serialized_end=1599
|
68
|
-
_globals['_RECORDSET_CONFIGSENTRY']._serialized_start=1601
|
69
|
-
_globals['_RECORDSET_CONFIGSENTRY']._serialized_end=1674
|
70
|
-
# @@protoc_insertion_point(module_scope)
|
File without changes
|
File without changes
|
{flwr_nightly-1.17.0.dev20250319.dist-info → flwr_nightly-1.17.0.dev20250321.dist-info}/LICENSE
RENAMED
File without changes
|
{flwr_nightly-1.17.0.dev20250319.dist-info → flwr_nightly-1.17.0.dev20250321.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|