Re: [Numpy-discussion] request for SWIG numpy.i users

2013-06-20 Thread Tom Krauss
Hi Egor - I just read through your blog post, thanks for describing those
new list-of-array type maps.  It helps to see your motivation and some
examples.  I'll keep it in mind if I ever have a list of large arrays to
process for which creating a numpy array first is not desirable.
- Tom


On Tue, Jun 18, 2013 at 6:36 AM, Egor Zindy ezi...@gmail.com wrote:

 Dear all,

 after some code clean-up / testing and a few additions, I've now sent
 a pull request to numpy:master (#3451).
 https://github.com/numpy/numpy/pull/3451

 I also made a blog post to explain the new typemaps I would like included:

 http://egorzindy.blogspot.co.uk/2013/06/new-numpyi-typemaps-for-working-with.html

 Any comments appreciated.

 Kind regards,
 Egor


 On 9 June 2013 09:20, Egor Zindy ezi...@gmail.com wrote:
  Thanks Tom,
 
  before we ship it, I'd love to have some feedback on the new ARGOUT_VIEWM
  type.
 
  I used to create my managed arrays using
 
  PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
 
  but since this function is deprecated, and because of Bill's background
 work
  to bring numpy.i up to date, I now use capsules for this:
 
  PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME,
  free_cap);
 
  ... I'll admit it took longer than expected to get this right.
 
  Would you mind testing my latest numpy.i changes hosted on github?
  https://github.com/zindy/numpy/tree/numpy-swig/doc/swig
 
  It's great that you are testing on a mac, I don't have one to test on
 yet.
 
 
  It worked fine, although I use only a fraction of the capabilities that
 it
  includes.
 
  Same here, but overall, it should be quit easy to choose the data type
 you
  need. Narrow down it down to a type between IN_ARRAY / INPLACE_ /
 ARGOUT_ /
  ARGOUT_VIEW/VIEWM
  http://wiki.scipy.org/Cookbook/SWIG_NumPy_examples
  http://wiki.scipy.org/Cookbook/SWIG_Memory_Deallocation (I'll update
 these
  when I have a sec)
 
  ... and choose the number of dimensions you need (1/2/3/4). I can't
 comment
  on the Fortran arrays data types though as I don't use them.
 
  Also I've introduced a few of my more esoteric data types in this week,
 but
  I have no idea how popular they will be. If you ever need to speed-up:
 
  a = numpy.ones((1024,1024),numpy.uint8)
  la = [a]*100
  b = numpy.mean(numpy.array(la,float),axis=0).astype(numpy.uint8)
 
  I have just the right type for that :)
  DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3
 
  Kind regards,
  Egor
 
 
  On 9 June 2013 03:33, Tom Krauss thomas.p.kra...@gmail.com wrote:
 
  Hi folks,
 
  I just downloaded Bill's numpy.i at commit 4dcb0679, and tried it out a
  bit on some of my personal projects.  It worked fine, although I use
 only a
  fraction of the capabilities that it includes.
 
   And, it made the warning go away!
 
  I used to get this warning
 
  g++ -g -fPIC -c simple_wrap.cpp -I/usr/include/python2.7
 
 -I/Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include
  In file included from
 
 /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/ndarraytypes.h:1722,
   from
 
 /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/ndarrayobject.h:17,
   from
 
 /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/arrayobject.h:15,
   from simple_wrap.cpp:3062:
 
 
 /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
  warning: #warning Using deprecated NumPy API, disable it by #defining
  NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
 
  but not with this version.
 
  You can see which version of numpy I am using there, and that I am on
 Mac
  OS X 10.8. (10.8.4 specifically)  Python 2.7.2
 
  I'd say SHIP IT!
 
  Nice work, thanks for all your work on numpy and numpy.i.
 
  - Tom Krauss
 
 
 
  On Tue, Jun 4, 2013 at 3:13 PM, Ralf Gommers ralf.gomm...@gmail.com
  wrote:
 
  Hi,
 
  If you're using or are very familiar with SWIG and the numpy.i
 interface
  to it, please help to test and/or review
  https://github.com/numpy/numpy/pull/3148. It's a fairly major update
 to
  numpy.i by Bill Spotz, containing the following:
- support for 4D arrays and memory managed output arguments
- rework for the deprecated API's in numpy 1.6 and 1.7
- a bug fix in a 3D typemap
- documentation improvements
 
  It would be good to have this merged before branching 1.8.x. Not many
 of
  the regular reviewers of numpy PRs are familiar with numpy.i,
 therefore help
  would be much appreciated.
 
  Thanks,
  Ralf
 
 
  

Re: [Numpy-discussion] request for SWIG numpy.i users

2013-06-20 Thread Egor Zindy
Thanks Tom,

 It helps to see your motivation and some
 examples.  I'll keep it in mind if I ever have a list of large arrays to
 process for which creating a numpy array first is not desirable.

by documenting numpy.i typemaps, I'm hoping to get a good feel for
whichever use they are best suited for. Doing it in the open means I
get valuable feedback in return.

Cheers,
Egor

On 20 June 2013 13:26, Tom Krauss thomas.p.kra...@gmail.com wrote:
 Hi Egor - I just read through your blog post, thanks for describing those
 new list-of-array type maps.  It helps to see your motivation and some
 examples.  I'll keep it in mind if I ever have a list of large arrays to
 process for which creating a numpy array first is not desirable.
 - Tom


 On Tue, Jun 18, 2013 at 6:36 AM, Egor Zindy ezi...@gmail.com wrote:

 Dear all,

 after some code clean-up / testing and a few additions, I've now sent
 a pull request to numpy:master (#3451).
 https://github.com/numpy/numpy/pull/3451

 I also made a blog post to explain the new typemaps I would like included:

 http://egorzindy.blogspot.co.uk/2013/06/new-numpyi-typemaps-for-working-with.html

 Any comments appreciated.

 Kind regards,
 Egor


 On 9 June 2013 09:20, Egor Zindy ezi...@gmail.com wrote:
  Thanks Tom,
 
  before we ship it, I'd love to have some feedback on the new
  ARGOUT_VIEWM
  type.
 
  I used to create my managed arrays using
 
  PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
 
  but since this function is deprecated, and because of Bill's background
  work
  to bring numpy.i up to date, I now use capsules for this:
 
  PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME,
  free_cap);
 
  ... I'll admit it took longer than expected to get this right.
 
  Would you mind testing my latest numpy.i changes hosted on github?
  https://github.com/zindy/numpy/tree/numpy-swig/doc/swig
 
  It's great that you are testing on a mac, I don't have one to test on
  yet.
 
 
  It worked fine, although I use only a fraction of the capabilities that
  it
  includes.
 
  Same here, but overall, it should be quit easy to choose the data type
  you
  need. Narrow down it down to a type between IN_ARRAY / INPLACE_ /
  ARGOUT_ /
  ARGOUT_VIEW/VIEWM
  http://wiki.scipy.org/Cookbook/SWIG_NumPy_examples
  http://wiki.scipy.org/Cookbook/SWIG_Memory_Deallocation (I'll update
  these
  when I have a sec)
 
  ... and choose the number of dimensions you need (1/2/3/4). I can't
  comment
  on the Fortran arrays data types though as I don't use them.
 
  Also I've introduced a few of my more esoteric data types in this week,
  but
  I have no idea how popular they will be. If you ever need to speed-up:
 
  a = numpy.ones((1024,1024),numpy.uint8)
  la = [a]*100
  b = numpy.mean(numpy.array(la,float),axis=0).astype(numpy.uint8)
 
  I have just the right type for that :)
  DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3
 
  Kind regards,
  Egor
 
 
  On 9 June 2013 03:33, Tom Krauss thomas.p.kra...@gmail.com wrote:
 
  Hi folks,
 
  I just downloaded Bill's numpy.i at commit 4dcb0679, and tried it out a
  bit on some of my personal projects.  It worked fine, although I use
  only a
  fraction of the capabilities that it includes.
 
   And, it made the warning go away!
 
  I used to get this warning
 
  g++ -g -fPIC -c simple_wrap.cpp -I/usr/include/python2.7
 
  -I/Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include
  In file included from
 
  /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/ndarraytypes.h:1722,
   from
 
  /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/ndarrayobject.h:17,
   from
 
  /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/arrayobject.h:15,
   from simple_wrap.cpp:3062:
 
 
  /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
  warning: #warning Using deprecated NumPy API, disable it by #defining
  NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
 
  but not with this version.
 
  You can see which version of numpy I am using there, and that I am on
  Mac
  OS X 10.8. (10.8.4 specifically)  Python 2.7.2
 
  I'd say SHIP IT!
 
  Nice work, thanks for all your work on numpy and numpy.i.
 
  - Tom Krauss
 
 
 
  On Tue, Jun 4, 2013 at 3:13 PM, Ralf Gommers ralf.gomm...@gmail.com
  wrote:
 
  Hi,
 
  If you're using or are very familiar with SWIG and the numpy.i
  interface
  to it, please help to test and/or review
  https://github.com/numpy/numpy/pull/3148. It's a fairly major 

Re: [Numpy-discussion] request for SWIG numpy.i users

2013-06-18 Thread Egor Zindy
Dear all,

after some code clean-up / testing and a few additions, I've now sent
a pull request to numpy:master (#3451).
https://github.com/numpy/numpy/pull/3451

I also made a blog post to explain the new typemaps I would like included:
http://egorzindy.blogspot.co.uk/2013/06/new-numpyi-typemaps-for-working-with.html

Any comments appreciated.

Kind regards,
Egor


On 9 June 2013 09:20, Egor Zindy ezi...@gmail.com wrote:
 Thanks Tom,

 before we ship it, I'd love to have some feedback on the new ARGOUT_VIEWM
 type.

 I used to create my managed arrays using

 PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);

 but since this function is deprecated, and because of Bill's background work
 to bring numpy.i up to date, I now use capsules for this:

 PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME,
 free_cap);

 ... I'll admit it took longer than expected to get this right.

 Would you mind testing my latest numpy.i changes hosted on github?
 https://github.com/zindy/numpy/tree/numpy-swig/doc/swig

 It's great that you are testing on a mac, I don't have one to test on yet.


 It worked fine, although I use only a fraction of the capabilities that it
 includes.

 Same here, but overall, it should be quit easy to choose the data type you
 need. Narrow down it down to a type between IN_ARRAY / INPLACE_ / ARGOUT_ /
 ARGOUT_VIEW/VIEWM
 http://wiki.scipy.org/Cookbook/SWIG_NumPy_examples
 http://wiki.scipy.org/Cookbook/SWIG_Memory_Deallocation (I'll update these
 when I have a sec)

 ... and choose the number of dimensions you need (1/2/3/4). I can't comment
 on the Fortran arrays data types though as I don't use them.

 Also I've introduced a few of my more esoteric data types in this week, but
 I have no idea how popular they will be. If you ever need to speed-up:

 a = numpy.ones((1024,1024),numpy.uint8)
 la = [a]*100
 b = numpy.mean(numpy.array(la,float),axis=0).astype(numpy.uint8)

 I have just the right type for that :)
 DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3

 Kind regards,
 Egor


 On 9 June 2013 03:33, Tom Krauss thomas.p.kra...@gmail.com wrote:

 Hi folks,

 I just downloaded Bill's numpy.i at commit 4dcb0679, and tried it out a
 bit on some of my personal projects.  It worked fine, although I use only a
 fraction of the capabilities that it includes.

  And, it made the warning go away!

 I used to get this warning

 g++ -g -fPIC -c simple_wrap.cpp -I/usr/include/python2.7
 -I/Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include
 In file included from
 /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/ndarraytypes.h:1722,
  from
 /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/ndarrayobject.h:17,
  from
 /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/arrayobject.h:15,
  from simple_wrap.cpp:3062:

 /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
 warning: #warning Using deprecated NumPy API, disable it by #defining
 NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION

 but not with this version.

 You can see which version of numpy I am using there, and that I am on Mac
 OS X 10.8. (10.8.4 specifically)  Python 2.7.2

 I'd say SHIP IT!

 Nice work, thanks for all your work on numpy and numpy.i.

 - Tom Krauss



 On Tue, Jun 4, 2013 at 3:13 PM, Ralf Gommers ralf.gomm...@gmail.com
 wrote:

 Hi,

 If you're using or are very familiar with SWIG and the numpy.i interface
 to it, please help to test and/or review
 https://github.com/numpy/numpy/pull/3148. It's a fairly major update to
 numpy.i by Bill Spotz, containing the following:
   - support for 4D arrays and memory managed output arguments
   - rework for the deprecated API's in numpy 1.6 and 1.7
   - a bug fix in a 3D typemap
   - documentation improvements

 It would be good to have this merged before branching 1.8.x. Not many of
 the regular reviewers of numpy PRs are familiar with numpy.i, therefore help
 would be much appreciated.

 Thanks,
 Ralf


 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion



 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion


___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] request for SWIG numpy.i users

2013-06-09 Thread Egor Zindy
Thanks Tom,

before we ship it, I'd love to have some feedback on the new ARGOUT_VIEWM
type.

I used to create my managed arrays using

PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);

but since this function is deprecated, and because of Bill's background
work to bring numpy.i up to date, I now use capsules for this:

PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME,
free_cap);

... I'll admit it took longer than expected to get this right.

Would you mind testing my latest numpy.i changes hosted on github?
https://github.com/zindy/numpy/tree/numpy-swig/doc/swig

It's great that you are testing on a mac, I don't have one to test on yet.

 It worked fine, although I use only a fraction of the capabilities that
it includes.

Same here, but overall, it should be quit easy to choose the data type you
need. Narrow down it down to a type between IN_ARRAY / INPLACE_ / ARGOUT_ /
ARGOUT_VIEW/VIEWM
http://wiki.scipy.org/Cookbook/SWIG_NumPy_examples
http://wiki.scipy.org/Cookbook/SWIG_Memory_Deallocation (I'll update these
when I have a sec)

... and choose the number of dimensions you need (1/2/3/4). I can't comment
on the Fortran arrays data types though as I don't use them.

Also I've introduced a few of my more esoteric data types in this week, but
I have no idea how popular they will be. If you ever need to speed-up:

a = numpy.ones((1024,1024),numpy.uint8)
la = [a]*100
b = numpy.mean(numpy.array(la,float),axis=0).astype(numpy.uint8)

I have just the right type for that :)
DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3

Kind regards,
Egor

On 9 June 2013 03:33, Tom Krauss thomas.p.kra...@gmail.com wrote:

 Hi folks,

 I just downloaded Bill's numpy.i 
 https://github.com/wfspotz/numpy/blob/4dcb06796b290ae29d4e73ad995d219087f2e949/doc/swig/numpy.iat
 commit 4dcb0679, and tried it out a bit on some of my personal projects.
  It worked fine, although I use only a fraction of the capabilities that it
 includes.

  And, it made the warning go away!

 I used to get this warning

 g++ -g -fPIC -c simple_wrap.cpp -I/usr/include/python2.7
 -I/Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include
 In file included from
 /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/ndarraytypes.h:1722,
  from
 /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/ndarrayobject.h:17,
  from
 /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/arrayobject.h:15,
  from simple_wrap.cpp:3062:
 /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
 warning: #warning Using deprecated NumPy API, disable it by #defining
 NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION

 but not with this version.

 You can see which version of numpy I am using there, and that I am on Mac
 OS X 10.8. (10.8.4 specifically)  Python 2.7.2

 I'd say SHIP IT!

 Nice work, thanks for all your work on numpy and numpy.i.

 - Tom Krauss



 On Tue, Jun 4, 2013 at 3:13 PM, Ralf Gommers ralf.gomm...@gmail.comwrote:

 Hi,

 If you're using or are very familiar with SWIG and the numpy.i interface
 to it, please help to test and/or review
 https://github.com/numpy/numpy/pull/3148. It's a fairly major update to
 numpy.i by Bill Spotz, containing the following:
   - support for 4D arrays and memory managed output arguments
   - rework for the deprecated API's in numpy 1.6 and 1.7
   - a bug fix in a 3D typemap
   - documentation improvements

 It would be good to have this merged before branching 1.8.x. Not many of
 the regular reviewers of numpy PRs are familiar with numpy.i, therefore
 help would be much appreciated.

 Thanks,
 Ralf


 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion



 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion


___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] request for SWIG numpy.i users

2013-06-08 Thread Tom Krauss
Hi folks,

I just downloaded Bill's numpy.i
https://github.com/wfspotz/numpy/blob/4dcb06796b290ae29d4e73ad995d219087f2e949/doc/swig/numpy.iat
commit 4dcb0679, and tried it out a bit on some of my personal projects.
 It worked fine, although I use only a fraction of the capabilities that it
includes.

 And, it made the warning go away!

I used to get this warning

g++ -g -fPIC -c simple_wrap.cpp -I/usr/include/python2.7
-I/Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include
In file included from
/Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/ndarraytypes.h:1722,
 from
/Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/ndarrayobject.h:17,
 from
/Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/arrayobject.h:15,
 from simple_wrap.cpp:3062:
/Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
warning: #warning Using deprecated NumPy API, disable it by #defining
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION

but not with this version.

You can see which version of numpy I am using there, and that I am on Mac
OS X 10.8. (10.8.4 specifically)  Python 2.7.2

I'd say SHIP IT!

Nice work, thanks for all your work on numpy and numpy.i.

- Tom Krauss



On Tue, Jun 4, 2013 at 3:13 PM, Ralf Gommers ralf.gomm...@gmail.com wrote:

 Hi,

 If you're using or are very familiar with SWIG and the numpy.i interface
 to it, please help to test and/or review
 https://github.com/numpy/numpy/pull/3148. It's a fairly major update to
 numpy.i by Bill Spotz, containing the following:
   - support for 4D arrays and memory managed output arguments
   - rework for the deprecated API's in numpy 1.6 and 1.7
   - a bug fix in a 3D typemap
   - documentation improvements

 It would be good to have this merged before branching 1.8.x. Not many of
 the regular reviewers of numpy PRs are familiar with numpy.i, therefore
 help would be much appreciated.

 Thanks,
 Ralf


 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion


___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] request for SWIG numpy.i users

2013-06-06 Thread Egor Zindy
Hi Ralf,

Your post comes just on time! I implemented the memory managed arrays and
noticed a serious problem with my capsule creation code (post I sent to the
list about the update on the 12th of March in reply to Bill Spotz Request
code review of numpy.i changes). For some reason, the code I wrote works
under Linux (or at least on my 12.04 ubuntu machine) but crashes in Windows
/ mingw-64, something I just found out about this week.

Specifically, SWIG_Python_DestroyModule seems to be the wrong function
call for the capsule and cobject destructor and I am really not sure why
the code worked when I was using testing it on my Linux machine.

I should have a bit of time over the week-end to look into this and a
couple of other things.

Anyway, for PyCObject_FromVoidPtr(), the destructor should be a call to
free() and for PyCapsule_New(), the destructor code should be a call to a
free_cap() function with the following content:

%#ifdef SWIGPY_USE_CAPSULE
  void free_cap(PyObject * cap)
  {
void* array = (void*) PyCapsule_GetPointer(cap,SWIGPY_CAPSULE_NAME);
if (array != NULL) free(array);
  }
%#endif

This works both in Linux and Windows / mingw-64.

I'll ping the list when I'm done testing.

Kind regards,
Egor

On 4 June 2013 21:13, Ralf Gommers ralf.gomm...@gmail.com wrote:

 Hi,

 If you're using or are very familiar with SWIG and the numpy.i interface
 to it, please help to test and/or review
 https://github.com/numpy/numpy/pull/3148. It's a fairly major update to
 numpy.i by Bill Spotz, containing the following:
   - support for 4D arrays and memory managed output arguments
   - rework for the deprecated API's in numpy 1.6 and 1.7
   - a bug fix in a 3D typemap
   - documentation improvements

 It would be good to have this merged before branching 1.8.x. Not many of
 the regular reviewers of numpy PRs are familiar with numpy.i, therefore
 help would be much appreciated.

 Thanks,
 Ralf


 ___
 NumPy-Discussion mailing list
 NumPy-Discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion


___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion