Skip to content

Commit 85c4e13

Browse files
committed
_two_dimensional data_struct_check added to process input
1 parent b138ad9 commit 85c4e13

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

src/diffupy/process_input.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,14 +453,27 @@ def _type_dict_label_scores_dict_data_struct_check(v: Union[dict, list]) -> bool
453453
get_random_value_from_dict(get_random_value_from_dict(v)), (int, float))
454454

455455

456+
def _two_dimensional_type_dict_label_scores_dict_data_struct_check(v: Union[dict, list]) -> bool:
457+
"""Check data structure type Dict[str, Dict[str, Dict[str, int]]]."""
458+
return isinstance(v, dict) and isinstance(get_random_value_from_dict(v), dict) and isinstance(
459+
get_random_value_from_dict(get_random_value_from_dict(v)), dict) and isinstance(
460+
get_random_value_from_dict(get_random_value_from_dict(get_random_value_from_dict(v))), (int, float))
461+
462+
456463
def _label_list_data_struct_check(v: Union[dict, list]) -> bool:
457464
"""Check data structure type list."""
458-
return isinstance(v, list)
465+
return isinstance(v, list) or isinstance(v, set)
459466

460467

461468
def _type_dict_label_list_data_struct_check(v: Union[dict, list]) -> bool:
462469
"""Check data structure type Dict[str, list]."""
463-
return isinstance(v, dict) and isinstance(get_random_value_from_dict(v), list)
470+
return isinstance(v, dict) and _label_list_data_struct_check(get_random_value_from_dict(v))
471+
472+
473+
def _two_dimensional_type_dict_label_list_data_struct_check(v: Union[dict, list]) -> bool:
474+
"""Check data structure type Dict[str, Dict[str, list]]."""
475+
return isinstance(v, dict) and isinstance(get_random_value_from_dict(v), dict) and _label_list_data_struct_check(
476+
get_random_value_from_dict(get_random_value_from_dict(v)))
464477

465478

466479
"""Mappers from input to network background"""

0 commit comments

Comments
 (0)