Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a more meaningful "ptp" #3292

Closed
ebressert opened this issue Apr 30, 2013 · 7 comments
Closed

Add a more meaningful "ptp" #3292

ebressert opened this issue Apr 30, 2013 · 7 comments

Comments

@ebressert
Copy link

The peak-to-peak function, ptp(), is a simple and handy function to use, but it confuses the PEP20 suggestions a bit. See this discussion for reference: http://d.pr/i/snXG

Based on the discussion, it may be a good idea to make the name more relevant? Some suggestions include span() or valuerange().

@adrn
Copy link
Contributor

adrn commented Apr 30, 2013

+1 to this idea

@andycasey
Copy link

Also +1

@rgommers
Copy link
Member

rgommers commented May 2, 2013

Makes sense, I like valuerange. ptp should be kept as an alias though, it's not necessary to break existing code for this.

Could you propose this on the mailing list? There's just a discussion going on about some other functions to add for 1.8.

@ebressert
Copy link
Author

@rgommers Sure. I'll send something out in today regarding this.

@charris
Copy link
Member

charris commented Feb 22, 2014

Still open. Was there a discussion?

@WarrenWeckesser
Copy link
Member

FWIW: Over in ufunclab, I created a function called peaktopeak as an exercise in creating generalized ufuncs. peaktopeak makes two imrovements over ptp:

  • It makes a single pass over the data, so it will usually be faster than ptp.
  • For arrays of signed integers, peaktopeak returns an unsigned integer result. ptp returns a negative value with arrays of signed integers when the peak-to-peak value exceeds the maximum signed integer of the array's dtype (e.g. np.array([-100, 0, 100], dtype=np.int8).ptp() returns -56).

@mattip mattip changed the title Changing the function name "ptp" to something more meaningful Add a more meaningful "ptp" Dec 18, 2019
@mattip
Copy link
Member

mattip commented Feb 12, 2020

Closing. This is more appropriate for scipy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants