@@ -177,6 +177,9 @@ def _get_block_variables(self, block_name, variables_attr, names):
177177 """
178178 block = self .blocks [block_name ]
179179 variables = deepcopy (getattr (block , variables_attr ))
180+ if isinstance (variables , str ):
181+ variables = getattr (block .instance , variables )()
182+
180183 variable_dict = {}
181184 for variable in variables :
182185 name = variable ['name' ]
@@ -300,6 +303,12 @@ def get_inputs(self, fit=True):
300303
301304 return inputs
302305
306+ def get_fit_args (self ):
307+ return list (self .get_inputs (fit = True ).values ())
308+
309+ def get_predict_args (self ):
310+ return list (self .get_inputs (fit = False ).values ())
311+
303312 def get_outputs (self , outputs = 'default' ):
304313 """Get the list of output variables that correspond to the specified outputs.
305314
@@ -578,6 +587,10 @@ def _get_block_args(self, block_name, block_args, context):
578587
579588 input_names = self .input_names .get (block_name , dict ())
580589
590+ if isinstance (block_args , str ):
591+ block = self .blocks [block_name ]
592+ block_args = getattr (block .instance , block_args )()
593+
581594 kwargs = dict ()
582595 for arg in block_args :
583596 name = arg ['name' ]
@@ -591,6 +604,9 @@ def _get_block_args(self, block_name, block_args, context):
591604 def _extract_outputs (self , block_name , outputs , block_outputs ):
592605 """Extract the outputs of the method as a dict to be set into the context."""
593606 # TODO: type validation and/or transformation should be done here
607+ if isinstance (block_outputs , str ):
608+ block = self .blocks [block_name ]
609+ block_outputs = getattr (block .instance , block_outputs )()
594610
595611 if not isinstance (outputs , tuple ):
596612 outputs = (outputs , )
0 commit comments