Repository navigation
Conversation
efiring
reviewed
Sep 10, 2017
| # Alternative to np.linalg.norm() | ||
| # as numpy 1.7 doesn't have 'axis' kwarg | ||
| dX = np.sum(dX**2, axis=1)**(1 / 2) | ||
| return np.concatenate((np.zeros(1), np.cumsum(dX))) |
Member
There was a problem hiding this comment.
I suspect this can be done more efficiently with 3 lines in place of the function:
pl = np.zeros(slc.shape[0], dtype=float)
dx = np.diff(slc, axis=0)
pl[1:] = np.cumsum(np.hypot(dx[:, 0], dx[:, 1]))
Contributor
|
Would it be simpler to bump the numpy version to 1.8.0? Relevant ubuntu versions right now are at https://www.ubuntu.com/info/release-end-of-life: Plus this way we get np.full :-) |
dstansby
force-pushed
the
replace-path-length
branch
from
September 16, 2017 11:18
021aaa4 to
b4e339a
Compare
7 of 28 tasks
Member
Author
|
I'm going to move everything over to #9151 for simplicity (sorry if people are getting lots of notifications...) |
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.
Allows a few functions in
mlab.pyto be deprecated.