funcnodes-basic 0.2.3__tar.gz → 0.2.4__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.
Files changed (31) hide show
  1. {funcnodes_basic-0.2.3/src/funcnodes_basic.egg-info → funcnodes_basic-0.2.4}/PKG-INFO +2 -2
  2. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/pyproject.toml +9 -2
  3. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/logic.py +29 -6
  4. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4/src/funcnodes_basic.egg-info}/PKG-INFO +2 -2
  5. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic.egg-info/SOURCES.txt +1 -0
  6. funcnodes_basic-0.2.4/src/funcnodes_basic.egg-info/requires.txt +2 -0
  7. funcnodes_basic-0.2.4/tests/test_flows.py +26 -0
  8. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_logic.py +5 -1
  9. funcnodes_basic-0.2.3/src/funcnodes_basic.egg-info/requires.txt +0 -2
  10. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/LICENSE +0 -0
  11. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/MANIFEST.in +0 -0
  12. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/README.md +0 -0
  13. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/setup.cfg +0 -0
  14. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/__init__.py +0 -0
  15. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/dataclass.py +0 -0
  16. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/dicts.py +0 -0
  17. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/input.py +0 -0
  18. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/lists.py +0 -0
  19. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/math_nodes.py +0 -0
  20. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/strings.py +0 -0
  21. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic.egg-info/dependency_links.txt +0 -0
  22. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic.egg-info/entry_points.txt +0 -0
  23. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic.egg-info/top_level.txt +0 -0
  24. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_all_nodes_pytest.py +0 -0
  25. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_dataclass.py +0 -0
  26. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_dict.py +0 -0
  27. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_import.py +0 -0
  28. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_inputs.py +0 -0
  29. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_lists.py +0 -0
  30. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_math.py +0 -0
  31. {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_strings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: funcnodes-basic
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Basic functionalities for funcnodes
5
5
  Author-email: Julian Kimmig <julian.kimmig@linkdlab.de>
6
6
  License: AGPL-3.0
@@ -12,7 +12,7 @@ Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or l
12
12
  Requires-Python: >=3.11
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: funcnodes-core>=0.3.9
15
+ Requires-Dist: funcnodes-core>=0.4.1
16
16
  Requires-Dist: funcnodes
17
17
  Dynamic: license-file
18
18
 
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "funcnodes-basic"
3
- version = "0.2.3"
3
+ version = "0.2.4"
4
4
  description = "Basic functionalities for funcnodes"
5
5
  readme = "README.md"
6
6
  classifiers = [ "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",]
7
7
  requires-python = ">=3.11"
8
8
  dependencies = [
9
- "funcnodes-core>=0.3.9",
9
+ "funcnodes-core>=0.4.1",
10
10
  "funcnodes",
11
11
  ]
12
12
  authors = [{name = "Julian Kimmig", email = "julian.kimmig@linkdlab.de"}]
@@ -43,3 +43,10 @@ shelf = "funcnodes_basic:NODE_SHELF"
43
43
 
44
44
  [tool.setuptools.packages.find]
45
45
  where = [ "src",]
46
+
47
+ [tool.commitizen]
48
+ name = "cz_conventional_commits"
49
+ tag_format = "v$version"
50
+ version_scheme = "pep440"
51
+ version_provider = "uv"
52
+ update_changelog_on_bump = true
@@ -1,6 +1,6 @@
1
1
  """Logic Nodes for control flow and decision making."""
2
2
 
3
- from funcnodes_core.node import Node, TriggerStack
3
+ from funcnodes_core.node import Node
4
4
  from typing import Any, List, Optional
5
5
  from funcnodes_core.io import NodeInput, NodeOutput, NoValue
6
6
  import asyncio
@@ -35,8 +35,19 @@ class WhileNode(Node):
35
35
  async def func(self, condition: bool, input: Any) -> None:
36
36
  if self.inputs["condition"].value:
37
37
  self.outputs["do"].value = input
38
- triggerstack = TriggerStack()
39
- await self.outputs["do"].trigger(triggerstack)
38
+ datapaths = [
39
+ ip.datapath
40
+ for ip in self.outputs["do"].connections
41
+ if ip.datapath is not None
42
+ ]
43
+
44
+ while datapaths:
45
+ for dp in datapaths:
46
+ if dp.done(breaking_nodes=[self]):
47
+ datapaths.remove(dp)
48
+ break
49
+ else:
50
+ await asyncio.sleep(0.1)
40
51
  self.request_trigger()
41
52
  else:
42
53
  self.outputs["done"].value = input
@@ -94,9 +105,21 @@ class ForNode(Node):
94
105
  pass
95
106
 
96
107
  for i in self.progress(input, desc="Iterating", unit="it", total=iplen):
97
- self.outputs["do"].set_value(i, does_trigger=False)
98
- triggerstack = TriggerStack()
99
- await self.outputs["do"].trigger(triggerstack)
108
+ self.outputs["do"].set_value(i, does_trigger=True)
109
+ datapaths = [
110
+ ip.datapath
111
+ for ip in self.outputs["do"].connections
112
+ if ip.datapath is not None
113
+ ]
114
+
115
+ while datapaths:
116
+ for dp in datapaths:
117
+ if dp.done(breaking_nodes=[self]):
118
+ datapaths.remove(dp)
119
+ break
120
+ else:
121
+ await asyncio.sleep(0.1)
122
+
100
123
  v = self.inputs["collector"].value
101
124
  if v is not NoValue:
102
125
  results.append(v)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: funcnodes-basic
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Basic functionalities for funcnodes
5
5
  Author-email: Julian Kimmig <julian.kimmig@linkdlab.de>
6
6
  License: AGPL-3.0
@@ -12,7 +12,7 @@ Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or l
12
12
  Requires-Python: >=3.11
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: funcnodes-core>=0.3.9
15
+ Requires-Dist: funcnodes-core>=0.4.1
16
16
  Requires-Dist: funcnodes
17
17
  Dynamic: license-file
18
18
 
@@ -19,6 +19,7 @@ src/funcnodes_basic.egg-info/top_level.txt
19
19
  tests/test_all_nodes_pytest.py
20
20
  tests/test_dataclass.py
21
21
  tests/test_dict.py
22
+ tests/test_flows.py
22
23
  tests/test_import.py
23
24
  tests/test_inputs.py
24
25
  tests/test_lists.py
@@ -0,0 +1,2 @@
1
+ funcnodes-core>=0.4.1
2
+ funcnodes
@@ -0,0 +1,26 @@
1
+ from funcnodes_basic import logic, strings
2
+ import pytest_funcnodes
3
+ import asyncio
4
+
5
+
6
+ @pytest_funcnodes.nodetest(logic.ForNode)
7
+ async def test_if_node_flow1():
8
+ fornode = logic.ForNode()
9
+ endswith = strings.string_endswith()
10
+ ifnode = logic.IfNode()
11
+
12
+ fornode.outputs["do"].connect(endswith.inputs["s"])
13
+ endswith.outputs["ends_with"].connect(ifnode.inputs["condition"])
14
+ fornode.outputs["do"].connect(ifnode.inputs["input"])
15
+ ifnode.outputs["on_true"].connect(fornode.inputs["collector"])
16
+
17
+ endswith.inputs["suffix"].value = ".txt"
18
+ fornode.inputs["input"].value = ["a.txt", "b.xls", "c.xls", "d.txt", "e.xls"]
19
+
20
+ # await fn.run_until_complete(fornode, ifnode, endswith)
21
+ await asyncio.sleep(1.5)
22
+ print("fornode:", fornode.in_trigger)
23
+ print("ifnode:", ifnode.in_trigger)
24
+ print("endswith:", endswith.in_trigger)
25
+
26
+ assert fornode.outputs["done"].value == ["a.txt", "d.txt"]
@@ -42,8 +42,12 @@ async def test_wait_node():
42
42
  @pytest_funcnodes.nodetest(logic.ForNode)
43
43
  async def test_for_node():
44
44
  node = logic.ForNode()
45
+ waitnode = logic.WaitNode()
46
+ waitnode.inputs["delay"].value = 0.5
47
+ waitnode.inputs["input"].connect(node.outputs["do"])
48
+ waitnode.outputs["output"].connect(node.inputs["collector"])
45
49
  node.inputs["input"].value = "hello"
46
- node.outputs["do"].connect(node.inputs["collector"])
50
+
47
51
  await node
48
52
 
49
53
  assert node.outputs["done"].value == ["h", "e", "l", "l", "o"]
@@ -1,2 +0,0 @@
1
- funcnodes-core>=0.3.9
2
- funcnodes
File without changes