Re: [Numpy-discussion] Fwd: Windows wheels for testing

2016-02-12 Thread G Young
AFAIK the vcvarsall.bat error occurs when your MSVC directories aren't
properly linked in your system registry, so Python cannot find the file.
This is not a numpy-specific issue, so I certainly would agree that that
failure is not blocking.

Other than that, this build contains the mingw32.lib bug that I fixed here
, but other than that, everything
else passes on relevant Python versions for 32-bit!

On Sat, Feb 13, 2016 at 4:23 AM, Matthew Brett 
wrote:

> On Fri, Feb 12, 2016 at 8:18 PM, R Schumacher  wrote:
> > At 03:45 PM 2/12/2016, you wrote:
> >>
> >> PS C:\tmp> c:\Python35\python -m venv np-testing
> >> PS C:\tmp> .\np-testing\Scripts\Activate.ps1
> >> (np-testing) PS C:\tmp> pip install -f
> >> https://nipy.bic.berkeley.edu/scipy_installers/atlas_builds numpy nose
> >
> >
> > C:\Python34\Scripts>pip install  "D:\Python
> > distros\numpy-1.10.4-cp34-none-win_amd64.whl"
> > Unpacking d:\python distros\numpy-1.10.4-cp34-none-win_amd64.whl
> > Installing collected packages: numpy
> > Successfully installed numpy
> > Cleaning up...
> >
> > C:\Python34\Scripts>..\python
> > Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:16:31) [MSC v.1600 64
> bit
> > (AMD64)] on win32
> > Type "help", "copyright", "credits" or "license" for more information.
>  import numpy
>  numpy.test()
> > Running unit tests for numpy
> > NumPy version 1.10.4
> > NumPy relaxed strides checking option: False
> > NumPy is installed in C:\Python34\lib\site-packages\numpy
> > Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:16:31) [MSC
> > v.1600 64 bit (AMD64)]
> > nose version 1.3.7
> >
> ...FS...
> >
> .S..
> >
> ..C:\Python34\lib\unittest\case.
> > py:162: DeprecationWarning: using a non-integer number instead of an
> integer
> > will result in an error in the future
> >   callable_obj(*args, **kwargs)
> > C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a
> > non-integer number instead of an integer will
> > result in an error in the future
> >   callable_obj(*args, **kwargs)
> > C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a
> > non-integer number instead of an integer will result i
> > n an error in the future
> >   callable_obj(*args, **kwargs)
> >
> ...S
> >
> 
> >
> ..C:\Python34\lib\unittest\case.py:162:
> > Deprecat
> > ionWarning: using a non-integer number instead of an integer will result
> in
> > an error in the future
> >   callable_obj(*args, **kwargs)
> > ..C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a
> > non-integer number instead of an integer will result
> >  in an error in the future
> >   callable_obj(*args, **kwargs)
> > C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a
> > non-integer number instead of an integer will result i
> > n an error in the future
> >   callable_obj(*args, **kwargs)
> > C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a
> > non-integer number instead of an integer will result i
> > n an error in the future
> >   callable_obj(*args, **kwargs)
> > C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a
> > non-integer number instead of an integer will result i
> > n an error in the future
> >   callable_obj(*args, **kwargs)
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> ..

Re: [Numpy-discussion] Fwd: Windows wheels for testing

2016-02-12 Thread Matthew Brett
On Fri, Feb 12, 2016 at 8:18 PM, R Schumacher  wrote:
> At 03:45 PM 2/12/2016, you wrote:
>>
>> PS C:\tmp> c:\Python35\python -m venv np-testing
>> PS C:\tmp> .\np-testing\Scripts\Activate.ps1
>> (np-testing) PS C:\tmp> pip install -f
>> https://nipy.bic.berkeley.edu/scipy_installers/atlas_builds numpy nose
>
>
> C:\Python34\Scripts>pip install  "D:\Python
> distros\numpy-1.10.4-cp34-none-win_amd64.whl"
> Unpacking d:\python distros\numpy-1.10.4-cp34-none-win_amd64.whl
> Installing collected packages: numpy
> Successfully installed numpy
> Cleaning up...
>
> C:\Python34\Scripts>..\python
> Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:16:31) [MSC v.1600 64 bit
> (AMD64)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
 import numpy
 numpy.test()
> Running unit tests for numpy
> NumPy version 1.10.4
> NumPy relaxed strides checking option: False
> NumPy is installed in C:\Python34\lib\site-packages\numpy
> Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:16:31) [MSC
> v.1600 64 bit (AMD64)]
> nose version 1.3.7
> ...FS...
> .S..
> ..C:\Python34\lib\unittest\case.
> py:162: DeprecationWarning: using a non-integer number instead of an integer
> will result in an error in the future
>   callable_obj(*args, **kwargs)
> C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a
> non-integer number instead of an integer will
> result in an error in the future
>   callable_obj(*args, **kwargs)
> C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a
> non-integer number instead of an integer will result i
> n an error in the future
>   callable_obj(*args, **kwargs)
> ...S
> 
> ..C:\Python34\lib\unittest\case.py:162:
> Deprecat
> ionWarning: using a non-integer number instead of an integer will result in
> an error in the future
>   callable_obj(*args, **kwargs)
> ..C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a
> non-integer number instead of an integer will result
>  in an error in the future
>   callable_obj(*args, **kwargs)
> C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a
> non-integer number instead of an integer will result i
> n an error in the future
>   callable_obj(*args, **kwargs)
> C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a
> non-integer number instead of an integer will result i
> n an error in the future
>   callable_obj(*args, **kwargs)
> C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a
> non-integer number instead of an integer will result i
> n an error in the future
>   callable_obj(*args, **kwargs)
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ...K.C:\Python34\lib
> \site-packages\numpy\ma\core.py:989: RuntimeWarning: invalid value
> encountered in multiply
>   masked_da = umath.multiply(m, da)
> C:\Python34\lib\site-packages\numpy\ma\core.py:989: RuntimeWarning: invalid
> value encountered in multiply
>   masked_da = umath.multiply(m, da)
> ..

Re: [Numpy-discussion] Fwd: Windows wheels for testing

2016-02-12 Thread R Schumacher

At 03:45 PM 2/12/2016, you wrote:

PS C:\tmp> c:\Python35\python -m venv np-testing
PS C:\tmp> .\np-testing\Scripts\Activate.ps1
(np-testing) PS C:\tmp> pip install -f
https://nipy.bic.berkeley.edu/scipy_installers/atlas_builds numpy nose


C:\Python34\Scripts>pip install  "D:\Python 
distros\numpy-1.10.4-cp34-none-win_amd64.whl"

Unpacking d:\python distros\numpy-1.10.4-cp34-none-win_amd64.whl
Installing collected packages: numpy
Successfully installed numpy
Cleaning up...

C:\Python34\Scripts>..\python
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:16:31) [MSC v.1600 
64 bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.test()
Running unit tests for numpy
NumPy version 1.10.4
NumPy relaxed strides checking option: False
NumPy is installed in C:\Python34\lib\site-packages\numpy
Python version 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:16:31) 
[MSC v.1600 64 bit (AMD64)]

nose version 1.3.7
...FS...
.S..
..C:\Python34\lib\unittest\case.
py:162: DeprecationWarning: using a non-integer number instead of an 
integer will result in an error in the future

  callable_obj(*args, **kwargs)
C:\Python34\lib\unittest\case.py:162: DeprecationWarning: 
using a non-integer number instead of an integer will

result in an error in the future
  callable_obj(*args, **kwargs)
C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a 
non-integer number instead of an integer will result i

n an error in the future
  callable_obj(*args, **kwargs)
...S

..C:\Python34\lib\unittest\case.py:162: 
Deprecat
ionWarning: using a non-integer number instead of an integer will 
result in an error in the future

  callable_obj(*args, **kwargs)
..C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a 
non-integer number instead of an integer will result

 in an error in the future
  callable_obj(*args, **kwargs)
C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a 
non-integer number instead of an integer will result i

n an error in the future
  callable_obj(*args, **kwargs)
C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a 
non-integer number instead of an integer will result i

n an error in the future
  callable_obj(*args, **kwargs)
C:\Python34\lib\unittest\case.py:162: DeprecationWarning: using a 
non-integer number instead of an integer will result i

n an error in the future
  callable_obj(*args, **kwargs)











...K.C:\Python34\lib
\site-packages\numpy\ma\core.py:989: RuntimeWarning: invalid value 
encountered in multiply

  masked_da = umath.multiply(m, da)
C:\Python34\lib\site-packages\numpy\ma\core.py:989: RuntimeWarning: 
invalid value encountered in multiply

  masked_da = umath.multiply(m, da)

..C:\Python34\lib\site-packages\numpy\core\tests\test_nume

[Numpy-discussion] Subclassing ma.masked_array, code broken after version 1.9

2016-02-12 Thread Gutenkunst, Ryan N - (rgutenk)
Hello all,

In 2009 I developed an application that uses a subclass of masked arrays as a 
central data object. My subclass Spectrum possesses additional attributes along 
with many custom methods. It was very convenient to be able to use standard 
numpy functions for doing arithmetic on these objects. However, my code broke 
with numpy 1.10. I've finally had a chance to track down the problem, and I am 
hoping someone can suggest a workaround.

See below for an example, which is as minimal as I could concoct. In this case, 
I have a Spectrum object that I'd like to take the logarithm of using 
numpy.ma.log, while preserving the value of the "folded" attribute. Up to numpy 
1.9, this worked as expected, but in numpy 1.10 and 1.11 the attribute is not 
preserved.

The change in behavior appears to be driven by a commit made on Jun 16th, 2015 
by Marten van Kerkwijk. In particular, the commit changed 
_MaskedUnaryOperation.__call__ so that the result array's update_from method is 
no longer called with the input array as the argument, but rather the result of 
the numpy UnaryOperation (old line 889, new line 885). Because that 
UnaryOperation doesn't carry my new attribute, it's not present for update_from 
to access. I notice that similar changes were made to MaskedBinaryOperation, 
although I haven't tested those. It's not clear to me from the commit message 
why this particular change was made, so I don't know whether this new behavior 
is intentional.

I know that subclassing arrays isn't widely encouraged, but it has been very 
convenient in my code. Is it still possible to subclass masked_array in such a 
way that functions like numpy.ma.log preserve additional attributes? If so, can 
someone point me in the right direction?

Thanks!
Ryan

*** Begin example

import numpy
print 'Working with numpy {0}'.format(numpy.__version__)

class Spectrum(numpy.ma.masked_array):
def __new__(cls, data, mask=numpy.ma.nomask, data_folded=None):
subarr = numpy.ma.masked_array(data, mask=mask, keep_mask=True, 
   shrink=True)
subarr = subarr.view(cls)
subarr.folded = data_folded

return subarr

def __array_finalize__(self, obj):
if obj is None: 
return
numpy.ma.masked_array.__array_finalize__(self, obj)
self.folded = getattr(obj, 'folded', 'unspecified')

def _update_from(self, obj):
print('Input to update_from: {0}'.format(repr(obj)))
numpy.ma.masked_array._update_from(self, obj)
self.folded = getattr(obj, 'folded', 'unspecified')

def __repr__(self):
return 'Spectrum(%s, folded=%s)'\
% (str(self), str(self.folded))

fs1 = Spectrum([2,3,4.], data_folded=True)
fs2 = numpy.ma.log(fs1)
print('fs2.folded status: {0}'.format(fs2.folded))
print('Expectation is True, achieved with numpy 1.9')

*** End example

--
Ryan Gutenkunst
Assistant Professor
Molecular and Cellular Biology
University of Arizona
phone: (520) 626-0569, office LSS 325
http://gutengroup.mcb.arizona.edu
Latest paper: "Computationally efficient composite likelihood statistics for 
demographic inference"
Molecular Biology and Evolution; http://dx.doi.org/10.1093/molbev/msv255

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


[Numpy-discussion] Fwd: Windows wheels for testing

2016-02-12 Thread Matthew Brett
On Fri, Feb 12, 2016 at 3:15 PM, R Schumacher  wrote:
> At 03:06 PM 2/12/2016, you wrote:
>
>> Any feedback would be very useful,
>
>
> Sure, here's a little:
>
> C:\Python34\Scripts>pip install -f
> https://nipy.bic.berkeley.edu/scipy_installers/atlas_builds numpy
> Requirement already satisfied (use --upgrade to upgrade): numpy in
> c:\python34\lib\site-packages
> Cleaning up...

Thanks - yes - I should maybe have said that testing in a virtual
environment is your best bet.

Here's me testing from Powershell on a 32-bit Windows and on Pythons
3.5 and 2.7:

PS C:\tmp> c:\Python35\python -m venv np-testing
PS C:\tmp> .\np-testing\Scripts\Activate.ps1
(np-testing) PS C:\tmp> pip install -f
https://nipy.bic.berkeley.edu/scipy_installers/atlas_builds numpy nose
Collecting numpy
  Downloading 
https://nipy.bic.berkeley.edu/scipy_installers/atlas_builds/numpy-1.10.4-cp35-none-win32.whl
(6.6MB)
100% || 6.6MB 34kB/s
Collecting nose
  Using cached nose-1.3.7-py3-none-any.whl
Installing collected packages: numpy, nose
Successfully installed nose-1.3.7 numpy-1.10.4
You are using pip version 7.1.2, however version 8.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade
pip' command.
(np-testing) PS C:\tmp> python -c 'import numpy; numpy.test()'
Running unit tests for numpy
NumPy version 1.10.4
NumPy relaxed strides checking option: False
NumPy is installed in C:\tmp\np-testing\lib\site-packages\numpy
Python version 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:16:59) [MSC
v.1900 32 bit (Intel)]
nose version 1.3.7
. [test output]

Now on 2.7

(np-testing) PS C:\tmp> deactivate
PS C:\tmp> C:\Python27\Scripts\pip.exe install virtualenv
[...] output snipped
PS C:\tmp> C:\Python27\Scripts\virtualenv.exe np27-testing
Ignoring indexes: https://pypi.python.org/simple
Collecting pip
Collecting wheel
Collecting setuptools
Installing collected packages: pip, wheel, setuptools
Successfully installed pip-7.1.2 setuptools-18.5 wheel-0.26.0
PS C:\tmp> .\np27-testing\Scripts\activate.ps1
(np27-testing) PS C:\tmp> pip install -f
https://nipy.bic.berkeley.edu/scipy_installers/atlas_builds numpy nose
Collecting numpy
c:\tmp\np27-testing\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:90:
InsecurePlatformWarning: A
true SSLContext object is not available. This prevents urllib3 from
configuring SSL appropriately and may cause certain
SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatf
ormwarning.
  InsecurePlatformWarning
  Downloading 
https://nipy.bic.berkeley.edu/scipy_installers/atlas_builds/numpy-1.10.4-cp27-none-win32.whl
(6.4MB)
100% || 6.4MB 35kB/s
Collecting nose
c:\tmp\np27-testing\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:90:
InsecurePlatformWarning: A
true SSLContext object is not available. This prevents urllib3 from
configuring SSL appropriately and may cause certain
SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatf
ormwarning.
  InsecurePlatformWarning
  Using cached nose-1.3.7-py2-none-any.whl
Installing collected packages: numpy, nose
Successfully installed nose-1.3.7 numpy-1.10.4
You are using pip version 7.1.2, however version 8.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade
pip' command.
(np27-testing) PS C:\tmp> python -c 'import numpy; numpy.test()'
Running unit tests for numpy
NumPy version 1.10.4
NumPy relaxed strides checking option: False
NumPy is installed in c:\tmp\np27-testing\lib\site-packages\numpy
Python version 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32
bit (Intel)]
nose version 1.3.7
.. [etc]

Thanks a lot for testing,

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


Re: [Numpy-discussion] Windows wheels for testing

2016-02-12 Thread R Schumacher

At 03:06 PM 2/12/2016, you wrote:


Any feedback would be very useful,


Sure, here's a little:

C:\Python34\Scripts>pip install -f 
https://nipy.bic.berkeley.edu/scipy_installers/atlas_builds numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in 
c:\python34\lib\site-packages

Cleaning up...


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


[Numpy-discussion] Windows wheels for testing

2016-02-12 Thread Matthew Brett
Hi,

We're talking about putting up Windows wheels for numpy on pypi -
here: https://github.com/numpy/numpy/issues/5479

I've built some wheels that might be suitable - available here:
http://nipy.bic.berkeley.edu/scipy_installers/atlas_builds/

I'd be very grateful if y'all would test these.  They should install
with something like:

pip install -f https://nipy.bic.berkeley.edu/scipy_installers/atlas_builds numpy

This should work for Pythons 2.7, 3.4, 3.5, both 32 and 64-bit.

Any feedback would be very useful,

Cheers,

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


Re: [Numpy-discussion] NumPy 1.11.0b3 released.

2016-02-12 Thread Nathan Goldbaum
https://github.com/numpy/numpy/blob/master/doc/release/1.11.0-notes.rst

On Fri, Feb 12, 2016 at 3:17 PM, Andreas Mueller  wrote:

> Hi.
> Where can I find the changelog?
> It would be good for us to know which changes are done one purpos without
> hunting through the issue tracker.
>
> Thanks,
> Andy
>
>
> On 02/09/2016 09:09 PM, Charles R Harris wrote:
>
> Hi All,
>
> I'm pleased to announce the release of NumPy 1.11.0b3. This beta contains
> additional bug fixes as well as limiting the number of FutureWarnings
> raised by assignment to masked array slices. One issue that remains to be
> decided is whether or not to postpone raising an error for floats used as
> indexes. Sources may be found on Sourceforge
>  and both
> sources and OS X wheels are availble on pypi. Please test, hopefully this
> will be that last beta needed.
>
> As a note on problems encountered, twine uploads continue to fail for me,
> but there are still variations to try. The wheeluploader downloaded wheels
> as it should, but could not upload them, giving the error message
> "HTTPError: 413 Client Error: Request Entity Too Large for url:
> https://www.python.org/pypi";. Firefox also
> complains that http://wheels.scipy.org is incorrectly configured with an
> invalid certificate.
>
> Enjoy,
>
> Chuck
>
>
> ___
> NumPy-Discussion mailing 
> listNumPy-Discussion@scipy.orghttps://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


Re: [Numpy-discussion] NumPy 1.11.0b3 released.

2016-02-12 Thread Andreas Mueller

Hi.
Where can I find the changelog?
It would be good for us to know which changes are done one purpos 
without hunting through the issue tracker.


Thanks,
Andy

On 02/09/2016 09:09 PM, Charles R Harris wrote:

Hi All,

I'm pleased to announce the release of NumPy 1.11.0b3. This beta 
contains additional bug fixes as well as limiting the number of 
FutureWarnings raised by assignment to masked array slices. One issue 
that remains to be decided is whether or not to postpone raising an 
error for floats used as indexes. Sources may be found on Sourceforge 
 and 
both sources and OS X wheels are availble on pypi. Please test, 
hopefully this will be that last beta needed.


As a note on problems encountered, twine uploads continue to fail for 
me, but there are still variations to try. The wheeluploader 
downloaded wheels as it should, but could not upload them, giving the 
error message "HTTPError: 413 Client Error: Request Entity Too Large 
for url: https://www.python.org/pypi";. Firefox also complains that 
http://wheels.scipy.org is incorrectly configured with an invalid 
certificate.


Enjoy,

Chuck


___
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


Re: [Numpy-discussion] [Suggestion] Labelled Array

2016-02-12 Thread Benjamin Root
Re-reading your post, I see you are talking about something different. Not
exactly sure what your use-case is.

Ben Root

On Fri, Feb 12, 2016 at 9:49 AM, Benjamin Root  wrote:

> Seems like you are talking about xarray: https://github.com/pydata/xarray
>
> Cheers!
> Ben Root
>
> On Fri, Feb 12, 2016 at 9:40 AM, Sérgio  wrote:
>
>> Hello,
>>
>> This is my first e-mail, I will try to make the idea simple.
>>
>> Similar to masked array it would be interesting to use a label array to
>> guide operations.
>>
>> Ex.:
>> >>> x
>> labelled_array(data =
>>  [[0 1 2]
>>  [3 4 5]
>>  [6 7 8]],
>> label =
>>  [[0 1 2]
>>  [0 1 2]
>>  [0 1 2]])
>>
>> >>> sum(x)
>> array([9, 12, 15])
>>
>> The operations would create a new axis for label indexing.
>>
>> You could think of it as a collection of masks, one for each label.
>>
>> I don't know a way to make something like this efficiently without a
>> loop. Just wondering...
>>
>> Sérgio.
>>
>> ___
>> 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


Re: [Numpy-discussion] [Suggestion] Labelled Array

2016-02-12 Thread Benjamin Root
Seems like you are talking about xarray: https://github.com/pydata/xarray

Cheers!
Ben Root

On Fri, Feb 12, 2016 at 9:40 AM, Sérgio  wrote:

> Hello,
>
> This is my first e-mail, I will try to make the idea simple.
>
> Similar to masked array it would be interesting to use a label array to
> guide operations.
>
> Ex.:
> >>> x
> labelled_array(data =
>  [[0 1 2]
>  [3 4 5]
>  [6 7 8]],
> label =
>  [[0 1 2]
>  [0 1 2]
>  [0 1 2]])
>
> >>> sum(x)
> array([9, 12, 15])
>
> The operations would create a new axis for label indexing.
>
> You could think of it as a collection of masks, one for each label.
>
> I don't know a way to make something like this efficiently without a loop.
> Just wondering...
>
> Sérgio.
>
> ___
> 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] [Suggestion] Labelled Array

2016-02-12 Thread Sérgio
Hello,

This is my first e-mail, I will try to make the idea simple.

Similar to masked array it would be interesting to use a label array to
guide operations.

Ex.:
>>> x
labelled_array(data =
 [[0 1 2]
 [3 4 5]
 [6 7 8]],
label =
 [[0 1 2]
 [0 1 2]
 [0 1 2]])

>>> sum(x)
array([9, 12, 15])

The operations would create a new axis for label indexing.

You could think of it as a collection of masks, one for each label.

I don't know a way to make something like this efficiently without a loop.
Just wondering...

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


Re: [Numpy-discussion] Hook in __init__.py to let distributors patch numpy

2016-02-12 Thread Robert Kern
I would add a numpy/_distributor_init.py module and unconditionally import
it in the __init__.py. It's contents in our upstream sources would just be
a docstring:

"""Distributors! Put your initialization code here!
"""

One important technical benefit is that the unconditional import won't hide
ImportErrors in the distributor's code.

On Fri, Feb 12, 2016 at 1:19 AM, Matthew Brett 
wrote:

> Hi,
>
> Over at https://github.com/numpy/numpy/issues/5479 we're discussing
> Windows wheels.
>
> On thing that we would like to be able to ship Windows wheels, is to
> be able to put some custom checks into numpy when you build the
> wheels.
>
> Specifically, for Windows, we're building on top of ATLAS BLAS /
> LAPACK, and we need to check that the system on which the wheel is
> running, has SSE2 instructions, otherwise we know ATLAS will crash
> (almost everybody does have SSE2 these days).
>
> The way I propose we do that, is this patch here:
>
> https://github.com/numpy/numpy/pull/7231
>
> diff --git a/numpy/__init__.py b/numpy/__init__.py
> index 0fcd509..ba3ba16 100644
> --- a/numpy/__init__.py
> +++ b/numpy/__init__.py
> @@ -190,6 +190,12 @@ def pkgload(*packages, **options):
>  test = testing.nosetester._numpy_tester().test
>  bench = testing.nosetester._numpy_tester().bench
>
> +# Allow platform-specific build to intervene in numpy init
> +try:
> +from . import _distributor_init
> +except ImportError:
> +pass
> +
>  from . import core
>  from .core import *
>  from . import compat
>
> So, numpy __init__.py looks for a module `_distributor_init`, in which
> the distributor might have put custom code to do any checks and
> initialization needed for the particular platform.  We don't by
> default ship a `_distributor_init.py` but leave it up to packagers to
> generate this when building binaries.
>
> Does that sound like a sensible approach to y'all?
>
> Cheers,
>
> Matthew
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>



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