-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bqm.resize should not return a value #1091
Comments
We need to return a value in order to be able to raise an exception. See error return values. We could obfuscate it, but that would result in a performance regression since this function is called frequently. |
What about returning the difference in number of variables between current and previous BQM rather than 0? |
Also, to be clear, dimod/dimod/binary/binary_quadratic_model.py Line 1600 in 220a22a
Line 406 in 220a22a
The value is returned by
cpdef function which is why we need that return value.
|
Could just be the size of the resulting BQM (since -1 is what indicates an error). It's a bit redundant since that's the value being passed in but at least would be a bit more meaningful 🤷 |
Changed my mind, your idea is better. We can just error on 0 instead since that should be an uncommon case if we're returning the delta. |
Previously it always returned 0. Closes dwavesystems#1091
Previously it always returned 0. Closes dwavesystems#1091
Previously it always returned 0. Closes dwavesystems#1091
Description
(
dimod/dimod/binary/binary_quadratic_model.py
Line 1600 in 220a22a
returns a zero when this method is run. Why?
Steps To Reproduce
Expected Behavior
Quietly do its work.
Environment
Additional Context
I'm in that file now, can I delete the
return
?The text was updated successfully, but these errors were encountered: