fix!(abc): Take multiple DataFrames as inputs
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 forcore
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:
- I ran a script that uses both
multisignal
andcore
processes as functions in the format of the example above. No errors returned. -
https://git.ecdf.ed.ac.uk/swain-lab/aliby/postprocessor/-/pipelines/17183
succeeded. This includes unit tests for some
core
processes.
REFERENCES:
- Issue #28 (closed)