Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-09 Thread Eric Firing
On 07/08/2011 01:31 PM, Mark Wiebe wrote: I've just made pull request 105: https://github.com/numpy/numpy/pull/105 It's merged, which is good, but I have a suggestion relevant to that pull and I suspect to many others to come: use defines and macros to consolidate some of the implementation

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-09 Thread Mark Wiebe
On Sat, Jul 9, 2011 at 12:53 PM, Eric Firing efir...@hawaii.edu wrote: On 07/08/2011 01:31 PM, Mark Wiebe wrote: I've just made pull request 105: https://github.com/numpy/numpy/pull/105 It's merged, which is good, but I have a suggestion relevant to that pull and I suspect to many

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-09 Thread Nathaniel Smith
On Sat, Jul 9, 2011 at 11:29 AM, Mark Wiebe mwwi...@gmail.com wrote: typedef npy_uint8 npy_mask; #define NPY_MASK NPY_UINT8 #define NPY_MASK_ISEXPOSED(mask) (((mask)0x01) != 0) #define NPY_MASK_GETPAYLOAD(mask) (((npy_mask)mask) 1) #define NPY_MASK_MAKEMASK(exposed, payload)

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-09 Thread Mark Wiebe
On Sat, Jul 9, 2011 at 2:38 PM, Nathaniel Smith n...@pobox.com wrote: On Sat, Jul 9, 2011 at 11:29 AM, Mark Wiebe mwwi...@gmail.com wrote: typedef npy_uint8 npy_mask; #define NPY_MASK NPY_UINT8 #define NPY_MASK_ISEXPOSED(mask) (((mask)0x01) != 0) #define NPY_MASK_GETPAYLOAD(mask)

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-09 Thread Nathaniel Smith
On Sat, Jul 9, 2011 at 7:24 PM, Mark Wiebe mwwi...@gmail.com wrote: On Sat, Jul 9, 2011 at 2:38 PM, Nathaniel Smith n...@pobox.com wrote: On Sat, Jul 9, 2011 at 11:29 AM, Mark Wiebe mwwi...@gmail.com wrote: typedef npy_uint8 npy_mask; #define NPY_MASK NPY_UINT8 #define

[Numpy-discussion] code review request: masked dtype transfers

2011-07-08 Thread Mark Wiebe
I've just made pull request 105: https://github.com/numpy/numpy/pull/105 This adds public API PyArray_MaskedCopyInto and PyArray_MaskedMoveInto, which behave analogously to the corresponding unmasked functions. To expose this with a reasonable interface, I added a function np.copyto, which takes

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-08 Thread Eric Firing
On 07/08/2011 01:31 PM, Mark Wiebe wrote: I've just made pull request 105: https://github.com/numpy/numpy/pull/105 This adds public API PyArray_MaskedCopyInto and PyArray_MaskedMoveInto, which behave analogously to the corresponding unmasked functions. To expose this with a reasonable

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-08 Thread Charles R Harris
On Fri, Jul 8, 2011 at 7:48 PM, Eric Firing efir...@hawaii.edu wrote: On 07/08/2011 01:31 PM, Mark Wiebe wrote: I've just made pull request 105: https://github.com/numpy/numpy/pull/105 This adds public API PyArray_MaskedCopyInto and PyArray_MaskedMoveInto, which behave analogously to

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-08 Thread Charles R Harris
On Fri, Jul 8, 2011 at 8:22 PM, Charles R Harris charlesr.har...@gmail.comwrote: On Fri, Jul 8, 2011 at 7:48 PM, Eric Firing efir...@hawaii.edu wrote: On 07/08/2011 01:31 PM, Mark Wiebe wrote: I've just made pull request 105: https://github.com/numpy/numpy/pull/105 This adds public

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-08 Thread Eric Firing
On 07/08/2011 01:31 PM, Mark Wiebe wrote: I've just made pull request 105: https://github.com/numpy/numpy/pull/105 This adds public API PyArray_MaskedCopyInto and PyArray_MaskedMoveInto, which behave analogously to the corresponding unmasked functions. To expose this with a reasonable

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-08 Thread Charles R Harris
On Fri, Jul 8, 2011 at 5:31 PM, Mark Wiebe mwwi...@gmail.com wrote: I've just made pull request 105: https://github.com/numpy/numpy/pull/105 This adds public API PyArray_MaskedCopyInto and PyArray_MaskedMoveInto, which behave analogously to the corresponding unmasked functions. To expose

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-08 Thread Charles R Harris
On Fri, Jul 8, 2011 at 9:24 PM, Charles R Harris charlesr.har...@gmail.comwrote: On Fri, Jul 8, 2011 at 5:31 PM, Mark Wiebe mwwi...@gmail.com wrote: I've just made pull request 105: https://github.com/numpy/numpy/pull/105 This adds public API PyArray_MaskedCopyInto and

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-08 Thread Mark Wiebe
Sorry, looks like I forgot to rebase against master as Chuck pointed out. -Mark On Fri, Jul 8, 2011 at 8:48 PM, Eric Firing efir...@hawaii.edu wrote: On 07/08/2011 01:31 PM, Mark Wiebe wrote: I've just made pull request 105: https://github.com/numpy/numpy/pull/105 This adds public

Re: [Numpy-discussion] code review request: masked dtype transfers

2011-07-08 Thread Mark Wiebe
On Fri, Jul 8, 2011 at 10:04 PM, Eric Firing efir...@hawaii.edu wrote: On 07/08/2011 01:31 PM, Mark Wiebe wrote: I've just made pull request 105: https://github.com/numpy/numpy/pull/105 This adds public API PyArray_MaskedCopyInto and PyArray_MaskedMoveInto, which behave analogously