Updated docstring.:

This commit is contained in:
pydn
2023-08-25 11:29:09 -05:00
parent 1430658064
commit 9549e3fe7a
+6
View File
@@ -348,6 +348,12 @@ class CodeGenerator:
def clean_variable_name(class_type: str) -> str:
"""
Remove any characters from variable name that could cause errors running the Python script.
Args:
class_type (str): Class type.
Returns:
str: Cleaned variable name with no special characters or spaces
"""
# Convert to lowercase and replace spaces with underscores
clean_name = class_type.lower().strip().replace("-", "_").replace(" ", "_")