This repository was archived by the owner on Feb 28, 2024. It is now read-only.
[MRG] Added checking-functions for clarity and reusability. #597
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.
This is a quick PR which moves some exception-handling into separate functions for clarity and reusability. It currently only affects
@use_named_args()that I recently added.I searched for the proper module to place these in and noticed that
utils.pyalready hascheck_x_in_space()so I placed them inutils.pyas well.It can be tested with the following code:
This fails and prints:
And the following code:
This fails and prints:
Note that PR #579 changes the semantics of dimension-names, so that all dimensions are now given default names if the user has not supplied a name, so you can argue this check is not really needed after that. But there is an ongoing discussion about naming dimensions, so I think it is wise to keep this check for now.