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.
Issue #144 pointed out a Numpy deprecation warning. This issue is actually quite prevalent, so it's worth fixing. The main culprit is
getunit()
which has the ability to check the dimensionality of its argument, eg.getunit(x, dim=3)
raises an exception if the argument is not a 3-vector. The toolbox had lots of instances ofgetunit(x, dim=0)
which seems to inconsistently mean either check for a scalar or return a scalar not anndarray
. Have added a new optiongetunit(x, vector=False)
to return a scalar if possible. The functionality for dimension checking and output datatype are now quite separate and this makes the intent a lot clearer when reading code.There are quite a few knockon consequences of this across other modules and tests.
Unfortunately this commit is quite big, but that's because of some changes between my blacked code and the blacked code in the repo. See issue #149 .