Right now gh-14, gives a few ways to decide which parameters we dispatch for:
- Via parameter names (string, list of strings), but using
inspect.signature to find the position.
- E.g. a single string could also be assume to be parameter 0?
- Via a dict, that contains
{name: position} (roughly from NetworkX)
- Via a function that returns an iterable.
- and
None to just use all (for simplicity).
We need the function version I think (it is just easy and flexible), but I am not quite sure about the other API choices (also because I can see that inspect.signature isn't super fast).
Also, if we use the signature we can also add another neat feature and use type annotations.
(If the parameters are annotated as "array".)
Another thing here, is that I could see making a family of @dispatchable functions, or using long kwargs and just asking users to do dispatchable = functools.partial(backend_system.dispatchable, ...) to make their preferred choice convenient.
Right now gh-14, gives a few ways to decide which parameters we dispatch for:
inspect.signatureto find the position.{name: position}(roughly from NetworkX)Noneto just use all (for simplicity).We need the function version I think (it is just easy and flexible), but I am not quite sure about the other API choices (also because I can see that
inspect.signatureisn't super fast).Also, if we use the
signaturewe can also add another neat feature and use type annotations.(If the parameters are annotated as "array".)
Another thing here, is that I could see making a family of
@dispatchablefunctions, or using long kwargs and just asking users to dodispatchable = functools.partial(backend_system.dispatchable, ...)to make their preferred choice convenient.