Re: [Numpy-discussion] From Python to Numpy

2017-01-05 Thread Alex Rogozhnikov

> 31 дек. 2016 г., в 2:09, Nicolas P. Rougier  
> написал(а):
> 
>> 
>> On 30 Dec 2016, at 20:36, Alex Rogozhnikov  
>> wrote:
>> 
>> Hi Nicolas, 
>> that's a very nice work!
>> 
>>> Comments/questions/fixes/ideas are of course welcome.
>> 
>> Boids example brought my attention too, some comments on it:
>> - I find using complex numbers here very natural, this should speed up 
>> things and also shorten the code (rotating without einsum, etc.)
>> - you probably can speed up things with going to sparse arrays 
>> - and you can go to really large numbers of 'birds' if you combine it with 
>> preliminary splitting of space into squares, thus analyze only birds from 
>> close squares
>> 
>> Also I think worth adding some operations with HSV / HSL color spaces as 
>> those can be visualized easily e.g. on some photo.
>> 
>> Thanks,
>> Alex.
> 
> 
> Thanks.
> 
> I'm not sure to know how to use complex with this example. Could you 
> elaborate ?

Position and velocity are encoded by complex numbers.
Rotation is multiplication by exp(i \phi), translating is adding a complex 
number.
Distance = abs(x - y). 

I think, that's all operations you need, but maybe I miss something.

> 
> For the preliminary splitting, a quadtree (scipy KDTree) could also help a 
> lot but I wanted to stick to numpy only.
> A simpler square splitting as you suggest could make thing faster but require 
> some work. I'm not sure yet I see how to restrict analysis to close squares.
> 
> Nicolas
> 
> 
>> 
>> 
>> 
>>> 23 дек. 2016 г., в 12:14, Kiko  написал(а):
>>> 
>>> 
>>> 
>>> 2016-12-22 17:44 GMT+01:00 Nicolas P. Rougier :
>>> 
>>> Dear all,
>>> 
>>> I've just put online a (kind of) book on Numpy and more specifically about 
>>> vectorization methods. It's not yet finished, has not been reviewed and 
>>> it's a bit rough around the edges. But I think there are some material that 
>>> can be interesting. I'm specifically happy with the boids example that show 
>>> a nice combination of numpy and matplotlib strengths.
>>> 
>>> Book is online at: http://www.labri.fr/perso/nrougier/from-python-to-numpy/
>>> Sources are available at: https://github.com/rougier/from-python-to-numpy
>>> 
>>> 
>>> Comments/questions/fixes/ideas are of course welcome.
>>> 
>>> Wow!!! Beautiful.
>>> 
>>> Thanks for sharing.
>>> 
>>> 
>>> 
>>> Nicolas
>>> ___
>>> NumPy-Discussion mailing list
>>> NumPy-Discussion@scipy.org
>>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>> 
>>> ___
>>> NumPy-Discussion mailing list
>>> NumPy-Discussion@scipy.org
>>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>> 
>> ___
>> NumPy-Discussion mailing list
>> NumPy-Discussion@scipy.org
>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
> 
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org 
> https://mail.scipy.org/mailman/listinfo/numpy-discussion 
> 
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Proposed change in memmap offset attribute

2017-01-05 Thread Loïc Estève

Dear all,

I have a PR at https://github.com/numpy/numpy/pull/8443 that proposes to 
change the value of the offset attribute of memmap objects. At the 
moment it is not the offset into the memmap file (as the docstring would 
lead you to believe) but this modulo mmap.ALLOCATIONGRANULARITY.


It was deemed best to double-check on the mailing list whether anyone 
could think of a good reason why this is the case and/or whether anyone 
was using this property of the offset attribute.


If you have comments about this proposed change, it is probably best if 
you do it on the PR in order to keep the discussion all in the same place.


Cheers,
Loïc

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