Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-18 Thread Travis Vaught
On Jul 17, 2012, at 10:47 AM, Nathaniel Smith wrote: Not that there are likely to be people using skip_header=True as an alias for skip_header=1, but if they were it would currently work. confession I write messy code like that all the time. /confession Best, Travis

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-17 Thread Nathaniel Smith
On Mon, Jul 16, 2012 at 10:39 PM, Pierre GM pgmdevl...@gmail.com wrote: I don't really have any deep issue with `skip_header=True`, besides not really liking having an argument whose type can vary. But that's only a matter of personal taste. And yes, we could always check the type… I guess I

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-17 Thread Pierre GM
On Tuesday, July 17, 2012 at 17:47 , Nathaniel Smith wrote: I guess I still have a small preference for skip_header=comments over skip_header=True, since the latter is more opaque for no purpose. Also it makes me slightly antsy since skip_header is normally an integer, and True is, in fact,

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-16 Thread Pierre GM
Hello, I'm siding w/ Tom, Nathaniel and Travis. I don't think the change as it is is advisable. It's a regression, and breaking=bad. Now, I can understand your frustration, so, what about a trade-off? The first line w/ a comment after the first 'skip_header' ones should be parsed for column titles

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-16 Thread Travis Oliphant
On Jul 16, 2012, at 1:52 AM, Pierre GM wrote: Hello, I'm siding w/ Tom, Nathaniel and Travis. I don't think the change as it is is advisable. It's a regression, and breaking=bad. Now, I can understand your frustration, so, what about a trade-off? The first line w/ a comment after the

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-16 Thread Paul Natsuo Kishimoto
Hi Pierre, On Mon, 2012-07-16 at 01:54 -0500, Travis Oliphant wrote: On Jul 16, 2012, at 1:52 AM, Pierre GM wrote: Hello, I'm siding w/ Tom, Nathaniel and Travis. I don't think the change as it is is advisable. It's a regression, and breaking=bad. Now, I can understand your

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-16 Thread Pierre GM
To be ultra clear (since I want to code this), you are suggesting that 'first_commented_line' be a *new* accepted value for the kwarg 'names', to invoke the behaviour you suggest? Nope, I was just referring to some hypothetical variable name. I meant that: first_values = None try: while not

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-16 Thread Paul Natsuo Kishimoto
I've implemented this feature with skip_header=-1 as suggested by Pierre, and in doing so removed the regression. TravisBot seems to like it: https://github.com/numpy/numpy/pull/351 On Mon, 2012-07-16 at 16:12 +0200, Pierre GM wrote: To be ultra clear (since I want to code this), you are

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-16 Thread Nathaniel Smith
On Mon, Jul 16, 2012 at 8:06 PM, Paul Natsuo Kishimoto m...@paul.kishimoto.name wrote: I've implemented this feature with skip_header=-1 as suggested by Pierre, and in doing so removed the regression. TravisBot seems to like it: https://github.com/numpy/numpy/pull/351 Can we please not use

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-16 Thread Tom Aldcroft
On Mon, Jul 16, 2012 at 3:06 PM, Paul Natsuo Kishimoto m...@paul.kishimoto.name wrote: I've implemented this feature with skip_header=-1 as suggested by Pierre, and in doing so removed the regression. TravisBot seems to like it: https://github.com/numpy/numpy/pull/351 On Mon, 2012-07-16 at

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-16 Thread Pierre GM
Well, as `skip_header` is a number of lines, I don't really see anything particular magical about a `skip_header=-1`. Plus, range(-1) == [], while range(comments) raises a TypeError. And then you'd have to figure why the exception was raised. -- Pierre GM On Monday, July 16, 2012 at 21:56 ,

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-16 Thread Nathaniel Smith
On Mon, Jul 16, 2012 at 9:01 PM, Pierre GM pgmdevl...@gmail.com wrote: Well, as `skip_header` is a number of lines, I don't really see anything particular magical about a `skip_header=-1`. The logic here is: - if names=True, then genfromtext expects the names to be given in the first line, and

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-16 Thread Pierre GM
Tom, I agree that the documentation should be updated (both the doctoring and the relevant parts of the user manual), and specific unit-tests added. Paul, that's a direct nudge ;) (I'm sure you don't mind). I was also considering the weird case first_line = # A B C #1 #2 #3 How many columns in

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-16 Thread Paul Natsuo Kishimoto
On Mon, 2012-07-16 at 21:14 +0100, Nathaniel Smith wrote: On Mon, Jul 16, 2012 at 9:01 PM, Pierre GM pgmdevl...@gmail.com wrote: Well, as `skip_header` is a number of lines, I don't really see anything particular magical about a `skip_header=-1`. The logic here is: - if names=True, then

[Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-13 Thread Paul Natsuo Kishimoto
Hello everyone, I am a longtime NumPy user, and I just filed my first contribution to the code as pull request to fix what I felt was a bug in the behaviour of genfromtxt() https://github.com/numpy/numpy/pull/351 It turns out this alters existing behaviour that some people may depend on,

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-13 Thread Tom Aldcroft
On Fri, Jul 13, 2012 at 11:15 AM, Paul Natsuo Kishimoto m...@paul.kishimoto.name wrote: Hello everyone, I am a longtime NumPy user, and I just filed my first contribution to the code as pull request to fix what I felt was a bug in the behaviour of genfromtxt()

Re: [Numpy-discussion] Proposed change in genfromtxt(..., comments='#', names=True) behaviour

2012-07-13 Thread Paul Natsuo Kishimoto
On Fri, 2012-07-13 at 12:13 -0400, Tom Aldcroft wrote: On Fri, Jul 13, 2012 at 11:15 AM, Paul Natsuo Kishimoto m...@paul.kishimoto.name wrote: Hello everyone, I am a longtime NumPy user, and I just filed my first contribution to the code as pull request to fix what I felt was