funcnodes-basic 0.1.10__tar.gz → 0.1.11__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.1.10 → funcnodes_basic-0.1.11}/PKG-INFO +1 -1
- {funcnodes_basic-0.1.10 → funcnodes_basic-0.1.11}/funcnodes_basic/__init__.py +1 -1
- {funcnodes_basic-0.1.10 → funcnodes_basic-0.1.11}/funcnodes_basic/lists.py +40 -53
- {funcnodes_basic-0.1.10 → funcnodes_basic-0.1.11}/pyproject.toml +2 -2
- {funcnodes_basic-0.1.10 → funcnodes_basic-0.1.11}/LICENSE +0 -0
- {funcnodes_basic-0.1.10 → funcnodes_basic-0.1.11}/README.md +0 -0
- {funcnodes_basic-0.1.10 → funcnodes_basic-0.1.11}/funcnodes_basic/dicts.py +0 -0
- {funcnodes_basic-0.1.10 → funcnodes_basic-0.1.11}/funcnodes_basic/logic.py +0 -0
- {funcnodes_basic-0.1.10 → funcnodes_basic-0.1.11}/funcnodes_basic/math_nodes.py +0 -0
- {funcnodes_basic-0.1.10 → funcnodes_basic-0.1.11}/funcnodes_basic/strings.py +0 -0
| @@ -11,52 +11,30 @@ def contains(collection: List[Union[str, Any]], item: Union[str, Any]) -> bool: | |
| 11 11 | 
             
                return item in collection
         | 
| 12 12 |  | 
| 13 13 |  | 
| 14 | 
            -
             | 
| 15 | 
            -
                 | 
| 16 | 
            -
                 | 
| 17 | 
            -
                description | 
| 18 | 
            -
                 | 
| 19 | 
            -
                     | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 23 | 
            -
             | 
| 24 | 
            -
             | 
| 25 | 
            -
             | 
| 26 | 
            -
             | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 29 | 
            -
             | 
| 30 | 
            -
                 | 
| 31 | 
            -
             | 
| 32 | 
            -
                     | 
| 33 | 
            -
             | 
| 34 | 
            -
             | 
| 35 | 
            -
             | 
| 36 | 
            -
                 | 
| 37 | 
            -
             | 
| 38 | 
            -
                    self.get_input("inputlist").on("after_set_value", self._update_indices)
         | 
| 39 | 
            -
             | 
| 40 | 
            -
                def _update_indices(self, **kwargs):
         | 
| 41 | 
            -
                    try:
         | 
| 42 | 
            -
                        lst = self.get_input("inputlist").value
         | 
| 43 | 
            -
                        index = self.get_input("index")
         | 
| 44 | 
            -
                    except KeyError:
         | 
| 45 | 
            -
                        return
         | 
| 46 | 
            -
                    try:
         | 
| 47 | 
            -
                        index.update_value_options(min=0, max=len(lst) - 1)
         | 
| 48 | 
            -
                    except Exception:
         | 
| 49 | 
            -
                        index.update_value_options(min=0, max=0)
         | 
| 50 | 
            -
             | 
| 51 | 
            -
                async def func(
         | 
| 52 | 
            -
                    self,
         | 
| 53 | 
            -
                    inputlist: List[Any],
         | 
| 54 | 
            -
                    index: int,
         | 
| 55 | 
            -
                ) -> Any:
         | 
| 56 | 
            -
                    index = int(index)
         | 
| 57 | 
            -
                    ele = inputlist[index]
         | 
| 58 | 
            -
                    self.get_output("element").value = ele
         | 
| 59 | 
            -
                    return ele
         | 
| 14 | 
            +
            @fn.NodeDecorator(
         | 
| 15 | 
            +
                id="list_get",
         | 
| 16 | 
            +
                name="Get Element",
         | 
| 17 | 
            +
                description="Gets an element from a list.",
         | 
| 18 | 
            +
                default_io_options={
         | 
| 19 | 
            +
                    "lst": {
         | 
| 20 | 
            +
                        "on": {
         | 
| 21 | 
            +
                            "after_set_value": fn.decorator.update_other_io_value_options(
         | 
| 22 | 
            +
                                "index",
         | 
| 23 | 
            +
                                lambda result: {
         | 
| 24 | 
            +
                                    "min": -len(result),
         | 
| 25 | 
            +
                                    "max": len(result) - 1 if len(result) > 0 else 0,
         | 
| 26 | 
            +
                                },
         | 
| 27 | 
            +
                            )
         | 
| 28 | 
            +
                        }
         | 
| 29 | 
            +
                    },
         | 
| 30 | 
            +
                },
         | 
| 31 | 
            +
                outputs=[
         | 
| 32 | 
            +
                    {"name": "element"},
         | 
| 33 | 
            +
                ],
         | 
| 34 | 
            +
            )
         | 
| 35 | 
            +
            def list_get(lst: List[Any], index: int = -1) -> Tuple[Any]:
         | 
| 36 | 
            +
                # shallow copy the list
         | 
| 37 | 
            +
                return lst[index]
         | 
| 60 38 |  | 
| 61 39 |  | 
| 62 40 | 
             
            @fn.NodeDecorator(
         | 
| @@ -102,7 +80,10 @@ def list_extend(lst: List[Any], items: List[Any]) -> List[Any]: | |
| 102 80 | 
             
                        "on": {
         | 
| 103 81 | 
             
                            "after_set_value": fn.decorator.update_other_io_value_options(
         | 
| 104 82 | 
             
                                "index",
         | 
| 105 | 
            -
                                lambda result: { | 
| 83 | 
            +
                                lambda result: {
         | 
| 84 | 
            +
                                    "min": -len(result),
         | 
| 85 | 
            +
                                    "max": len(result) - 1 if len(result) > 0 else 0,
         | 
| 86 | 
            +
                                },
         | 
| 106 87 | 
             
                            )
         | 
| 107 88 | 
             
                        }
         | 
| 108 89 | 
             
                    },
         | 
| @@ -112,7 +93,7 @@ def list_extend(lst: List[Any], items: List[Any]) -> List[Any]: | |
| 112 93 | 
             
                    {"name": "item"},
         | 
| 113 94 | 
             
                ],
         | 
| 114 95 | 
             
            )
         | 
| 115 | 
            -
            def list_pop(lst: List[Any], index: int) -> Tuple[List[Any], Any]:
         | 
| 96 | 
            +
            def list_pop(lst: List[Any], index: int = -1) -> Tuple[List[Any], Any]:
         | 
| 116 97 | 
             
                # shallow copy the list
         | 
| 117 98 | 
             
                lst = copy.copy(lst)
         | 
| 118 99 | 
             
                item = lst.pop(index)
         | 
| @@ -177,13 +158,16 @@ def list_count(lst: List[Any], item: Any) -> int: | |
| 177 158 | 
             
                        "on": {
         | 
| 178 159 | 
             
                            "after_set_value": fn.decorator.update_other_io_value_options(
         | 
| 179 160 | 
             
                                "index",
         | 
| 180 | 
            -
                                lambda result: { | 
| 161 | 
            +
                                lambda result: {
         | 
| 162 | 
            +
                                    "min": -len(result),
         | 
| 163 | 
            +
                                    "max": len(result),
         | 
| 164 | 
            +
                                },
         | 
| 181 165 | 
             
                            )
         | 
| 182 166 | 
             
                        }
         | 
| 183 167 | 
             
                    },
         | 
| 184 168 | 
             
                },
         | 
| 185 169 | 
             
            )
         | 
| 186 | 
            -
            def list_insert(lst: List[Any],  | 
| 170 | 
            +
            def list_insert(lst: List[Any], item: Any, index: int = -1) -> List[Any]:
         | 
| 187 171 | 
             
                lst = copy.copy(lst)
         | 
| 188 172 | 
             
                lst.insert(index, item)
         | 
| 189 173 | 
             
                return lst
         | 
| @@ -197,13 +181,16 @@ def list_insert(lst: List[Any], index: int, item: Any) -> List[Any]: | |
| 197 181 | 
             
                        "on": {
         | 
| 198 182 | 
             
                            "after_set_value": fn.decorator.update_other_io_value_options(
         | 
| 199 183 | 
             
                                "index",
         | 
| 200 | 
            -
                                lambda result: { | 
| 184 | 
            +
                                lambda result: {
         | 
| 185 | 
            +
                                    "min": -len(result),
         | 
| 186 | 
            +
                                    "max": len(result) - 1 if len(result) > 0 else 0,
         | 
| 187 | 
            +
                                },
         | 
| 201 188 | 
             
                            )
         | 
| 202 189 | 
             
                        }
         | 
| 203 190 | 
             
                    },
         | 
| 204 191 | 
             
                },
         | 
| 205 192 | 
             
            )
         | 
| 206 | 
            -
            def list_set(lst: List[Any],  | 
| 193 | 
            +
            def list_set(lst: List[Any], item: Any, index: int = -1) -> List[Any]:
         | 
| 207 194 | 
             
                lst = copy.copy(lst)
         | 
| 208 195 | 
             
                lst[index] = item
         | 
| 209 196 | 
             
                return lst
         | 
| @@ -250,7 +237,7 @@ def list_slice_step( | |
| 250 237 | 
             
            NODE_SHELF = fn.Shelf(
         | 
| 251 238 | 
             
                nodes=[
         | 
| 252 239 | 
             
                    contains,
         | 
| 253 | 
            -
                     | 
| 240 | 
            +
                    list_get,
         | 
| 254 241 | 
             
                    to_list,
         | 
| 255 242 | 
             
                    list_length,
         | 
| 256 243 | 
             
                    list_append,
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            [tool.poetry]
         | 
| 2 2 | 
             
            name = "funcnodes-basic"
         | 
| 3 | 
            -
            version = "0.1. | 
| 3 | 
            +
            version = "0.1.11"
         | 
| 4 4 | 
             
            description = "Basic functionalities for funcnodes"
         | 
| 5 5 | 
             
            authors = ["Julian Kimmig <julian.kimmig@gmx.net>"]
         | 
| 6 6 | 
             
            readme = "README.md"
         | 
| @@ -21,7 +21,7 @@ funcnodes = "*" | |
| 21 21 | 
             
            [tool.poetry.group.dev.dependencies]
         | 
| 22 22 | 
             
            pytest = "*"
         | 
| 23 23 | 
             
            pre-commit = "*"
         | 
| 24 | 
            -
            funcnodes-module = " | 
| 24 | 
            +
            funcnodes-module = "^0.1.19"
         | 
| 25 25 |  | 
| 26 26 | 
             
            [build-system]
         | 
| 27 27 | 
             
            requires = ["poetry-core"]
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| 
            File without changes
         |