syft-flwr 0.1.1__tar.gz → 0.1.2__tar.gz

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.

Potentially problematic release.


This version of syft-flwr might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syft-flwr
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: syft_flwr is an open source framework that facilitate federated learning projects using Flower over the SyftBox protocol
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.9.2
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "syft-flwr"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  description = "syft_flwr is an open source framework that facilitate federated learning projects using Flower over the SyftBox protocol"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.9.2"
@@ -1,4 +1,4 @@
1
- __version__ = "0.1.1"
1
+ __version__ = "0.1.2"
2
2
 
3
3
  from syft_flwr.bootstrap import bootstrap
4
4
  from syft_flwr.run import run
@@ -1,16 +1,17 @@
1
+ import os
1
2
  import time
2
3
  from typing import Iterable, cast
3
4
 
4
- from loguru import logger
5
- from syft_core import Client
6
- from syft_rpc import rpc, rpc_db
7
- from typing_extensions import Optional
8
-
9
5
  from flwr.common import ConfigRecord
10
6
  from flwr.common.constant import MessageType
11
7
  from flwr.common.message import Message
12
8
  from flwr.common.typing import Run
13
9
  from flwr.proto.node_pb2 import Node # pylint: disable=E0611
10
+ from loguru import logger
11
+ from syft_core import Client
12
+ from syft_rpc import rpc, rpc_db
13
+ from typing_extensions import Optional
14
+
14
15
  from syft_flwr.flwr_compatibility import (
15
16
  Grid,
16
17
  RecordDict,
@@ -24,6 +25,10 @@ from syft_flwr.utils import str_to_int
24
25
  AGGREGATOR_NODE_ID = 1
25
26
 
26
27
 
28
+ # env vars
29
+ SYFT_FLWR_MSG_TIMEOUT = "SYFT_FLWR_MSG_TIMEOUT"
30
+
31
+
27
32
  class SyftGrid(Grid):
28
33
  def __init__(
29
34
  self,
@@ -155,7 +160,7 @@ class SyftGrid(Grid):
155
160
  self,
156
161
  messages: Iterable[Message],
157
162
  *,
158
- timeout: Optional[float] = 60,
163
+ timeout: Optional[float] = None,
159
164
  ) -> Iterable[Message]:
160
165
  """Push messages to specified node IDs and pull the reply messages.
161
166
 
@@ -163,6 +168,17 @@ class SyftGrid(Grid):
163
168
  waits for the replies. It continues to pull replies until either all replies are
164
169
  received or the specified timeout duration (in seconds) is exceeded.
165
170
  """
171
+ if os.environ.get(SYFT_FLWR_MSG_TIMEOUT) is not None:
172
+ timeout = float(os.environ.get(SYFT_FLWR_MSG_TIMEOUT))
173
+ if timeout is not None:
174
+ logger.debug(
175
+ f"syft_flwr messages timeout = {timeout}: Will move on after {timeout} (s) if no reply is received"
176
+ )
177
+ else:
178
+ logger.debug(
179
+ "syft_flwr messages timeout = None: Will wait indefinitely for replies"
180
+ )
181
+
166
182
  # Push messages
167
183
  msg_ids = set(self.push_messages(messages))
168
184
 
File without changes
File without changes
File without changes