Skip to content

Passing algorithm specific arguments in getQuery and processAnswer #146

@stsievert

Description

@stsievert

I ran into a use case today where @sumeetsk was developing an application where he had two different algorithms that needed a different set of parameters for getQuery and processAnswer (some elements common, others not).

To support this, I see three choices:

  1. Enforce that all algs accept arbitrary keyword arguments (through def getQuery(..., **kwargs)). This is the current functionality, and is not preferred (why should an algorithm developer have to modify every other algorithm to get a special argument?)
  2. Modify the wrapper. We can look at the function signature and see what optional arguments the algorithm function can accept and pass in those. This would mean that the app developer would be encouraged to pass in every argument that any algorithm needs (which may be expensive).
  3. Modify myApp.py. We could provide an alg.name to the algorithm developer and they can write an if-statement to see which arguments they want to pass.

Daniel and I discussed this today, and we're not inclined to go with option 2. Our main motive for going with option 3 was that we were doing less and leaving more up to the user -- this provides more flexibility and an explicit explanation of what's going on.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions