@@ -379,37 +379,15 @@ def execute(self, *args, **kwargs):
379379 logger = logging .getLogger ('noodles' )
380380 logger .setLevel (logging .INFO )
381381 logger .handlers = [log_handler ]
382- self .workflow_level_promise = self ._replace_input_arguments (self .workflow_level_promise , args , kwargs )
382+ self .workflow_level_promise = noodles .workflow .from_call (
383+ noodles .get_workflow (self .workflow_level_promise ).root_node .foo , args , kwargs , {})
383384 result = noodles .run_single (self .workflow_level_promise )
384385
385386 # Generate the retrospective provenance as a (nano-) Publication object
386387 retroprov = self ._generate_retrospective_prov_publication (log .getvalue ())
387388
388389 return result , retroprov
389390
390- def _replace_input_arguments (self , promise : noodles .interface .PromisedObject , args , kwargs ):
391- """
392- Replace the input arguments of the promise so we can run the workflow with the right
393- inputs. This goes into the guts of noodles, doing something noodles was not intended to be
394- used for.
395- TODO: find a better solution for this
396- """
397- workflow = noodles .get_workflow (promise )
398- signature = inspect .signature (workflow .root_node .foo )
399- arguments_dict = self ._get_arguments_dict (args , kwargs , signature )
400- workflow .root_node .bound_args = inspect .BoundArguments (signature , arguments_dict )
401- return promise
402-
403- @staticmethod
404- def _get_arguments_dict (args , kwargs , signature ):
405- """
406- Create dictionary of keyword arguments from positional and keyword arguments and the
407- signature of the function.
408- """
409- arguments_dict = {key : arg for arg , key in zip (args , signature .parameters .keys ())}
410- arguments_dict .update (kwargs )
411- return arguments_dict
412-
413391 def _generate_retrospective_prov_publication (self , log :str ) -> nanopub .Publication :
414392 """
415393 Utility method for generating a Publication object for the retrospective
0 commit comments