Skip to content

fix!(abc): Take multiple DataFrames as inputs

Arin Wongprommoon requested to merge issue-028 into dev

WHY IS THIS CHANGE NEEDED?:

  • Function implementations of processes (i.e. process.as_function(...)) are not able to take muliple DataFrames as inputs.
  • This affects processes under multisignal.

HOW DOES THE CHANGE SOLVE THE PROBLEM?:

  • PostProcessABC.as_function() assumed that there is only one input in the data argument.
  • Change treats additional input DataFrames as arguments (*extra_data) after data. This preserves behaviour for core processes that take one DataFrame as an input but also allows multiple DataFrame inputs to be processed.
  • Change treats parameters as keyword arguments (**kwargs).
  • *args renamed as *extra_data for readability.

WHAT SIDE EFFECTS DOES THIS CHANGE HAVE?:

  • User needs to specify the keyword argument names and can't rely on position alone. Otherwise, an KeyError will be raised.

  • I do not add error handling in this case because I think if the error is raised, the solution is obvious enough, i.e.:

    output = multisignal_process.as_function( input1, input2, parameter1)

    will raise an error. Change this to:

    output = multisignal_process.as_function( input1, input2, parameter1=parameter1)

EVIDENCE THAT COMMIT WORKS:

REFERENCES:

Merge request reports