Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "basic_data_handling"
version = "0.4.5"
version = "0.4.6"
description = """Basic Python functions for manipulating data that every programmer is used to, lightweight with no additional dependencies.

Supported data types:
Expand Down
4 changes: 4 additions & 0 deletions src/basic_data_handling/data_list_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,10 @@ def INPUT_TYPES(cls):
INPUT_IS_LIST = True
OUTPUT_IS_LIST = (True, False)

@classmethod
def IS_CHANGED(cls, **kwargs):
return float("NaN") # Not equal to anything -> trigger recalculation

def pop_random_element(self, **kwargs: list[Any]) -> tuple[list[Any], Any]:
from random import randrange
input_list = kwargs.get('list', []).copy()
Expand Down
4 changes: 4 additions & 0 deletions src/basic_data_handling/dict_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,10 @@ def INPUT_TYPES(cls):
DESCRIPTION = cleandoc(__doc__ or "")
FUNCTION = "pop_random"

@classmethod
def IS_CHANGED(cls, **kwargs):
return float("NaN") # Not equal to anything -> trigger recalculation

def pop_random(self, input_dict: dict) -> tuple[dict, str, Any, bool]:
import random
result = input_dict.copy()
Expand Down
4 changes: 4 additions & 0 deletions src/basic_data_handling/list_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,10 @@ def INPUT_TYPES(cls):
DESCRIPTION = cleandoc(__doc__ or "")
FUNCTION = "pop_random_element"

@classmethod
def IS_CHANGED(cls, **kwargs):
return float("NaN") # Not equal to anything -> trigger recalculation

def pop_random_element(self, list: list[Any]) -> tuple[list[Any], Any]:
import random
result = list.copy()
Expand Down
4 changes: 4 additions & 0 deletions src/basic_data_handling/set_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,10 @@ def INPUT_TYPES(cls):
DESCRIPTION = cleandoc(__doc__ or "")
FUNCTION = "pop_random_element"

@classmethod
def IS_CHANGED(cls, **kwargs):
return float("NaN") # Not equal to anything -> trigger recalculation

def pop_random_element(self, set: set[Any]) -> tuple[set[Any], Any]:
import random
result = set.copy()
Expand Down