[Numpy-discussion] Compiling NumPy for iOS PyQt app?

2015-09-20 Thread David Morris
I have a PyQt app running on iOS and would like to add NumPy to improve
calculation speed.  I see a few python interpreters in the app store which
use NumPy so it must be possible, however I have not been able to find any
information on the build process for the iOS cross compile.

We are building a python with all libraries static linked.  Here is the
environment:

iOS 8.0+
Python 3.4
PyQt 5.5
Qt 5.5
pyqtdeploy

Any help getting NumPy compiled into the iOS app?

Thank you,
David
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Question about structure arrays

2015-11-09 Thread David Morris
On Nov 7, 2015 2:58 PM, "aerojockey"  wrote:
>
> Hello,
>
> Recently I made some changes to a program I'm working on, and found that
the
> changes made it four times slower than before.  After some digging, I
found
> out that one of the new costs was that I added structure arrays.  Inside a
> low-level loop, I create a structure array, populate it Python, then turn
it
> over to some handwritten C code for processing.  It turned out that, when
> passed a structure array as a dtype, numpy has to parse the dtype, which
> included calls to re.match and eval.
>
> Now, this is not a big deal for me to work around by using ordinary
slicing
> and such, and also I can improve things by reusing arrays.  Since this is
> inner loop stuff, sacrificing readability for speed is an appropriate
> tradeoff.
>
> Nevertheless, I was curious if there was a way (or any plans for there to
be
> a way) to compile a struture array dtype.  I realize it's not the
> bread-and-butter of numpy, but it turned out to be a very convenient
feature
> for my use case (populating an array of structures to pass off to C).

I was just looking into structured arrays. In case it is relevant:  Are you
using certain 1.10? They are apparently a LOT slower than 1.9.3, an issue
which will be fixed in a future version.

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


[Numpy-discussion] Unable to pickle numpy array on iOS

2016-05-02 Thread David Morris
I have an application running on iOS where I pickle a numpy array in order
to save it for later use.  However, I receive the following error:

pickle.dumps(arr)
...
_pickle.PicklingError: Can't pickle :
import of module 'multiarray' failed

On a desktop system (OSX), there is no problem dumping the array.

I am using NumPy v1.9.3

Any ideas on why this might be happening?

Thank you,
David
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] State-of-the-art to use a C/C++ library from Python

2016-08-31 Thread David Morris
On Wed, Aug 31, 2016 at 2:28 PM, Michael Bieri  wrote:

> Hi all
>
> There are several ways on how to use C/C++ code from Python with NumPy, as
> given in http://docs.scipy.org/doc/numpy/user/c-info.html . Furthermore,
> there's at least pybind11.
>
> I'm not quite sure which approach is state-of-the-art as of 2016. How
> would you do it if you had to make a C/C++ library available in Python
> right now?
>
> In my case, I have a C library with some scientific functions on matrices
> and vectors. You will typically call a few functions to configure the
> computation, then hand over some pointers to existing buffers containing
> vector data, then start the computation, and finally read back the data.
> The library also can use MPI to parallelize.
>

I have been delighted with Cython for this purpose.  Great integration with
NumPy (you can access numpy arrays directly as C arrays), very python like
syntax and amazing performance.

Good luck,

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