failing as we should, instead of printing out an error #157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm not sure why the following
print
statements were put in - merelyprint
ing out an error and proceeding like nothing happened doesn't accomplish anything IMO, and only hides the otherwise invaluable stack trace. It's better to fail explicitly with anImportError
.I noticed this when a bad installation of
torch
in my environment was preventing an internal import deep inside pytorch (triggered in our code onfrom torch.nn import Module
), but this was hard to track down because of thisprint
.If the intention here was to allow
osqp
code execution even in the absence of thetorch
module, that's understandable, but again, no other code inosqp
seems to be inadvertently picking up this module where it shouldn't except a unit test, and doing anfrom osqp.nn.torch import ..
should trigger anImportError
.