radex Exceptions - #38
Merged
Merged
Conversation
MattToast
self-requested a review
August 21, 2026 21:10
MattToast
approved these changes
Aug 21, 2026
MattToast
left a comment
Collaborator
There was a problem hiding this comment.
I want to try changing the location of one import statement really quick, but otherwise this seems to make sense to me.
LGTM!! Thanks for helping cleanup the unhappy error path!!
| if n_dims == 0: | ||
| # TODO: Better error type/msg here | ||
| raise ValueError("Attempted to retrieve vector at a key with a scalar") | ||
| from radex.exceptions import RankMismatchError |
Collaborator
There was a problem hiding this comment.
We might be able to move this and the import at line 73 into a top level
from radex.exceptions import RankMismatchErroras I don't think that radex.exceptions uses anything from this module and therefor we do not need to guard against the circular import.
That said, I'm not entirely sure how will this will play nice with the Cython compile step. It might be worth a shot, but if it doesn't work immediately feel free to ignore this comment.
Co-authored-by: Matt Drozt <matthew.drozt@gmail.com>
This reverts commit 1af7e82.
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.
Define and throw better exceptions other than the standard runtime errors. These are then wired up to the Python client by mirroring the exceptions between the C++ definitions and a separate Python one.