diff --git a/pyproject.toml b/pyproject.toml index ba588ff..fcf3b52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "basic_data_handling" -version = "0.4.1" +version = "0.4.2" description = """Basic Python functions for manipulating data that every programmer is used to. Comprehensive node collection for data manipulation in ComfyUI workflows. diff --git a/src/basic_data_handling/control_flow_nodes.py b/src/basic_data_handling/control_flow_nodes.py index 772d622..64fa3ed 100644 --- a/src/basic_data_handling/control_flow_nodes.py +++ b/src/basic_data_handling/control_flow_nodes.py @@ -188,7 +188,7 @@ def check_lazy_status(self, select: int, **kwargs) -> list[str]: return needed - def execute(self, selector: int, **kwargs) -> tuple[Any]: + def execute(self, select: int, **kwargs) -> tuple[Any]: # Build a case array from all case_X inputs cases = [] for i in range(len(kwargs)): @@ -199,8 +199,8 @@ def execute(self, selector: int, **kwargs) -> tuple[Any]: break # Return the selected case if valid - if 0 <= selector < len(cases) and cases[selector] is not None: - return (cases[selector],) + if 0 <= select < len(cases) and cases[select] is not None: + return (cases[select],) # If select is out of range or the selected case is None, return default return (kwargs.get("default"),) @@ -229,10 +229,6 @@ def INPUT_TYPES(cls): DESCRIPTION = cleandoc(__doc__ or "") FUNCTION = "execute" - @classmethod - def IS_CHANGED(s, value: Any): - return float("NaN") # not equal to anything -> trigger recalculation - def execute(self, value: Any, select: bool = True) -> tuple[Any]: if select: return (value,) @@ -296,6 +292,10 @@ def INPUT_TYPES(cls): DESCRIPTION = cleandoc(__doc__ or "") FUNCTION = "execute" + @classmethod + def IS_CHANGED(s, value: Any): + return float("NaN") # not equal to anything -> trigger recalculation + def execute(self, value: Any) -> tuple[Any, int]: return (value,)