Move argument parsing to MLBlock #86
Labels
internal improvement
This introduces no noticeable changes in the behavior but improves code quality and performance
Milestone
The current version of MLBlocks is preparing the keyword arguments for the MLBlock, including keyword replacement and the lookup for a default value if an argument is missing inside the MLPipeline.
The consequence of this is that if a primitive has defined an argument name different than the
keyword
expected by the actual primitive method, the MLBlock instance expects to be called with the actual primitive keyword instead of the one defined in the primitive JSON.An example of this can be seen in the
numpy.argmax
primitive:The JSON contains:
As a consequence of this, the block is exposing the argument name as
y
:But, since the
keyword
argument is not being parsed by the MLBlock class itself, if we call it using they
keyword it fails:And the same would happen if there was a default value defined.
To fix this, we can move the parsing logic from the MLPipeline to the MLBlock, so that the block methods can also be called with the exposed argument names and also have default values.
The text was updated successfully, but these errors were encountered: