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

2016-08-31 Thread Stefan van der Walt
On Wed, Aug 31, 2016, at 13:57, Jason Newton wrote: > Hey Ian - I hope I gave Cython a fair comment, but I have to add the > disclaimer that your capability to understand/implement those > solutions/workarounds in that project is greatly enhanced from your > knowing the innards of Cython from being

Re: [Numpy-discussion] Which NumPy/Numpy/numpy spelling?

2016-08-30 Thread Stefan van der Walt
On Mon, Aug 29, 2016, at 04:43, m...@telenczuk.pl wrote: > The documentation is not consistent and it mixes both NumPy and Numpy. > For example, the reference manual uses both spellings in the introduction > paragraph (http://docs.scipy.org/doc/numpy/reference/): > > "This reference manual det

Re: [Numpy-discussion] Multidimension array access in C via Python API

2016-04-05 Thread Stefan Seefeld
..: http://stefanseefeld.github.io/boost.python/doc/html/index.html https://github.com/ndarray/Boost.NumPy Regards, Stefan -- ...ich hab' noch einen Koffer in Berlin... ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Generalize hstack/vstack --> stack; Block matrices like in matlab

2016-01-09 Thread Stefan Otte
it's tested Cons: - the implementation is not super efficient. Temporary copies are created. However, bmat also does that. Feedback is very welcome! Best, Stefan On Sun, May 10, 2015 at 12:33 PM, Stefan Otte wrote: > Hey, > > Just a quick update. I updated the pull request and rena

[Numpy-discussion] Help wanted: implementation of 3D medial axis skeletonization

2015-11-06 Thread Stefan van der Walt
Hi all, I have been approached by a group that is interested in sponsoring the development of 3D skeletonization in scikit-image. One potential starting place would be: http://www.insight-journal.org/browse/publication/181 Is anyone interested in working on this? Please get in touch either on

[Numpy-discussion] querying backend information

2015-11-04 Thread Stefan Seefeld
ckend that might be available, combined with variables (compiler and linker flags, notably) I might have to set. Is that information available at all ? Thanks, Stefan -- ...ich hab' noch einen Koffer in Berlin... ___ NumPy-Discussi

Re: [Numpy-discussion] Fwd: Numpy for data manipulation

2015-10-01 Thread Stefan van der Walt
On 2015-10-01 11:46:59, Alex Rogozhnikov wrote: > Hi, I have written some numpy tips and tricks I am using, which may be > interesting to you. > This is quite long reading, so I've splitted it into two parts: > > http://arogozhnikov.github.io/2015/09/29/NumpyTipsAndTricks1.html > http://arogozhni

Re: [Numpy-discussion] ANN: Numpy 1.10.0rc1 released.

2015-09-24 Thread Stefan van der Walt
On 2015-09-24 00:17:33, Jens Jørgen Mortensen wrote: > jensj@jordan:~$ python > Python 2.7.9 (default, Apr 2 2015, 15:33:21) > [GCC 4.9.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import numpy as np > >>> a = np.zeros((2, 2, 2)) > >>> b = np.zero

Re: [Numpy-discussion] Tentative NumPy Tutorial inaccessible

2015-09-23 Thread Stefan van der Walt
On 2015-09-22 23:53:19, Nathaniel Smith wrote: > On Tue, Sep 22, 2015 at 10:58 PM, Andriy Yurchuk wrote: >> Hi! >> >> The Tentative NumPy Tutorial is no longer accessible by the URL >> http://wiki.scipy.org/Tentative_NumPy_Tutorial, it returns a 403. The link >> to this page is still on NumPy hom

Re: [Numpy-discussion] ANN: numtraits v0.2

2015-09-23 Thread Stefan van der Walt
On 2015-09-23 17:16:14, Nathaniel Smith wrote: >> This looks great! At the moment, a pip install tries to install a >> different version of NumPy, even though I already have the development >> version on my tree. > > FYI the alternative solution is to fix your local numpy install to > give pip an

Re: [Numpy-discussion] ANN: numtraits v0.2

2015-09-23 Thread Stefan van der Walt
Hi Thomas On 2015-09-23 09:39:00, Thomas Robitaille wrote: > We have released a small experimental package called numtraits that > builds on top of the traitlets package and provides a NumericalTrait > class that can be used to validate properties such as: This looks great! At the moment, a pip

Re: [Numpy-discussion] "Become an Open Source Contributor" workshop

2015-09-23 Thread Stefan van der Walt
Hi Jaime On 2015-09-23 14:06:08, Jaime Fernández del Río wrote: >3. If you have organized anything similar in the past, and have material >that I could use to, ahem, draw inspiration from, or recommendations to >make, or whatever, I'd love to hear from you. Here's the new developer w

Re: [Numpy-discussion] Governance model request

2015-09-23 Thread Stefan van der Walt
On 2015-09-23 13:36:35, Fernando Perez wrote: > On Wed, Sep 23, 2015 at 12:57 PM, Matthew Brett > wrote: > >> I see a severe reaction to perceived 'suspicion and innuendo', but I >> see no 'suspicion and innuendo'. Unless you mean that any suggestion >> of potential conflict of interest is suspi

Re: [Numpy-discussion] Governance model request

2015-09-22 Thread Stefan van der Walt
Hi Travis On 2015-09-22 03:44:12, Travis Oliphant wrote: > I'm actually offended that so many at BIDS seem eager to crucify my > intentions when I've done nothing but give away my time, my energy, my > resources, and my sleep to NumPy for many, many years.I guess if your > intent is to drive

Re: [Numpy-discussion] Governance model request

2015-09-22 Thread Stefan van der Walt
Hi Travis On 2015-09-21 23:29:12, Travis Oliphant wrote: > 1) nobody believes that the community should be forced to adopt numba as > part of ufunc core yet --- but this could happen someday just as Cython is > now being adopted but was proposed 8 years ago that it "could be adopted" > That's a

Re: [Numpy-discussion] Governance model request

2015-09-21 Thread Stefan van der Walt
Hi Brian On 2015-09-21 23:28:48, Bryan Van de Ven wrote: >> very hard to do. Currently, e.g., the community is not ready to adopt >> numba as part of the ufunc core. But it's been stated by some that, > > Who are you speaking for? The entire community? Under what mandate? I am speaking on beha

Re: [Numpy-discussion] Governance model request

2015-09-21 Thread Stefan van der Walt
On 2015-09-21 22:15:55, Bryan Van de Ven wrote: > Beyond that, what (even in a broad sense) is an example of a goal that > "Continuum might need" that would conceivably do detriment to the > NumPy community? That it be faster? Simpler to maintain? Easier to > extend? Integrate better with more OS

Re: [Numpy-discussion] Governance model request

2015-09-21 Thread Stefan van der Walt
On 2015-09-20 11:20:28, Travis Oliphant wrote: > I would recommend three possible adjustments to the steering council > concept. > > 1 - define a BDFL for the council. I would nominate chuck Harris > > 2 - limit the council to 3 people. I would nominate chuck, nathaniel, and > pauli. > > 3 - add

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Stefan van der Walt
On 2015-08-28 16:20:33, Pierre-Andre Noel wrote: > If your sequence is not meant to be periodic (i.e., if after one > minute there is no reason why the signal should start back at > the beginning right away), then you should do zero-padding. And > while you zero-pad, you can zero-pad to a s

Re: [Numpy-discussion] Numpy FFT.FFT slow with certain samples

2015-08-28 Thread Stefan van der Walt
On 2015-08-28 11:51:47, Joseph Codadeen wrote: > my_1_minute_noise_with_gaps_truncated - Array len is > 2646070my_1_minute_noise_with_gaps - Array len is 2649674 In [6]: from sympy import factorint In [7]: max(factorint(2646070)) Out[7]: 367 In [8]: max(factorint(2649674)) Out[8]: 1324837

Re: [Numpy-discussion] Comments on governance proposal (was: Notes from the numpy dev meeting at scipy 2015)

2015-08-27 Thread Stefan van der Walt
Hi Sebastian On 2015-08-27 14:45:50, Sebastian Berg wrote: > Agreed. Are not PEP's/NEP's just that (and could possibly be > formalized more, not sure how much they are in the current > proposal) in some sense? Since they have a sponsor/author who > can be said to be assigned to it/responsibl

Re: [Numpy-discussion] Comments on governance proposal (was: Notes from the numpy dev meeting at scipy 2015)

2015-08-27 Thread Stefan van der Walt
On 2015-08-27 11:06:10, Matthew Brett wrote: > So, in the spirit of fruitful discussion, can I ask what y'all > consider to be the current problems with working on numpy (other > than the technical ones). What is numpy doing well, and what > is it doing badly? What risks do we have to plan f

Re: [Numpy-discussion] Comments on governance proposal (was: Notes from the numpy dev meeting at scipy 2015)

2015-08-26 Thread Stefan van der Walt
Hi Matthew On 2015-08-26 10:50:47, Matthew Brett wrote: > In short, the core structure seems to be characteristically > associated with a conservatism and lack of vision that causes > the project to stagnate. Can you describe how a democratic governance structure would look? It's not clear f

Re: [Numpy-discussion] Development workflow (not git tutorial)

2015-08-14 Thread Stefan van der Walt
On 2015-08-14 10:08:11, Benjamin Root wrote: > I should also note that there is currently an open issue with > "pip install -e" and namespace packages. This has been reported > to matplotlib with regards to mpl_toolkits. Essentially, if you > have namespace packages, it doesn't get installed co

Re: [Numpy-discussion] Development workflow (not git tutorial)

2015-08-13 Thread Stefan van der Walt
On 2015-08-13 08:52:22, Anne Archibald wrote: > My current approach is to build an empty virtualenv, pip install > nose, and from the numpy root directory do "python setup.py > build_ext --inplace" and "python -c 'import numpy; > numpy.test()'". This works, for my stock system python, though I

Re: [Numpy-discussion] Create a n-D grid; meshgrid alternative

2015-05-14 Thread Stefan Otte
Hey, I just created a pull request: https://github.com/numpy/numpy/pull/5874 Best, Stefan On Tue, May 12, 2015 at 3:29 PM Stefan Otte wrote: > Hey, > > here is an ipython notebook with benchmarks of all implementations (scroll > to the bottom for plots): > > https:

Re: [Numpy-discussion] Create a n-D grid; meshgrid alternative

2015-05-12 Thread Stefan Otte
ández del Río < jaime.f...@gmail.com> wrote: > On Tue, May 12, 2015 at 1:17 AM, Stefan Otte > wrote: > >> Hello, >> >> indeed I was looking for the cartesian product. >> >> I timed the two stackoverflow answers and the winner is not quite as >

Re: [Numpy-discussion] Create a n-D grid; meshgrid alternative

2015-05-12 Thread Stefan Otte
s and permutations: I could be convenient to have as well. Cheers, Stefan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Create a n-D grid; meshgrid alternative

2015-05-10 Thread Stefan van der Walt
On 2015-05-10 14:46:12, Jaime Fernández del Río wrote: > Isn't what you are trying to build a cartesian product function? > There is a neat, efficient implementation of such a function in > StackOverflow, by our own pv.: > > http://stackoverflow.com/questions/1208118/using-numpy-to-build-an-arr

Re: [Numpy-discussion] Create a n-D grid; meshgrid alternative

2015-05-10 Thread Stefan Otte
I just drafted different versions of the `gridspace` function: https://tmp23.tmpnb.org/user/1waoqQ8PJBJ7/notebooks/2015-05%20gridspace.ipynb Beste Grüße, Stefan On Sun, May 10, 2015 at 1:40 PM, Stefan Otte wrote: > Hey, > > quite often I want to evaluate a function on a grid in a

[Numpy-discussion] Create a n-D grid; meshgrid alternative

2015-05-10 Thread Stefan Otte
paces)]) But maybe something like this should be part of numpy? Best, Stefan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Generalize hstack/vstack --> stack; Block matrices like in matlab

2015-05-10 Thread Stefan Otte
Hey, Just a quick update. I updated the pull request and renamed `stack` into `block`. Have a look: https://github.com/numpy/numpy/pull/5057 I'm sticking with simple initial implementation because it's simple and does what you think it does. Cheers, Stefan On Fri, Oct 31, 2014

Re: [Numpy-discussion] numpy.stack -- which function, if any, deserves the name?

2015-03-16 Thread Stefan Otte
stack, or "barray" for block array? I have the feeling [1] that my use case is more common, but I like the second proposal. Cheers, Stefan [1] Everybody generalizes from oneself. At least I do. [2] http://docs.scipy.org/doc/numpy/reference/generated/numpy.bmat.html ___

Re: [Numpy-discussion] appveyor CI

2015-03-05 Thread Stefan van der Walt
Hi Chuck On 2015-03-05 10:09:08, Charles R Harris wrote: > Anyone familiar with appveyor ? Is > this something we could use to test/build numpy on windows > machines? It is free for open source. We already use this for scikit-image, and you are welcome to grab the s

[Numpy-discussion] ANN: scikit-image 0.11

2015-03-05 Thread Stefan van der Walt
rahan - Salvatore Scaramuzzino - Phil Schaf - Johannes Schönberger - Tim Seifert - Arve Seljebu - Steven Silvester - Julian Taylor - Matěj Týč - Alexey Umnov - Pratap Vardhan - Stefan van der Walt - Joshua Warner - Tony S Yu ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-09 Thread Stefan Reiterer
that discussion.   -Stefan Gesendet: Montag, 09. Februar 2015 um 09:51 Uhr Von: "Nathaniel Smith" An: "Discussion of Numerical Python" Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful On 8 Feb 2015 23:34, "Stefan Reiterer" <dom...@gmx.n

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
That sounds like a good idea! I didn't see any real good examples of usage after some googling. Giving more examples of effective usage could also clear more things up regarding design decisions. Additionally I'm always interested in learning some new tricks :)   Cheers, Stefan  

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
. On the other hand arrays are beautiful, but not exactly intended to use for linear algebra.   So maybe the better way would be not to add warnings to braodcasting operations, but to overhaul the matrix class to make it more attractive for numerical linear algebra(?)   Cheers, Stefan Ges

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
thats the reason I started this discussion. Till now the only way out of the misery is to make proper unit tests, and to be careful as hell with dimensions and shape checks.   Providing optional warnings just would be an elegant way out of this.   Cheers, Stefan Gesendet: Sonntag, 08. Fe

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
merits. Gesendet: Sonntag, 08. Februar 2015 um 22:17 Uhr Von: "Charles R Harris" An: "Discussion of Numerical Python" Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful     On Sun, Feb 8, 2015 at 2:14 PM, Stefan Reiterer <dom...@gmx.net> wrote:

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
Yeah I'm aware of that, that's the reason why I suggested a warning level as an alternative. Setting no warnings as default would avoid breaking existing code. Gesendet: Sonntag, 08. Februar 2015 um 22:08 Uhr Von: "Eelco Hoogendoorn" An: "Discussion of Numerical Python" Betreff: Re: [Numpy-di

[Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread Stefan Reiterer
always, 3 = Forbid aka throw exception, with 0 as default. This would avoid breaking other code, and give the user some control over braodcasting.   Kind regards, Stefan     ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http

Re: [Numpy-discussion] Context manager for seterr

2014-12-14 Thread Stefan van der Walt
On 2014-12-15 02:23:18, Julian Taylor wrote: > already exists as np.errstate: > > with np.errstate(divide='ignore'): With 'ignore' a warning is still raised--is this by choice? >>> import numpy as np >>> x = np.array([0, 1, 2.]) >>> with np.errstate(divide='ignore'): ... x/x ... __main__:2:

Re: [Numpy-discussion] Context manager for seterr

2014-12-14 Thread Stefan van der Walt
On 2014-12-15 02:23:18, Julian Taylor wrote: > with np.errstate(divide='ignore'): Perfect, thanks! Stéfan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] Context manager for seterr

2014-12-14 Thread Stefan van der Walt
Hi all, Since the topic of context managers recently came up, what do you think of adding a context manager for seterr? with np.seterr(divide='ignore'): frac = num / denom Stéfan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://m

Re: [Numpy-discussion] slicing an n-dimensional array

2014-12-04 Thread Stefan van der Walt
On 2014-12-04 03:41:35, Jaime Fernández del Río wrote: > nx = np.arange(A.shape[0])[:, np.newaxis] > ny = np.arange(A.shape[1]) > C = A[nx, ny, B] That's the correct answer--in my answer I essentially wrote C = A[B] (== A[B, :, :]) which broadcasts the shape of B against the second and third di

Re: [Numpy-discussion] slicing an n-dimensional array

2014-12-03 Thread Stefan van der Walt
Hi Catherine On 2014-12-04 01:12:30, Moroney, Catherine M (398E) wrote: > I have an array "A" of shape (NX, NY, NZ), and then I have a second array "B" > of shape (NX, NY) > that ranges from 0 to NZ in value. > > I want to create a third array "C" of shape (NX, NY) that holds the > "B"-th slice

Re: [Numpy-discussion] Initializing array from buffer

2014-11-17 Thread Stefan van der Walt
Hi Andrea On 2014-11-16 19:42:09, Andrea Arteaga wrote: > My use case is the following: we have a some 3D arrays in our C++ > framework. The ordering of the elements in these arrays is neither C nor > Fortran style: it might be IJK (i.e. C style, 3rd dimension contiguous in > memory), KJI (i.e. F

[Numpy-discussion] Subscribing to mailinglist not possible / sites down

2014-11-12 Thread Stefan Otte
http://www.downforeveryoneorjustme.com/http://projects.scipy.org/pipermail/scipy-dev/ Best, Stefan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] FFT of 2D array along last axis

2014-11-06 Thread Stefan van der Walt
Hi Brad On 2014-11-07 00:51:02, Brad Buran wrote: > On Windows 7 using Anaconda with numpy 1.9.1 I get False (indicating that > the FFT is not treating each row separately). When I test on a Ubuntu box > using numpy 1.9.1 I get True. Is this expected behavior? If I understand > the documentati

Re: [Numpy-discussion] median filtering a masked array

2014-11-06 Thread Stefan van der Walt
On 2014-11-06 11:10:29, Daπid wrote: > On 5 November 2014 19:11, Moroney, Catherine M (398E) > wrote: >> What is the recommended way of doing a fast median filter on an array where >> only >> certain elements of the array need to be calculated? I'm trying to avoid a >> nested loop over all (I,J

Re: [Numpy-discussion] Generalize hstack/vstack --> stack; Block matrices like in matlab

2014-10-31 Thread Stefan Otte
else: arr_rows.append(concatenate(row, axis=-1)) return concatenate(arr_rows, axis=0) if isinstance(obj, N.ndarray): return obj I basically turned the old `bmat` into `stack` and removed the matrix calls. Best, Stefan On Wed, Oct 29, 2014 at 3:59 PM, Stefan

Re: [Numpy-discussion] Generalize hstack/vstack --> stack; Block matrices like in matlab

2014-10-29 Thread Stefan Otte
and the feature to specify a string representation of the block matrix is nice. Best, Stefan On Tue, Oct 28, 2014 at 7:46 PM, Nathaniel Smith wrote: > On 28 Oct 2014 18:34, "Stefan Otte" wrote: >> >> Hey, >> >> In the last weeks I tested `np.asarray(np.bmat

Re: [Numpy-discussion] FFTS for numpy's FFTs (was: Re: Choosing between NumPy and SciPy functions)

2014-10-28 Thread Stefan van der Walt
On 2014-10-28 19:55:57, Daniele Nicolodi wrote: > On 28/10/14 18:44, Stefan van der Walt wrote: >> On 2014-10-28 19:37:17, Daniele Nicolodi wrote: >>> On 28/10/14 16:50, David Cournapeau wrote: >>>> Nothing impossible (looks like Sony at least uses this code on wi

Re: [Numpy-discussion] Generalize hstack/vstack --> stack; Block matrices like in matlab

2014-10-28 Thread Stefan Otte
implementation is only 5 lines and by using `bmat` which would reduce that even more.) Best, Stefan On Fri, Sep 19, 2014 at 4:47 PM, Paul Hobson wrote: > Hey Ben, > > Side note: I've had to do the same thing for stitching curvilinear model > grid coordinates together. Usings

Re: [Numpy-discussion] FFTS for numpy's FFTs (was: Re: Choosing between NumPy and SciPy functions)

2014-10-28 Thread Stefan van der Walt
On 2014-10-28 19:37:17, Daniele Nicolodi wrote: > On 28/10/14 16:50, David Cournapeau wrote: >> Nothing impossible (looks like Sony at least uses this code on windows: >> https://github.com/anthonix/ffts/issues/27#issuecomment-40204403), but >> not a 2 hours thing either. > > One of the downsides

Re: [Numpy-discussion] Choosing between NumPy and SciPy functions

2014-10-28 Thread Stefan van der Walt
Hi Michael On 2014-10-27 15:26:58, D. Michael McFarland wrote: > What I would like to ask about is the situation this illustrates, where > both NumPy and SciPy provide similar functionality (sometimes identical, > to judge by the documentation). Is there some guidance on which is to > be preferr

Re: [Numpy-discussion] higher accuracy in diagonialzation

2014-10-27 Thread Stefan van der Walt
On 2014-10-27 10:37:58, Sunghwan Choi wrote: > I am now diagonalizing a 200-by-200 symmetric matrix. But the two methods, > scipy.linalg.eigh and numpy.linalg.eigh give significantly different result. > The results from two methods are different within 10^-4 order. One of them > is inaccurate or b

Re: [Numpy-discussion] Best way to expose std::vector to be used with numpy

2014-10-14 Thread Stefan Seefeld
is at >> least a memoryview object in python 2, which maybe could be used to the >> same effect? > > > No memoryview in python2.6, but the older buffer protocol it there. Is Boost Python an option? > Boost.Numpy may be a useful tool to use

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Stefan van der Walt
Hi Warren On 2014-10-12 00:51:56, Warren Weckesser wrote: > A small wart in this API is the meaning of > > shuffle(a, independent=False, axis=None) > > It could be argued that the correct behavior is to leave the > array unchanged. I like the suggested changes. Since "independent" loses its m

Re: [Numpy-discussion] Generalize hstack/vstack --> stack; Block matrices like in matlab

2014-09-09 Thread Stefan Otte
r implementing `stack`? More code leads to more bugs and maintenance work. Best, Stefan On Tue, Sep 9, 2014 at 12:14 AM, cjw wrote: > > On 08-Sep-14 4:40 PM, Joseph Martinot-Lagarde wrote: >> Le 08/09/2014 15:29, Stefan Otte a écrit : >>> Hey, >>> >>&

[Numpy-discussion] Generalize hstack/vstack --> stack; Block matrices like in matlab

2014-09-08 Thread Stefan Otte
case `stack` replaced `hstack` and `vstack` almost completely. If you're interested in including it in numpy I created a pull request [1]. I'm looking forward to getting some feedback! Best, Stefan [1] https://github.com/numpy/numpy

Re: [Numpy-discussion] numpy 1.9b1 bug in pad function?

2014-06-14 Thread Stefan van der Walt
On 2014-06-14 14:40:29, Nadav Horesh wrote: > TypeError: pad() missing 1 required positional argument: 'pad_width' I've added a PR here for further discussion: https://github.com/numpy/numpy/pull/4808 Stéfan ___ NumPy-Discussion mailing list NumPy-Dis

Re: [Numpy-discussion] numpy 1.9b1 bug in pad function?

2014-06-14 Thread Stefan van der Walt
On 2014-06-14 14:40:29, Nadav Horesh wrote: > This is most likely a documentation error since: > > In [7]: np.pad(a) > --- > TypeError Traceback (most recent call last) > in () > > 1 np.pad

Re: [Numpy-discussion] NumPy C API question

2014-05-22 Thread Stefan Seefeld
Hi Nathaniel, On 2014-05-21 20:15, Nathaniel Smith wrote: > Hi Stefan, > > One possibility that comes to mind: you may want in any case some way > to temporarily "pin" an object's memory in place (e.g., to prevent one > thread trying to migrate it while some other

Re: [Numpy-discussion] NumPy C API question

2014-05-21 Thread Stefan Seefeld
It seems I have some more design to do. Thanks, Stefan -- ...ich hab' noch einen Koffer in Berlin... ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] NumPy C API question

2014-05-21 Thread Stefan Seefeld
tate doing that ? Many thanks, Stefan -- ...ich hab' noch einen Koffer in Berlin... ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Proposal: Chaining np.dot with mdot helper function

2014-02-24 Thread Stefan Otte
nd print out a numpy expression. It's kinda handy but do we actually need it? Beste Grüße, Stefan On Thu, Feb 20, 2014 at 8:39 PM, Nathaniel Smith wrote: > On Thu, Feb 20, 2014 at 1:35 PM, Stefan Otte wrote: >> Hey guys, >> >> I quickly hacked together a prototype o

Re: [Numpy-discussion] Proposal: Chaining np.dot with mdot helper function

2014-02-20 Thread Stefan Otte
it in dot. Don't a lot of people use the optional out parameter of dot? Best, Stefan On Thu, Feb 20, 2014 at 4:02 PM, Nathaniel Smith wrote: > If you send a patch that deprecates dot's current behaviour for ndim>2, > we'll probably merge it. (We'd like it to funct

Re: [Numpy-discussion] Proposal: Chaining np.dot with mdot helper function

2014-02-20 Thread Stefan Otte
on is done. Otherwise it simply chains the multiplications. I'll test and benchmark my implementation and create a pull request. Cheers, Stefan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Proposal: Chaining np.dot with mdot helper function

2014-02-18 Thread Stefan Otte
formulas but if the side effect is a performance improvement I can live with that. Pauli Virtanen posed in the issue an older discussion on the mailinglist: http://thread.gmane.org/gmane.comp.python.numeric.general/14288/ Beste Grüße, Stefan On Tue, Feb 18, 2014 at 12:52 AM, wrote: > On

Re: [Numpy-discussion] allocated memory cache for numpy

2014-02-17 Thread Stefan Seefeld
On 02/17/2014 06:56 PM, Nathaniel Smith wrote: > On Mon, Feb 17, 2014 at 3:55 PM, Stefan Seefeld wrote: >> On 02/17/2014 03:42 PM, Nathaniel Smith wrote: >>> Another optimization we should consider that might help a lot in the >>> same situations where this would hel

[Numpy-discussion] Proposal: Chaining np.dot with mdot helper function

2014-02-17 Thread Stefan Otte
and worthy to integrate in numpy? I already created an issuer for this: https://github.com/numpy/numpy/issues/4311 jaimefrio also suggested to do some reordering of the arrays to minimize computation: https://github.com/numpy/numpy/issues/4311#issuecomment-35295857 Best, Stefan

Re: [Numpy-discussion] allocated memory cache for numpy

2014-02-17 Thread Stefan Seefeld
esult value. I believe a technique like that is used in the numexpr package (https://github.com/pydata/numexpr), which I saw announced here recently... FWIW, Stefan PS: Such a loop-fusion technique would also open the door to other optimizations, such as vectorization (s

Re: [Numpy-discussion] ANN: NumPy 1.7.0b1 release

2012-08-31 Thread Stefan Krah
github.com/numpy/numpy/issues > that would be great. If you have time, also with some info about the platform > and how to reproduce it. Or at least a link to the build logs. For the second one there's an issue here: http://projects.scipy.org/numpy/ticket/2193 Stefan Krah

Re: [Numpy-discussion] Unicode revisited

2012-08-04 Thread Stefan Krah
Nathaniel Smith wrote: > On Sat, Aug 4, 2012 at 11:42 AM, Stefan Krah > wrote: > > switch (descr->byteorder) { > > case '<': > > byteorder = -1; > > case '>': > > byteorder = 1;

Re: [Numpy-discussion] Unicode revisited

2012-08-04 Thread Stefan Krah
; } args = Py_BuildValue("(N)", u); if (args == NULL) { return NULL; } u = type->tp_new(type, args, NULL); Py_DECREF(args); return u; } All newbyteorder() test have to be deleted of course. I also think that ucsnarrow.c is no long

Re: [Numpy-discussion] Status of NumPy and Python 3.3

2012-07-29 Thread Stefan Krah
7;clean', - 'install_clib', 'install_scripts', 'bdist', 'bdist_dumb', 'bdist_wininst', ] +from numpy.distutils.command import install_clib __im

Re: [Numpy-discussion] Status of NumPy and Python 3.3

2012-07-29 Thread Stefan Krah
ction, so no checks are done. > As such, I think that my PR simply extends the numpy approach to Python 3.3. Absolutely, I also think that using invalid Unicode strings in 3.2 looks kind of hackish. -- Nothing wrong with your 3.3 implementation, it's the general concept th

Re: [Numpy-discussion] Status of NumPy and Python 3.3

2012-07-29 Thread Stefan Krah
64 64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. in ../nptl/sysdeps/unix/sysv/linux/raise.c (gdb) This should be expected since the byte-swapped strings aren't valid. Stefan Krah ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Status of NumPy and Python 3.3

2012-07-29 Thread Stefan Krah
Stefan Krah wrote: > > .python3.3: numpy/core/src/multiarray/common.c:161: > > PyArray_DTypeFromObjectHelper: Assertion > > `((PyObject*)(temp))->ob_type))->tp_flags & ((1L<<27))) != 0)' failed. > > Aborted > > This also occurs with P

Re: [Numpy-discussion] Status of NumPy and Python 3.3

2012-07-29 Thread Stefan Krah
Stefan Krah wrote: > Then there's another problem in numpy.test() if Python 3.3 is compiled > --with-pydebug: > > .python3.3: numpy/core/src/multiarray/common.c:161: > PyArray_DTypeFromObjectHelper: Assertion > `((PyObject*)(temp))->ob_type))->tp_flag

Re: [Numpy-discussion] Status of NumPy and Python 3.3

2012-07-29 Thread Stefan Krah
Helper: Assertion `((PyObject*)(temp))->ob_type))->tp_flags & ((1L<<27))) != 0)' failed. Aborted Stefan Krah ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Status of NumPy and Python 3.3

2012-07-29 Thread Stefan Krah
more useful if they did this. Stefan Krah ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Status of NumPy and Python 3.3

2012-07-28 Thread Stefan Krah
+args = Py_BuildValue("(Os)", b, "utf-32"); +if (args == NULL) { +Py_DECREF(b); +return NULL; +} +obj = type->tp_new(type, args, NULL); +Py_DECREF(b); +Py_DECREF(args); +return obj; } #endif i

Re: [Numpy-discussion] Status of NumPy and Python 3.3

2012-07-28 Thread Stefan Krah
ble to drop Py_UNICODE altogether. For instance, the line in https://github.com/certik/numpy/commit/d02e36e5c85d5ee444614254643037aafc8deccc should probably be: itemsize = PyUnicode_GetLength(robj) * PyUnicode_KIND(robj) Stefan Krah ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Code Freeze for NumPy 1.7

2012-07-15 Thread Stefan Krah
might be a blocker: Python-3.3 will be released in August and I don't think the issue is fixed yet: http://projects.scipy.org/numpy/ticket/2145 Stefan Krah ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] PyBUF_SIMPLE/PyBUF_FORMAT: casts to unsigned bytes

2011-09-02 Thread Stefan Krah
Stefan Krah wrote: > Dag Sverre Seljebotn wrote: > > Under 2), would it make sense to also export the contents of a > > Fortran-contiguous buffer as a raw byte stream? I was just the other week > > writing code to serialize an array in Fortran order to a binary stream. &g

Re: [Numpy-discussion] PyBUF_SIMPLE/PyBUF_FORMAT: casts to unsigned bytes

2011-09-01 Thread Stefan Krah
ow should the buffer be used if itemsize is set to 1? For example, it seems impossible to implement tobytes() if the real itemsize is missing. Travis, if you have time, it would be very nice to have your input on this one, too. Stefan Krah [1] format: "a NULL-terminated format-string (f

Re: [Numpy-discussion] memoryview shape/strides representation for ndim = 0

2011-08-23 Thread Stefan Krah
Mark Dickinson wrote: > On Mon, Aug 22, 2011 at 1:30 PM, Stefan Krah > wrote: > > Numpy arrays and memoryview currently have different representations > > for shape and strides if ndim = 0: [...] > > I think the Numpy representation is nicer. Also, I think that memoryvie

[Numpy-discussion] PyBUF_SIMPLE/PyBUF_FORMAT: casts to unsigned bytes

2011-08-23 Thread Stefan Krah
that the new memoryview object has a managed buffer that takes a snapshot of the original exporter's buffer (See: http://bugs.python.org/issue10181). Now, since getbuffer requests to the memoryview object cannot be redirected to the original object, strict rules are needed for memory_getbuf().

[Numpy-discussion] memoryview shape/strides representation for ndim = 0

2011-08-22 Thread Stefan Krah
ible to change the representation in memoryview. Travis, was the "shape is None" representation used for compatibility with ctypes? Would it be possible or advisable to use the Numpy representation? Stefan Krah ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] PyBUF_SIMPLE requests

2011-07-16 Thread Stefan Krah
ding to the C-API docs a consumer would be allowed to access buf[9], which would be invalid. Or is a consumer supposed to observe ndim = 0 and treat the result as a scalar? If so, there is a problem with this approach. For example,

Re: [Numpy-discussion] Strange behaviour with for loops + numpy arrays

2011-01-17 Thread Stefan Reiterer
ays > A Monday 17 January 2011 17:02:43 Stefan Reiterer escrigué: > > Hi all! > > > > I made some "performance" tests with numpy to compare numpy on one > > cpu with mpi on 4 processesors, and something appears quite strange > > to me: > > &

[Numpy-discussion] Strange behaviour with for loops + numpy arrays

2011-01-17 Thread Stefan Reiterer
Hi all! I made some "performance" tests with numpy to compare numpy on one cpu with mpi on 4 processesors, and something appears quite strange to me: I have the following code: N = 2**10*4 K = 16000 x = numpy.random.randn(N).astype(numpy.float32) x *= 10**10 print "x:", x t1 = time.time() #do

Re: [Numpy-discussion] HOWTO build NumPy without external math libs

2010-07-13 Thread Stefan Seefeld
ense that I build the package on one machine, then distribute it onto a set of hosts, which don't all look equal, but equal enough as to allow me to reuse the compiled NumPy package, as long as it doesn't depend on the particular linalg libs t

[Numpy-discussion] HOWTO build NumPy without external math libs

2010-07-10 Thread Stefan Seefeld
up.py ? (`setup.py build --help` didn't report anything.) Thanks, Stefan -- ...ich hab' noch einen Koffer in Berlin... ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Medians that ignore values

2008-09-19 Thread Stefan Van der Walt
On 19 Sep 2008, at 16:07 , Alan G Isaac wrote: > On 9/19/2008 4:35 AM David Cournapeau apparently wrote: >> I never use NaN as missing value > > What do you use? Masked arrays. Using NaN's for missing values is dangerous. You may do some operation, which generates invalid results, and then you

Re: [Numpy-discussion] change memmap.sync function

2008-02-22 Thread Stefan van der Walt
rg/scipy/numpy/changeset/4817 If anyone objects, please revert. Chris, hope you don't mind that I went ahead so long -- I committed before noticing that you were working on the module earlier. Then again, you guys are probably all in bed by

Re: [Numpy-discussion] matrix wart

2008-02-22 Thread Stefan van der Walt
>>> M[0] > >> matrix([[1, 2]]) > >> >>> M[0][0] > >> matrix([[1, 2]]) > > > On Fri, 22 Feb 2008, Stefan van der Walt apparently wrote: > > This is exactly what I would expect for matrices: M[0] is > > the first row of th

  1   2   3   4   >