Re: [Numpy-discussion] dtype repr change?

2011-07-29 Thread Mark Wiebe
On Thu, Jul 28, 2011 at 3:09 PM, Nathaniel Smith n...@pobox.com wrote: I have a different question about this than the rest of the thread. I'm confused at why there isn't a programmatic way to create a datetime dtype, other than by going through this special string-based mini-language. I guess

Re: [Numpy-discussion] dtype repr change?

2011-07-29 Thread Mark Wiebe
I've merged a pull request from Alok Singhal which implements Robert Kern's idea for this. Thanks, Mark On Wed, Jul 27, 2011 at 12:50 PM, Matthew Brett matthew.br...@gmail.comwrote: Hi, I see that (current trunk): In [9]: np.ones((1,), dtype=bool) Out[9]: array([ True], dtype='bool') -

Re: [Numpy-discussion] dtype repr change?

2011-07-29 Thread Jason Grout
On 7/28/11 4:21 PM, Matthew Brett wrote: Hi, Do you know if doctests supports any sort of manual intervention, like a plugin system? Actually, I was going to ask you that question :) But yes, there's the NumpyDoctest nose plugin, for example. Using it does mean you have to customize nose

Re: [Numpy-discussion] dtype repr change?

2011-07-28 Thread Ralf Gommers
On Thu, Jul 28, 2011 at 1:29 AM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Wed, Jul 27, 2011 at 05:25:20PM -0600, Charles R Harris wrote: Well, doc tests are just a losing proposition, no one should be using them for writing tests. It's not like this is a new discovery,

Re: [Numpy-discussion] dtype repr change?

2011-07-28 Thread Matthew Brett
Hi, On Thu, Jul 28, 2011 at 10:13 AM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Thu, Jul 28, 2011 at 1:29 AM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Wed, Jul 27, 2011 at 05:25:20PM -0600, Charles R Harris wrote:    Well, doc tests are just a losing proposition, no

Re: [Numpy-discussion] dtype repr change?

2011-07-28 Thread Nathaniel Smith
I have a different question about this than the rest of the thread. I'm confused at why there isn't a programmatic way to create a datetime dtype, other than by going through this special string-based mini-language. I guess I generally think of string-based dtype descriptors as being a legacy

Re: [Numpy-discussion] dtype repr change?

2011-07-28 Thread Stéfan van der Walt
On Thu, Jul 28, 2011 at 10:19 AM, Matthew Brett matthew.br...@gmail.com wrote: I don't think anyone suggested that doctests should replace unit tests; it's a bit difficult to see why that discussion started. The conversation started because array([True], dtype=bool) changed to array([True],

Re: [Numpy-discussion] dtype repr change?

2011-07-28 Thread Matthew Brett
Hi, 2011/7/28 Stéfan van der Walt ste...@sun.ac.za: On Thu, Jul 28, 2011 at 10:19 AM, Matthew Brett matthew.br...@gmail.com wrote: I don't think anyone suggested that doctests should replace unit tests; it's a bit difficult to see why that discussion started. The conversation started

Re: [Numpy-discussion] dtype repr change?

2011-07-28 Thread Stéfan van der Walt
On Thu, Jul 28, 2011 at 1:48 PM, Matthew Brett matthew.br...@gmail.com wrote: The thread was first about how to deal with the change, and second I'm still curious to know of a technical solution with doctests. Ideally, one would like to specify a set of rules that a line must pass to know

Re: [Numpy-discussion] dtype repr change?

2011-07-28 Thread Matthew Brett
Hi, 2011/7/28 Stéfan van der Walt ste...@sun.ac.za: On Thu, Jul 28, 2011 at 1:48 PM, Matthew Brett matthew.br...@gmail.com wrote: The thread was first about how to deal with the change, and second I'm still curious to know of a technical solution with doctests. Ideally, one would like to

[Numpy-discussion] dtype repr change?

2011-07-27 Thread Matthew Brett
Hi, I see that (current trunk): In [9]: np.ones((1,), dtype=bool) Out[9]: array([ True], dtype='bool') - whereas (1.5.1): In [2]: np.ones((1,), dtype=bool) Out[2]: array([ True], dtype=bool) That is breaking quite a few doctests. What is the reason for the change? Something to do with more

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
This was the most consistent way to deal with the parameterized dtype in the repr, making it more future-proof at the same time. It was producing reprs like array(['2011-01-01'], dtype=datetime64[D]), which is clearly wrong, and putting quotes around it makes it work in general for all possible

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Matthew Brett
Hi, On Wed, Jul 27, 2011 at 6:54 PM, Mark Wiebe mwwi...@gmail.com wrote: This was the most consistent way to deal with the parameterized dtype in the repr, making it more future-proof at the same time. It was producing reprs like array(['2011-01-01'], dtype=datetime64[D]), which is clearly

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 1:01 PM, Matthew Brett matthew.br...@gmail.comwrote: Hi, On Wed, Jul 27, 2011 at 6:54 PM, Mark Wiebe mwwi...@gmail.com wrote: This was the most consistent way to deal with the parameterized dtype in the repr, making it more future-proof at the same time. It was

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Matthew Brett
Hi, On Wed, Jul 27, 2011 at 12:25 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 1:01 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Wed, Jul 27, 2011 at 6:54 PM, Mark Wiebe mwwi...@gmail.com wrote: This was the most consistent way to deal with the parameterized

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 2:44 PM, Matthew Brett matthew.br...@gmail.comwrote: Hi, On Wed, Jul 27, 2011 at 12:25 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 1:01 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Wed, Jul 27, 2011 at 6:54 PM, Mark Wiebe

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 3:09 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Jul 27, 2011 at 14:47, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 2:44 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Wed, Jul 27, 2011 at 12:25 PM, Mark Wiebe

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Matthew Brett
Hi, On Wed, Jul 27, 2011 at 1:12 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 3:09 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Jul 27, 2011 at 14:47, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 2:44 PM, Matthew Brett matthew.br...@gmail.com

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Christopher Jordan-Squire
On Wed, Jul 27, 2011 at 3:09 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Jul 27, 2011 at 14:47, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 2:44 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Wed, Jul 27, 2011 at 12:25 PM, Mark Wiebe

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 4:32 PM, Matthew Brett matthew.br...@gmail.comwrote: Hi, On Wed, Jul 27, 2011 at 1:12 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 3:09 PM, Robert Kern robert.k...@gmail.com wrote: On Wed, Jul 27, 2011 at 14:47, Mark Wiebe mwwi...@gmail.com

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Gael Varoquaux
On Wed, Jul 27, 2011 at 04:59:17PM -0500, Mark Wiebe wrote: but ultimately NumPy needs the ability to change its repr and other details like it in order to progress as a software project. You have to understand that numpy is the core layer on which people have build pretty huge scientific

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 5:07 PM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Wed, Jul 27, 2011 at 04:59:17PM -0500, Mark Wiebe wrote: but ultimately NumPy needs the ability to change its repr and other details like it in order to progress as a software project. You have

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Matthew Brett
Hi, On Wed, Jul 27, 2011 at 3:23 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 5:07 PM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Wed, Jul 27, 2011 at 04:59:17PM -0500, Mark Wiebe wrote:    but ultimately NumPy needs the ability to change its repr and other  

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Mark Wiebe
On Wed, Jul 27, 2011 at 5:47 PM, Matthew Brett matthew.br...@gmail.comwrote: Hi, On Wed, Jul 27, 2011 at 3:23 PM, Mark Wiebe mwwi...@gmail.com wrote: On Wed, Jul 27, 2011 at 5:07 PM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Wed, Jul 27, 2011 at 04:59:17PM -0500, Mark

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Charles R Harris
On Wed, Jul 27, 2011 at 4:07 PM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Wed, Jul 27, 2011 at 04:59:17PM -0500, Mark Wiebe wrote: but ultimately NumPy needs the ability to change its repr and other details like it in order to progress as a software project. You have

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Gael Varoquaux
On Wed, Jul 27, 2011 at 05:25:20PM -0600, Charles R Harris wrote: Well, doc tests are just a losing proposition, no one should be using them for writing tests. It's not like this is a new discovery, doc tests have been known to be unstable for years. Untested documentation is broken