graphai-lib 0.0.9rc1__py3-none-any.whl → 0.0.9rc2__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.
graphai/graph.py CHANGED
@@ -1,6 +1,5 @@
1
1
  from __future__ import annotations
2
- from typing import Any, Protocol, Type
3
- from graphlib import TopologicalSorter, CycleError
2
+ from typing import Any, Protocol
4
3
  from graphai.callback import Callback
5
4
  from graphai.utils import logger
6
5
 
@@ -63,7 +62,7 @@ class Graph:
63
62
  self.edges: list[Any] = []
64
63
  self.start_node: NodeProtocol | None = None
65
64
  self.end_nodes: list[NodeProtocol] = []
66
- self.Callback: Type[Callback] = Callback
65
+ self.Callback: type[Callback] = Callback
67
66
  self.max_steps = max_steps
68
67
  self.state = initial_state or {}
69
68
 
@@ -288,17 +287,6 @@ class Graph:
288
287
  "(src, Iterable[dst]), mapping{'source'/'destination'}, or objects with .source/.destination"
289
288
  )
290
289
 
291
- # cycle detection
292
- preds: dict[str, set[str]] = {n: set() for n in nodes.keys()}
293
- for s, ds in adj.items():
294
- for d in ds:
295
- preds[d].add(s)
296
-
297
- try:
298
- list(TopologicalSorter(preds).static_order())
299
- except CycleError as e:
300
- raise GraphCompileError("Cycle detected in graph") from e
301
-
302
290
  # reachability from start
303
291
  seen: set[str] = set()
304
292
  stack = [start_name]
@@ -388,7 +376,7 @@ class Graph:
388
376
  as the default callback when no callback is passed to the `execute` method.
389
377
 
390
378
  :param callback_class: The callback class to use as the default callback.
391
- :type callback_class: Type[Callback]
379
+ :type callback_class: type[Callback]
392
380
  """
393
381
  self.Callback = callback_class
394
382
  return self
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graphai-lib
3
- Version: 0.0.9rc1
3
+ Version: 0.0.9rc2
4
4
  Summary: Not an AI framework
5
5
  Requires-Python: <3.14,>=3.10
6
6
  Description-Content-Type: text/markdown
@@ -1,11 +1,11 @@
1
1
  graphai/__init__.py,sha256=UbqXq7iGIYe1GyTPcpgLSXbgWovggFsAbTMtr4JQm3M,160
2
2
  graphai/callback.py,sha256=Wl0JCmE8NcFifKmP9-a5bFa0WKVHTdrSClHVRmIEPpc,7323
3
- graphai/graph.py,sha256=Bm_Jwa5EMUACqXTZSoibVQfHSwS1rV-ExfxqYRIkPDY,18944
3
+ graphai/graph.py,sha256=O0hZ_29ln8oTYnk5EX5bdhO6-Cr9pm-6IVCq-ZPWbgY,18526
4
4
  graphai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  graphai/utils.py,sha256=LIFg-fQalU9sB5DCuk6is48OdpEgNX95i9h-YddFbvM,11717
6
6
  graphai/nodes/__init__.py,sha256=IaMUryAqTZlcEqh-ZS6A4NIYG18JZwzo145dzxsYjAk,74
7
7
  graphai/nodes/base.py,sha256=SoKfOdRu5EIJ_z8xIz5zbNXcxPI2l9MKTQDeaQI-2no,7494
8
- graphai_lib-0.0.9rc1.dist-info/METADATA,sha256=T8nS6wOKwd7ZfzVvD_h4m38bowb9zzr7TutdIz5GWJQ,913
9
- graphai_lib-0.0.9rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
- graphai_lib-0.0.9rc1.dist-info/top_level.txt,sha256=TXlqmhLViX-3xGH2g5w6cavRd-QMf229Hl88jdMOGt8,8
11
- graphai_lib-0.0.9rc1.dist-info/RECORD,,
8
+ graphai_lib-0.0.9rc2.dist-info/METADATA,sha256=_3lwoAyLzSSgFq8GQHW_FAGd6A0kKiGQB3XWCnirJRs,913
9
+ graphai_lib-0.0.9rc2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
+ graphai_lib-0.0.9rc2.dist-info/top_level.txt,sha256=TXlqmhLViX-3xGH2g5w6cavRd-QMf229Hl88jdMOGt8,8
11
+ graphai_lib-0.0.9rc2.dist-info/RECORD,,