Open mstechly opened 3 years ago
This is a known issue. The signature actually doesn't have any named arguments except vartype
.
We could add named kwargs for convenience, though obviously it would complicate the implementation. Totally agree it should at least raise an exception.
Thanks for the bug report! We're doing some refactoring of the construction code soon anyway, unless this is blocking y'all now?
I think that just throwing a warning/exception wouldn't complicate the implementation much and would be very helpful for the users and would protect them from making a mistake.
Also, the docs for the class are not mentioning that these arguments are purely positional.
It's not blocking, just reporting it for future generations. We're glad you're working on it :)
Description When we have tried initializing
BinaryQuadraticModel
using all the keyword arguments, we got an empty model. However, if we uselinear
,quadratic
andoffset
as positional arguments, it works properly. We understand that they might be purely positional, but the initializer should at least raise an exception when unrecognized arguments are passed.Steps To Reproduce This gives expected behaviour:
This is unexpected behaviour:
This is also unexpected behaviour:
Specifying
linear
twice, once as positional and once as keyword argument is also confusing:Also, all the other keyword arguments are ignored without throwing a warning or exception.
Expected Behavior Passing
linear
,quadratic
andoffset
as keyword arguments should work or raise an exception.Environment
Python 3.7.9
dimod==0.9.11
Additional Context CC: @dexter2206