Skip to content

API: Excact API to decide dispatch arguments? #15

Open

Description

@seberg

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions