Try to make unique node names
This commit is contained in:
@@ -155,10 +155,3 @@ ComfyUI has different data types that serve different purposes:
|
||||
- Allow nodes to iterate through your items automatically
|
||||
- Connect to nodes that expect individual inputs
|
||||
- Perform batch processing operations
|
||||
|
||||
## Tests
|
||||
|
||||
This repo contains unit tests written in Pytest in the `tests/` directory. It is recommended to unit test your custom node.
|
||||
|
||||
- [build-pipeline.yml](.github/workflows/build-pipeline.yml) will run pytest and linter on any open PRs
|
||||
- [validate.yml](.github/workflows/validate.yml) will run [node-diff](https://github.com/Comfy-Org/node-diff) to check for breaking changes
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "basic_data_handling"
|
||||
version = "0.0.9"
|
||||
version = "0.0.10"
|
||||
description = """NOTE: Still in development! Expect breaking changes!
|
||||
Basic Python functions for manipulating data that every programmer is used to.
|
||||
Currently supported ComfyUI data types: BOOLEAN, FLOAT, INT, STRING and data lists.
|
||||
|
||||
@@ -79,7 +79,7 @@ class StringCenter:
|
||||
return (string.center(width, fillchar),)
|
||||
|
||||
|
||||
class DataStringConcat:
|
||||
class StringConcat:
|
||||
"""Combines two text strings together, joining them end-to-end."""
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
@@ -1214,92 +1214,92 @@ class StringZfill:
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"StringCapitalize": StringCapitalize,
|
||||
"StringCasefold": StringCasefold,
|
||||
"StringCenter": StringCenter,
|
||||
"DataStringConcat": DataStringConcat,
|
||||
"StringCount": StringCount,
|
||||
"StringDecode": StringDecode,
|
||||
"StringEncode": StringEncode,
|
||||
"StringExpandtabs": StringExpandtabs,
|
||||
"StringEndswith": StringEndswith,
|
||||
"StringFind": StringFind,
|
||||
"StringFormatMap": StringFormatMap,
|
||||
"StringIsAlnum": StringIsAlnum,
|
||||
"StringIsAlpha": StringIsAlpha,
|
||||
"StringIsAscii": StringIsAscii,
|
||||
"StringIsDecimal": StringIsDecimal,
|
||||
"StringIsDigit": StringIsDigit,
|
||||
"StringIsIdentifier": StringIsIdentifier,
|
||||
"StringIsLower": StringIsLower,
|
||||
"StringIsNumeric": StringIsNumeric,
|
||||
"StringIsPrintable": StringIsPrintable,
|
||||
"StringIsSpace": StringIsSpace,
|
||||
"StringIsTitle": StringIsTitle,
|
||||
"StringIsUpper": StringIsUpper,
|
||||
"StringJoin": StringJoin,
|
||||
"StringLjust": StringLjust,
|
||||
"StringLower": StringLower,
|
||||
"StringLstrip": StringLstrip,
|
||||
"StringRemoveprefix": StringRemoveprefix,
|
||||
"StringRemovesuffix": StringRemovesuffix,
|
||||
"StringReplace": StringReplace,
|
||||
"StringRfind": StringRfind,
|
||||
"StringRjust": StringRjust,
|
||||
"StringRsplit": StringRsplit,
|
||||
"StringRstrip": StringRstrip,
|
||||
"StringSplit": StringSplit,
|
||||
"StringSplitlines": StringSplitlines,
|
||||
"StringStartswith": StringStartswith,
|
||||
"StringStrip": StringStrip,
|
||||
"StringSwapcase": StringSwapcase,
|
||||
"StringTitle": StringTitle,
|
||||
"StringUpper": StringUpper,
|
||||
"StringZfill": StringZfill,
|
||||
"Basic data handling: StringCapitalize": StringCapitalize,
|
||||
"Basic data handling: StringCasefold": StringCasefold,
|
||||
"Basic data handling: StringCenter": StringCenter,
|
||||
"Basic data handling: StringConcat": StringConcat,
|
||||
"Basic data handling: StringCount": StringCount,
|
||||
"Basic data handling: StringDecode": StringDecode,
|
||||
"Basic data handling: StringEncode": StringEncode,
|
||||
"Basic data handling: StringExpandtabs": StringExpandtabs,
|
||||
"Basic data handling: StringEndswith": StringEndswith,
|
||||
"Basic data handling: StringFind": StringFind,
|
||||
"Basic data handling: StringFormatMap": StringFormatMap,
|
||||
"Basic data handling: StringIsAlnum": StringIsAlnum,
|
||||
"Basic data handling: StringIsAlpha": StringIsAlpha,
|
||||
"Basic data handling: StringIsAscii": StringIsAscii,
|
||||
"Basic data handling: StringIsDecimal": StringIsDecimal,
|
||||
"Basic data handling: StringIsDigit": StringIsDigit,
|
||||
"Basic data handling: StringIsIdentifier": StringIsIdentifier,
|
||||
"Basic data handling: StringIsLower": StringIsLower,
|
||||
"Basic data handling: StringIsNumeric": StringIsNumeric,
|
||||
"Basic data handling: StringIsPrintable": StringIsPrintable,
|
||||
"Basic data handling: StringIsSpace": StringIsSpace,
|
||||
"Basic data handling: StringIsTitle": StringIsTitle,
|
||||
"Basic data handling: StringIsUpper": StringIsUpper,
|
||||
"Basic data handling: StringJoin": StringJoin,
|
||||
"Basic data handling: StringLjust": StringLjust,
|
||||
"Basic data handling: StringLower": StringLower,
|
||||
"Basic data handling: StringLstrip": StringLstrip,
|
||||
"Basic data handling: StringRemoveprefix": StringRemoveprefix,
|
||||
"Basic data handling: StringRemovesuffix": StringRemovesuffix,
|
||||
"Basic data handling: StringReplace": StringReplace,
|
||||
"Basic data handling: StringRfind": StringRfind,
|
||||
"Basic data handling: StringRjust": StringRjust,
|
||||
"Basic data handling: StringRsplit": StringRsplit,
|
||||
"Basic data handling: StringRstrip": StringRstrip,
|
||||
"Basic data handling: StringSplit": StringSplit,
|
||||
"Basic data handling: StringSplitlines": StringSplitlines,
|
||||
"Basic data handling: StringStartswith": StringStartswith,
|
||||
"Basic data handling: StringStrip": StringStrip,
|
||||
"Basic data handling: StringSwapcase": StringSwapcase,
|
||||
"Basic data handling: StringTitle": StringTitle,
|
||||
"Basic data handling: StringUpper": StringUpper,
|
||||
"Basic data handling: StringZfill": StringZfill,
|
||||
}
|
||||
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"StringCapitalize": "capitalize",
|
||||
"StringCasefold": "casefold",
|
||||
"StringCenter": "center",
|
||||
"DataStringConcat": "concat",
|
||||
"StringCount": "count",
|
||||
"StringDecode": "decode",
|
||||
"StringEncode": "encode",
|
||||
"StringExpandtabs": "expandtabs",
|
||||
"StringEndswith": "endswith",
|
||||
"StringFind": "find",
|
||||
"StringFormatMap": "format_map",
|
||||
"StringIn": "in (contains)",
|
||||
"StringIsAlnum": "isalnum",
|
||||
"StringIsAlpha": "isalpha",
|
||||
"StringIsAscii": "isascii",
|
||||
"StringIsDecimal": "isdecimal",
|
||||
"StringIsDigit": "isdigit",
|
||||
"StringIsIdentifier": "isidentifier",
|
||||
"StringIsLower": "islower",
|
||||
"StringIsNumeric": "isnumeric",
|
||||
"StringIsPrintable": "isprintable",
|
||||
"StringIsSpace": "isspace",
|
||||
"StringIsTitle": "istitle",
|
||||
"StringIsUpper": "isupper",
|
||||
"StringJoin": "join",
|
||||
"StringLjust": "ljust",
|
||||
"StringLower": "lower",
|
||||
"StringLstrip": "lstrip",
|
||||
"StringRemoveprefix": "removeprefix",
|
||||
"StringRemovesuffix": "removesuffix",
|
||||
"StringReplace": "replace",
|
||||
"StringRfind": "rfind",
|
||||
"StringRjust": "rjust",
|
||||
"StringRsplit": "rsplit",
|
||||
"StringRstrip": "rstrip",
|
||||
"StringSplit": "split",
|
||||
"StringSplitlines": "splitlines",
|
||||
"StringStartswith": "startswith",
|
||||
"StringStrip": "strip",
|
||||
"StringSwapcase": "swapcase",
|
||||
"StringTitle": "title",
|
||||
"StringUpper": "upper",
|
||||
"StringZfill": "zfill",
|
||||
"Basic data handling: StringCapitalize": "capitalize",
|
||||
"Basic data handling: StringCasefold": "casefold",
|
||||
"Basic data handling: StringCenter": "center",
|
||||
"Basic data handling: StringConcat": "concat",
|
||||
"Basic data handling: StringCount": "count",
|
||||
"Basic data handling: StringDecode": "decode",
|
||||
"Basic data handling: StringEncode": "encode",
|
||||
"Basic data handling: StringExpandtabs": "expandtabs",
|
||||
"Basic data handling: StringEndswith": "endswith",
|
||||
"Basic data handling: StringFind": "find",
|
||||
"Basic data handling: StringFormatMap": "format_map",
|
||||
"Basic data handling: StringIn": "in (contains)",
|
||||
"Basic data handling: StringIsAlnum": "isalnum",
|
||||
"Basic data handling: StringIsAlpha": "isalpha",
|
||||
"Basic data handling: StringIsAscii": "isascii",
|
||||
"Basic data handling: StringIsDecimal": "isdecimal",
|
||||
"Basic data handling: StringIsDigit": "isdigit",
|
||||
"Basic data handling: StringIsIdentifier": "isidentifier",
|
||||
"Basic data handling: StringIsLower": "islower",
|
||||
"Basic data handling: StringIsNumeric": "isnumeric",
|
||||
"Basic data handling: StringIsPrintable": "isprintable",
|
||||
"Basic data handling: StringIsSpace": "isspace",
|
||||
"Basic data handling: StringIsTitle": "istitle",
|
||||
"Basic data handling: StringIsUpper": "isupper",
|
||||
"Basic data handling: StringJoin": "join",
|
||||
"Basic data handling: StringLjust": "ljust",
|
||||
"Basic data handling: StringLower": "lower",
|
||||
"Basic data handling: StringLstrip": "lstrip",
|
||||
"Basic data handling: StringRemoveprefix": "removeprefix",
|
||||
"Basic data handling: StringRemovesuffix": "removesuffix",
|
||||
"Basic data handling: StringReplace": "replace",
|
||||
"Basic data handling: StringRfind": "rfind",
|
||||
"Basic data handling: StringRjust": "rjust",
|
||||
"Basic data handling: StringRsplit": "rsplit",
|
||||
"Basic data handling: StringRstrip": "rstrip",
|
||||
"Basic data handling: StringSplit": "split",
|
||||
"Basic data handling: StringSplitlines": "splitlines",
|
||||
"Basic data handling: StringStartswith": "startswith",
|
||||
"Basic data handling: StringStrip": "strip",
|
||||
"Basic data handling: StringSwapcase": "swapcase",
|
||||
"Basic data handling: StringTitle": "title",
|
||||
"Basic data handling: StringUpper": "upper",
|
||||
"Basic data handling: StringZfill": "zfill",
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ from src.basic_data_handling.string_nodes import (
|
||||
StringCapitalize,
|
||||
StringCasefold,
|
||||
StringCenter,
|
||||
DataStringConcat,
|
||||
StringConcat,
|
||||
StringCount,
|
||||
StringDecode,
|
||||
StringEncode,
|
||||
@@ -72,7 +72,7 @@ def test_center():
|
||||
assert node.center("test", 10, "ab") == ("aaatestaaa",)
|
||||
|
||||
def test_concat():
|
||||
node = DataStringConcat()
|
||||
node = StringConcat()
|
||||
assert node.concat("hello ", "world") == ("hello world",)
|
||||
assert node.concat("", "") == ("",) # Empty strings
|
||||
assert node.concat("123", "456") == ("123456",) # Numbers as strings
|
||||
|
||||
Reference in New Issue
Block a user