Fix misleading/confusing error types throughout uxarray - #1652
Open
Sevans711 wants to merge 4 commits into
Open
Conversation
as described by
This means users can reliably refer to, e.g., ux.errors.DimensionError, instead of possibly needing to import uxarray.errors specifically and then do uxarray.errors.DimensionError.
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.
Closes #1622
Overview
Fixes error types which did correspond closely to the actual error being reported. For example, for an error like "This functionality is not yet supported" the error type should be NotImplementedError, not ValueError. This PR addresses all cases mentioned in #1622, which is an exhaustive list of all such cases throughout uxarray.
Test suite has been updated accordingly for all tests which failed due to expecting old error types.
Slight expansion beyond original scope: this PR also adds an import of
uxarray.errorsmodule in uxarray's top-level__init__.py, to make custom error types easier to refer to. Now users can reliably write something likeux.errors.DimensionError, instead of possibly needing toimport uxarray.errorsspecifically and then douxarray.errors.DimensionError. Questions for reviewers: (A) is this okay to bundle here? (B) Do I also need to add something todocs/api.rstpage?Below copies the list of changes enumerated in issue 1622, and marks them as (done), possibly with minor notes to show how they have been completed here.
PR Checklist
General
Testing & Benchmarking