Allow imports to work if openequivariance is installed but not running on supported GPU - #1534
Open
bernstei wants to merge 1 commit into
Open
Allow imports to work if openequivariance is installed but not running on supported GPU#1534bernstei wants to merge 1 commit into
bernstei wants to merge 1 commit into
Conversation
…g on supported GPU
aacostadiaz
reviewed
Jul 24, 2026
aacostadiaz
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the fix! One small thing below, otherwise looks good to me.
| OEQ_AVAILABLE = True | ||
| except ImportError: | ||
| OEQ_AVAILABLE = False | ||
| except AssertionError as exc: |
Collaborator
There was a problem hiding this comment.
Two test files still have the same crash: tests/helpers.py and tests/backends/backend_parity.py. In those two files, catching AssertionError too is enough.
except (ImportError, AssertionError):
OEQ_AVAILABLE = False
Collaborator
Author
There was a problem hiding this comment.
I'm sure that catching just any generic assertion error is enough, but I was trying to be careful, so that only the particular backend-related assertion was caught, to allow for other failure modes to still lead to an exception.
Do you not think we should apply that level of specificity to the tests as well? Who knows what other assertions those imports could trigger.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Check for
AssertionErrorthat contains a specific string when importingopenequivariance, and allow it to continue without OEQ if it's caused by running on a non-supported GPU (e.g. torch CPU)closes #1532