@@ -938,15 +938,6 @@ def as_dict(self):
938938 def validate (self ):
939939 self .input .validate ()
940940
941- def expand_schema_for_dynamic (self , d : dict [str , Any ], live_inputs : dict [str , Any ], curr_prefix : list [str ] | None = None ):
942- curr_prefix = handle_prefix (curr_prefix )
943- real_inputs = []
944- for name , input in self .cached_inputs .items ():
945- if name in live_inputs :
946- real_inputs .append (input )
947- add_to_input_dict_v1 (d , real_inputs , live_inputs , curr_prefix )
948- add_dynamic_id_mapping (d , real_inputs , curr_prefix )
949-
950941 class TemplatePrefix (_AutogrowTemplate ):
951942 def __init__ (self , input : Input , prefix : str , min : int = 1 , max : int = 10 ):
952943 super ().__init__ (input )
@@ -1112,12 +1103,6 @@ def __init__(self, slot: Input, inputs: list[Input],
11121103 self .force_input = True
11131104 self .slot .force_input = True
11141105
1115- def expand_schema_for_dynamic (self , d : dict [str , Any ], live_inputs : dict [str , Any ], curr_prefix : list [str ] | None = None ):
1116- if self .id in live_inputs :
1117- curr_prefix = handle_prefix (curr_prefix , self .id )
1118- add_to_input_dict_v1 (d , self .inputs , live_inputs , curr_prefix )
1119- add_dynamic_id_mapping (d , [self .slot ] + self .inputs , curr_prefix )
1120-
11211106 def get_dynamic (self ) -> list [Input ]:
11221107 return [self .slot ] + self .inputs
11231108
@@ -1146,19 +1131,6 @@ def _expand_schema_for_dynamic(out_dict: dict[str, Any], live_inputs: dict[str,
11461131 out_dict [input_type ][finalized_id ] = value
11471132 out_dict ["dynamic_paths" ][finalized_id ] = finalize_prefix (curr_prefix , curr_prefix [- 1 ])
11481133
1149- def add_dynamic_id_mapping (d : dict [str , Any ], inputs : list [Input ], curr_prefix : list [str ], self : DynamicInput = None ):
1150- dynamic = d .setdefault ("dynamic_paths" , {})
1151- if self is not None :
1152- dynamic [finalize_prefix (curr_prefix [:- 1 ], self .id )] = finalize_prefix (curr_prefix , self .id )
1153- for i in inputs :
1154- if not isinstance (i , DynamicInput ):
1155- dynamic [finalize_prefix (curr_prefix , i .id )] = finalize_prefix (curr_prefix , i .id )
1156-
1157- def add_to_dynamic_dict (dynamic : dict [str , Any ], curr_prefix : list [str ], id : str , value : str ):
1158- finalize_key = finalize_prefix (curr_prefix , id )
1159- if finalize_key not in dynamic :
1160- dynamic [finalize_key ] = value
1161-
11621134DYNAMIC_INPUT_LOOKUP : dict [str , Callable [[dict [str , Any ], dict [str , Any ], tuple [str , dict [str , Any ]], str , list [str ] | None ], None ]] = {}
11631135def register_dynamic_input_func (io_type : str , func : Callable [[dict [str , Any ], dict [str , Any ], tuple [str , dict [str , Any ]], str , list [str ] | None ], None ]):
11641136 DYNAMIC_INPUT_LOOKUP [io_type ] = func
0 commit comments