PlasmaCalcs.tools.pytools.inputs_as_dict

PlasmaCalcs.tools.pytools.inputs_as_dict(callable_, *args, **kw)
returns dict of all inputs to callable_ based on its signature and args & kwargs.
raises TypeError if inputs would be invalid for callable_.
Example:
def foo(a, b=2, c=3, * d=4, e=5): pass
inputs_as_dict(foo, 9, d=7, c=8) gives {‘a’:9, ‘b’:2, ‘c’:8, ‘d’:7, ‘e’:5}
inputs_as_dict(foo, z=6) raises TypeError since foo doesn’t accept kwarg ‘z’.