summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #6817 from cgohlke/patch-1Charles Harris2015-12-121-0/+6
|\ | | | | BUG: Disable 32-bit msvc9 compiler optimizations for npy_rint
| * BUG: Disable 32-bit msvc9 compiler optimizations for npy_rintChristoph Gohlke2015-12-111-0/+6
| |
* | Merge pull request #6820 from madphysicist/patch-1Jaime2015-12-121-2/+2
|\ \ | | | | | | Updated typos in histogram bin estimator equations
| * | Updated typos in histogram bin estimator equationsMad Physicist2015-12-111-2/+2
| |/ | | | | In all cases, it's either ...*n^(-1/3) or .../n^(1/3), not both. The actual functions are implemented correctly.
* | Merge pull request #6791 from Daetalus/bug_fixingNathaniel J. Smith2015-12-121-1/+14
|\ \ | | | | | | BUG: Fix thinko in assert_deprecated()
| * | BUG: Fix thinko in assert_deprecated()Boxiang Sun2015-12-121-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assert_deprecated() was recently reworked for stylistic changes (in 0aa32608 "STY: Minor style cleanups in tests and C code.") but made a thinko - `lst` is already a list of warnings, so we don't need to put that into [] braces when preparing assertion text. If we do the reporting breaks: In [1]: msg = "4 warnings found but 3 expected." In [2]: lst = ['CategoryA', 'CategoryB', 'CategoryC'] In [3]: n.join([msg] + [lst]) TypeError Traceback (most recent call last) ----> 1 n.join([msg] + [lst]) TypeError: sequence item 1: expected string, list found Fix it. Cc: Charles Harris <charlesr.harris@gmail.com>
* | | TST: Fix test_mvoid_multidim_print failures on Python 2.x for WindowsChristoph Gohlke2015-12-111-4/+4
| |/ |/|
* | TST,BUG: Make test_mvoid_multidim_print work for 32 bit systems.Charles Harris2015-12-111-1/+1
| | | | | | | | | | | | | | The test currently uses an `<i8` type which is converted to a Python long integer when running on a 32 bit system with Python 2. That changes the string printed by appending `L` to the printed integer value and results in a failed test.
* | Merge pull request #6808 from charris/fix-assert-in-testsJaime2015-12-1113-67/+68
|\ \ | |/ |/| MAINT: Replace assert with assert_(...) in some tests.
| * MAINT: Replace assert with assert_(...) in some tests.Charles Harris2015-12-1013-67/+68
| |
* | [TST] fix test_dtype_error to actually test what it's supposed toNathaniel J. Smith2015-12-081-3/+3
|/ | | | | Discovered while cleaning up uses of the silly aliases like 'np.object'.
* Merge pull request #6775 from charris/add-future-importsCharles Harris2015-12-078-1/+15
|\ | | | | MAINT: Include from __future__ boilerplate in some files missing it.
| * MAINT: Include from __future__ boilerplate in some files missing it.Charles Harris2015-12-058-1/+15
| | | | | | | | | | Some newer *.py files are missing the `from __future__` boilerplate that helps assure Python2 and Python3 compatibility.
* | BUG: Quick and dirty fix for interp.Charles Harris2015-12-072-22/+55
| | | | | | | | | | | | | | | | | | | | | | The original had incorrect comparisons involving <=, <, and also failed when the number of data points was 2. This fixes the use of the comparisons and uses linear search for fewer than 5 data points. The whole routine needs a simplified rewrite, but this takes care of the bug. Closes #6468.
* | Merge pull request #6780 from ahaldane/preserve_metadataCharles Harris2015-12-062-0/+12
|\ \ | | | | | | BUG: metadata is not copied to base_dtype
| * | BUG: metadata is not copied to base_dtypeAllan Haldane2015-12-062-0/+12
| |/ | | | | | | | | | | | | | | The (somewhat obsolete) metadata attribute of the data_dtype should be carried over in dtype specifications of the form (base_dtype, data_dtype). Fixes #6771 Incidentally fixes a reference leak in `dtype(('i4,i4', 'i4,i4'))`
* | Merge pull request #6747 from charris/deprecate-fortran-viewCharles Harris2015-12-062-4/+32
|\ \ | |/ |/| DEP: Deprecate changing shape of non-C-contiguous array via descr.
| * DEP: Deprecate changing shape of non-C-contiguous array via descr.Charles Harris2015-11-292-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deprecates assignment of a new descriptor to the dtype attribute of a non-C-contiguous array if it result in changing the shape. This effectively bars viewing a multidimensional Fortran array using a dtype that changes the element size along the first axis. The reason for the deprecation is that, when relaxed strides checking is enabled, arrays that are both C and Fortran contiguous are always treated as C contiguous which breaks some code that depended the two being mutually exclusive for arrays of dimension > 1. The intent of this deprecation is to prepare the way to always enable relaxed stride checking. Example ------- ``` In [1]: import warnings In [2]: warnings.simplefilter('always') In [3]: a = ones((2, 1), order='F').view(complex) /home/charris/.local/bin/ipython:1: DeprecationWarning: Changing the shape of non-C contiguous array by descriptor assignment is deprecated. To maintain the Fortran contiguity of a multidimensional Fortran array, use 'a.T.view(...).T' instead ```
* | Merge pull request #6756 from joernhees/patch-1Charles Harris2015-12-051-3/+15
|\ \ | | | | | | TST: only test f2py, not f2py2.7 etc, fixes #6718
| * | TST: test f2py, fallback on f2py2.7 etc., fixes #6718Jörn Hees2015-12-051-3/+15
| | |
* | | Merge pull request #6763 from ↵Charles Harris2015-12-042-0/+20
|\ \ \ | | | | | | | | | | | | | | | | gerritholl/structured_multidim_masked_array_mvoid_alt BUG/TST: Fix for #6724, make numpy.ma.mvoid consistent with numpy.void
| * | | BUG/TST: Fix for #6724, make numpy.ma.mvoid consistent with numpy.voidGerrit Holl2015-12-032-0/+20
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make indexing on numpy.ma.mvoid consistent with indexing on numpy.void. Changes behaviour in rare cases (see below). Fixes #6724. Sometimes, indexing ma.mvoid results in a non-scalar mask. For example, dimension increases if indexing with a multi-dimensional field. Previously, this led to a ValueError (truth value ambiguous). With this commit, indexing now returns an ma.masked_array so that there is no loss of information. Note that there is a precedence for returning from void to array. Z = zeros((2,), dtype="(2,)i2,(2,)i2"), then Z[0] is a void, but Z[0][0] and Z[0]["f1"] are array. This commit therefore implements behaviouk such that numpy.ma.mvoid is consistent with numpy.void. Also adds a related test. The behaviour changes in cases where for a masked array `X`, X.dtype["A"] is multidimensional but size 1, such as in the example below. Any case where X.dtype["A"] is multidimensional but with size>1 would previously fail. Old behaviour: In [15]: X = ma.masked_array(data=[([0],)], mask=[([False],)], dtype=[("A", "(1,1)i2", (1,1))]) In [16]: X[0]["A"] Out[16]: array([[[[0]]]], dtype=int16) In [17]: X = ma.masked_array(data=[([0],)], mask=[([True],)], dtype=[("A", "(1,1)i2", (1,1))]) In [18]: X[0]["A"] Out[18]: masked New behaviour: In [1]: X = ma.masked_array(data=[([0],)], mask=[([False],)], dtype=[("A", "(1,1)i2", (1,1))]) In [2]: X[0]["A"] Out[2]: masked_array(data = [[[[0]]]], mask = [[[[False]]]], fill_value = [[[[16959]]]]) In [3]: X = ma.masked_array(data=[([0],)], mask=[([True],)], dtype=[("A", "(1,1)i2", (1,1))]) In [4]: X[0]["A"] Out[4]: masked_array(data = [[[[--]]]], mask = [[[[ True]]]], fill_value = [[[[16959]]]]) The new behaviour is more consistent with indexing the data themselves: In [7]: X.data[0]["A"] Out[7]: array([[[[0]]]], dtype=int16) In theory, this change in behaviour can break code, but I would consider it very unlikely.
* | | Merge pull request #6757 from ahaldane/link_cblasCharles Harris2015-12-041-11/+38
|\ \ \ | | | | | | | | BUG: link cblas library if cblas is detected
| * | | BUG: link cblas library if cblas is detectedAllan Haldane2015-12-041-11/+38
| |/ /
* | | Merge pull request #6761 from gerritholl/structured_nested_masked_array_maskfillCharles Harris2015-12-032-1/+8
|\ \ \ | | | | | | | | BUG/TST: Fix #6760 by correctly describing mask on nested subdtypes
| * | | BUG/TST: Fix #6760 by correctly describing mask on nested subdtypesGerrit Holl2015-12-032-1/+8
| |/ / | | | | | | | | | | | | | | | Fix #6760. In ma.core._recursive_make_descr, consider the case where a subdtype does itself have named fields. This ensures the correct mask for an array like `ma.zeros(2, dtype([("A", "(2,2)i1,(2,2)i1", (2,2))]))`.
* | | BUG: resizing empty array with complex dtype failedSebastian Berg2015-12-022-2/+10
|/ / | | | | | | | | | | | | This is because the dtype was passed into the new array as a char, and many dtypes do not have a valid char representation. Closes gh-6740
* | Merge pull request #6734 from saimn/ma-mask-memoryCharles Harris2015-12-012-7/+22
|\ \ | | | | | | ENH: Avoid memory peak when creating a MaskedArray with mask=True/False.
| * | Add some tests for mask creation with mask=True or False.Simon Conseil2015-12-011-0/+9
| | |
| * | Test that the mask dtype if MaskType before using np.zeros/onesSimon Conseil2015-12-011-2/+2
| | |
| * | ENH: Avoid memory peak when creating a MaskedArray with mask=True/False (#6732).Simon Conseil2015-11-261-8/+14
| | | | | | | | | | | | | | | | | | When the `mask` parameter is set to True or False, create directly a `ndarray` of boolean instead of going inside `np.resize` which was causing of memory peak of ~15 times the size of the mask.
* | | Merge pull request #6748 from saimn/ma-repr-memoryCharles Harris2015-12-011-3/+16
|\ \ \ | | | | | | | | ENH: Avoid memory peak and useless computations when printing a MaskedArray.
| * | | Use integer division to avoid casting to int.Simon Conseil2015-12-021-1/+1
| | | |
| * | | Allow to change the maximum width with a class variable.Simon Conseil2015-12-011-4/+6
| | | |
| * | | ENH: Avoid memory peak and useless computations when printing a MaskedArray.Simon Conseil2015-11-281-3/+14
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Ref #3544. When printing a `MaskedArray`, the whole array is converted to the object dtype, whereas only a few values are printed to screen. So the approach here is to cut the array and keep only a subset that it used for the string conversion. This way the output should not change.
* | | BUG/TST: Fix for #6729Gerrit Holl2015-12-012-1/+13
| |/ |/| | | | | | | | | Fix representation of a structured masked array with dimension zero. The effect of representing a masked array with dimension zero is now similar to respresenting an mvoid. This commit fixes #6729.
* | Merge pull request #6726 from ↵Charles Harris2015-11-261-5/+7
|\ \ | |/ |/| | | | | charris/fix-bugs-exposed-by-relaxed-stride-rollback Fix bugs exposed by relaxed stride rollback
| * MAINT: Localize variables only used with relaxed stride checking.Charles Harris2015-11-251-5/+7
| | | | | | | | | | | | The varibles in question lead to unused variable warnings when not compiling with NPY_RELAXED_STRIDE_CHECKING=1 resulting in failing travis tests.
* | Merge pull request #6627 from ordirules/masterCharles Harris2015-11-251-0/+10
|\ \ | | | | | | added extra line in the tile help doc to outline a general repeat, co…
| * | added more textJulien Lhermitte2015-11-051-0/+4
| | |
| * | added extra line in the tile help doc to outline a general repeat, commonly usedJulien Lhermitte2015-11-041-0/+6
| | |
* | | Merge pull request #6717 from charris/fix-gh-6675Julian Taylor2015-11-251-1/+29
|\ \ \ | | | | | | | | BUG: Readd fallback CBLAS detection on linux.
| * | | BUG: Readd fallback CBLAS detection on linux.Charles Harris2015-11-251-1/+29
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | Fallback CBLAS detection was removed in gh-6183 because it led to problems on windows when mingw was used with python compiled with msvc but msvc was not installed. As a result of that fix, CBLAS detection failed for some Linux installations. The solution here is to add back the fallback detection but make it specific to non-windows platforms. Closes #6675.
* | | BUG: Fix for #6719Gerrit Holl2015-11-251-1/+2
|/ / | | | | | | | | | | numpy/random/mtrand/mtrand.pyx contains a line where cython fails to compile, complaining “Pythonic division not allowed without gil”. By running this code segment under cdivision(True), this problem is avoided.
* | MAINT: fix casting warnings in mapping.cAllan Haldane2015-11-231-10/+13
| |
* | BUG: fix pointer arithmetic in _get_field_viewAllan Haldane2015-11-211-1/+1
| | | | | | | | | | | | Should have used PyArray_BYTES, not PyArray_DATA Fixes #6701
* | Merge pull request #6662 from Iceman9/simicgCharles Harris2015-11-202-7/+20
|\ \ | | | | | | Changed lines for successfull MSVC 14.0 compiling
| * | BLD: Enabled building with MSVC 14.0Iceman92015-11-182-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reallocated free functions in mem_overlap.c Cosmetics. Final indent. Added tests if pointer==NULL Fixed indent Fixed position of goto label. Fixed ISO C90 violation. Made simpler checks and removed redundant lines.
* | | Merge pull request #6698 from matthew-brett/test-rint-bugNathaniel J. Smith2015-11-181-0/+10
|\ \ \ | | | | | | | | TST: test np.rint bug for large integers
| * | | TST: test np.rint bug for large integersMatthew Brett2015-11-171-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Test for https://github.com/numpy/numpy/issues/6685 Add test to remind packagers that they may need to fix or workaround this bug on some systems.