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.
- {funcnodes_basic-0.2.3/src/funcnodes_basic.egg-info → funcnodes_basic-0.2.4}/PKG-INFO +2 -2
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/pyproject.toml +9 -2
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/logic.py +29 -6
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4/src/funcnodes_basic.egg-info}/PKG-INFO +2 -2
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic.egg-info/SOURCES.txt +1 -0
- funcnodes_basic-0.2.4/src/funcnodes_basic.egg-info/requires.txt +2 -0
- funcnodes_basic-0.2.4/tests/test_flows.py +26 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_logic.py +5 -1
- funcnodes_basic-0.2.3/src/funcnodes_basic.egg-info/requires.txt +0 -2
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/LICENSE +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/MANIFEST.in +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/README.md +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/setup.cfg +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/__init__.py +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/dataclass.py +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/dicts.py +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/input.py +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/lists.py +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/math_nodes.py +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic/strings.py +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic.egg-info/dependency_links.txt +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic.egg-info/entry_points.txt +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic.egg-info/top_level.txt +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_all_nodes_pytest.py +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_dataclass.py +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_dict.py +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_import.py +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_inputs.py +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_lists.py +0 -0
- {funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/tests/test_math.py +0 -0
- {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
|
+
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.
|
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
|
+
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.
|
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
|
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
|
-
|
39
|
-
|
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=
|
98
|
-
|
99
|
-
|
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
|
+
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.
|
15
|
+
Requires-Dist: funcnodes-core>=0.4.1
|
16
16
|
Requires-Dist: funcnodes
|
17
17
|
Dynamic: license-file
|
18
18
|
|
@@ -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
|
-
|
50
|
+
|
47
51
|
await node
|
48
52
|
|
49
53
|
assert node.outputs["done"].value == ["h", "e", "l", "l", "o"]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic.egg-info/dependency_links.txt
RENAMED
File without changes
|
{funcnodes_basic-0.2.3 → funcnodes_basic-0.2.4}/src/funcnodes_basic.egg-info/entry_points.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|