vectorvein 0.2.72__py3-none-any.whl → 0.2.73__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.
@@ -12,6 +12,7 @@ from ..utils.check import (
12
12
  check_useless_nodes,
13
13
  check_required_ports,
14
14
  check_override_ports,
15
+ check_output_nodes_with_no_inputs,
15
16
  )
16
17
 
17
18
 
@@ -138,6 +139,7 @@ class Workflow:
138
139
  useless_nodes = check_useless_nodes(self)
139
140
  required_ports = check_required_ports(self)
140
141
  override_ports = check_override_ports(self)
142
+ output_nodes_with_no_inputs = check_output_nodes_with_no_inputs(self)
141
143
 
142
144
  # 合并结果
143
145
  result: WorkflowCheckResult = {
@@ -147,6 +149,7 @@ class Workflow:
147
149
  "useless_nodes": useless_nodes,
148
150
  "required_ports": required_ports,
149
151
  "override_ports": override_ports,
152
+ "output_nodes_with_no_inputs": output_nodes_with_no_inputs,
150
153
  }
151
154
 
152
155
  return result
@@ -25,6 +25,7 @@ class WorkflowCheckResult(TypedDict):
25
25
  ui_warnings: UIWarning # UI相关警告
26
26
  required_ports: list[tuple["Node", "Port"]] # 未连接的必填端口
27
27
  override_ports: list[tuple["Node", "Port"]] # 被覆盖的端口
28
+ output_nodes_with_no_inputs: list["Node"] # 输出端口没有输入端口连接的节点
28
29
 
29
30
 
30
31
  def check_dag(workflow: "Workflow"):
@@ -259,3 +260,30 @@ def check_override_ports(workflow: "Workflow") -> list[tuple["Node", "Port"]]:
259
260
  override_ports.append((node, port))
260
261
 
261
262
  return override_ports
263
+
264
+
265
+ def check_output_nodes_with_no_inputs(workflow: "Workflow") -> list["Node"]:
266
+ """检查工作流中是否存在输出端口没有输入端口连接的节点。"""
267
+ output_nodes_with_no_inputs = []
268
+
269
+ # 找出所有连接的目标节点和端口
270
+ connected_targets = {(edge.target, edge.target_handle) for edge in workflow.edges}
271
+
272
+ # 遍历所有节点
273
+ for node in workflow.nodes:
274
+ # 只检查输出类节点
275
+ if hasattr(node, "category") and node.category == "outputs":
276
+ # 检查该节点是否有任何连接到其输入端口的边
277
+ has_input_connection = False
278
+
279
+ for port_name, port in node.ports.items():
280
+ if isinstance(port, InputPort):
281
+ if (node.id, port_name) in connected_targets:
282
+ has_input_connection = True
283
+ break
284
+
285
+ # 如果该输出节点没有任何输入连接,则添加到结果列表
286
+ if not has_input_connection:
287
+ output_nodes_with_no_inputs.append(node)
288
+
289
+ return output_nodes_with_no_inputs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vectorvein
3
- Version: 0.2.72
3
+ Version: 0.2.73
4
4
  Summary: VectorVein Python SDK
5
5
  Author-Email: Anderson <andersonby@163.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
- vectorvein-0.2.72.dist-info/METADATA,sha256=fGLLu8Cei9gwg5NMqsyJJ5vjbwQ_dt1cUXuSVVzNIXs,4567
2
- vectorvein-0.2.72.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- vectorvein-0.2.72.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1
+ vectorvein-0.2.73.dist-info/METADATA,sha256=yaqLz75aYE8rn08n3g6P9vtgDNvfKABgOvarlYqOjME,4567
2
+ vectorvein-0.2.73.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ vectorvein-0.2.73.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
4
  vectorvein/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  vectorvein/api/__init__.py,sha256=lfY-XA46fgD2iIZTU0VYP8i07AwA03Egj4Qua0vUKrQ,738
6
6
  vectorvein/api/client.py,sha256=xF-leKDQzVyyy9FnIRaz0k4eElYW1XbbzeRLcpnyk90,33047
@@ -44,7 +44,7 @@ vectorvein/utilities/retry.py,sha256=6KFS9R2HdhqM3_9jkjD4F36ZSpEx2YNFGOVlpOsUetM
44
44
  vectorvein/workflow/graph/edge.py,sha256=1ckyyjCue_PLm7P1ItUfKOy6AKkemOpZ9m1WJ8UXIHQ,1072
45
45
  vectorvein/workflow/graph/node.py,sha256=WtO4MkeMQr59zNl9N2ZoYiCZcVKxebSp1rKMPONmfqk,5628
46
46
  vectorvein/workflow/graph/port.py,sha256=HcinzQqNP7ysTvBmi3c4iaWne8nV6m-BpFFX0jTrMIE,7122
47
- vectorvein/workflow/graph/workflow.py,sha256=TfBvuspF1uHxmZl4VThgsXA07xiPvMT_mzd1oUvZ9Ww,14600
47
+ vectorvein/workflow/graph/workflow.py,sha256=vQuAV1fNsq12D8HCbU_Aa3kG9AUHJO6EjvW9JjnAKHc,14792
48
48
  vectorvein/workflow/nodes/__init__.py,sha256=dWrWtL3q0Vsn-MLgJ7gNgLCrwZ5BrqjrN2QFPNeBMuc,3240
49
49
  vectorvein/workflow/nodes/audio_generation.py,sha256=ZRFZ_ycMTSJ2LKmekctagQdJYTl-3q4TNOIKETpS9AM,5870
50
50
  vectorvein/workflow/nodes/control_flows.py,sha256=fDySWek8Isbfznwn0thmbTwTP4c99w68Up9dlASAtIo,6805
@@ -62,7 +62,7 @@ vectorvein/workflow/nodes/vector_db.py,sha256=p9AT_E8ASbcYHZqHYTCIGvqkIqzxaFM4Ux
62
62
  vectorvein/workflow/nodes/video_generation.py,sha256=qmdg-t_idpxq1veukd-jv_ChICMOoInKxprV9Z4Vi2w,4118
63
63
  vectorvein/workflow/nodes/web_crawlers.py,sha256=FB0bTimkk___p3Z5UwQx2YarJyQCc45jjnbXbgGA_qw,5640
64
64
  vectorvein/workflow/utils/analyse.py,sha256=msmvyz35UTYTwqQR5sg9H0sm1vxmGDSmep9XxUrHvE0,14837
65
- vectorvein/workflow/utils/check.py,sha256=Oj_S5WQf4_Fr_ro3ipjZt9unKFSFcuwZrrSmrS9kVLE,10193
65
+ vectorvein/workflow/utils/check.py,sha256=B_NdwqIqnc7Ko2HHqFpfOmWVaAu21tPITe0szKfiZKc,11414
66
66
  vectorvein/workflow/utils/json_to_code.py,sha256=P8dhhSNgKhTnW17qXNjLO2aLdb0rA8qMAWxhObol2TU,7295
67
67
  vectorvein/workflow/utils/layout.py,sha256=j0bRD3uaXu40xCS6U6BGahBI8FrHa5MiF55GbTrZ1LM,4565
68
- vectorvein-0.2.72.dist-info/RECORD,,
68
+ vectorvein-0.2.73.dist-info/RECORD,,