Skip to content
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

failing as we should, instead of printing out an error #157

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

vineetbansal
Copy link
Contributor

@vineetbansal vineetbansal commented Aug 6, 2024

I'm not sure why the following print statements were put in - merely printing 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 an ImportError.

I noticed this when a bad installation of torch in my environment was preventing an internal import deep inside pytorch (triggered in our code on from torch.nn import Module), but this was hard to track down because of this print.

If the intention here was to allow osqp code execution even in the absence of the torch module, that's understandable, but again, no other code in osqp seems to be inadvertently picking up this module where it shouldn't except a unit test, and doing an from osqp.nn.torch import .. should trigger an ImportError.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Vineet Bansal seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@vineetbansal vineetbansal merged commit dea9cc1 into master Aug 7, 2024
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants