-
Notifications
You must be signed in to change notification settings - Fork 22
Description
@sladkovm This is the discussion we started before. Shall we continue here?
For algorithms it is possible to accept multiple input argument types and cast them to a desirable type and cast the output to a type similar to the input type (example of a method that does this in the vmpy source code).
Benefits:
- Usage of the algorithms is more straightforward when you don't have to worry about the input types
- ...
Drawbacks:
- Input argument type is part of the interface specification. Allowing multiple input types might make the interface vague
- It is not possible to accept all input types. How do we communicate what is/is not possible?
- Unittesting for multiple input types is a hassle
- ...
I have a preference for accepting (i.e. developing for) one input type.
Alternative solution: It might be possible to add input and output argument type casting by decorating the algorithms "on the fly" by calling a helper function after import (sort of similar to this). It's not the cleanest way to do it but it might work, I'll try to make a POC for this. For me this would solve the drawbacks and it would still offer input/output type casting for users that do want it.