summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #13334 from eric-wieser/fix-1-field-unstructuredMatti Picus2019-04-253-1/+11
|\ | | | | BUG: Fix structured_to_unstructured on single-field types
| * DOC: Add 1.17 release noteEric Wieser2019-04-231-0/+8
| |
| * Merge remote-tracking branch 'upstream/master' into fix-1-field-unstructuredEric Wieser2019-04-23370-13120/+22738
| |\
| * | BUG: Fix structured_to_unstructured on single-field typesEric Wieser2019-04-152-1/+3
| | | | | | | | | | | | | | | | | | Previously a single-field type would decay, which is undesirable. The included test previously did not pass
* | | ENH: Add shape to *_like() array creation (#13046)Peter Andreas Entschev2019-04-257-30/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ENH: Added shape argument to *_like() array creation functions * ENH: C backend adjustments for shape argument on *_like() * TST: Added test for shape argument in *_like() functions * ENH: Added PyArray_NewLikeArrayWithShape() This change maintains backwards compatibility, rather than passing new arguments to PyArray_NewLikeArray(). * BUG: Fix for PyArray_NewLikeArrayWithShape strides and ndim == 0 Arrays created with new shapes should not take into consideration the original array's stride, and ndim == 0 should not be a case to ignore a new shape, as the caller may request a 0d array. * REL: Updates for C-API, version 1.17.x * Add comments to cversions.txt (new PyArray_NewLikeArrayWithShape function) * Increment C_API_VERSION to 1.17 in setup_common.py * Revert "REL: Updates for C-API, version 1.17.x" This reverts commit 807f512ebeb7797ad374d845e41015948afcc708. * Revert exposing PyArray_NewLikeArrayWithShape on C-API * DOC: fix versionadded for *_like() shape argument * STY: add missing spaces in array initializers * ENH: empty_like raises ValueError This occurs when shape is defined and number of dimensions match but order is 'K'. * TST: test for exception of *_like() functions * DOC: release note for shape argument in *_like() functions * DOC: fix *_like() documentation on raises * BUG: *_like() raises for non-C/F-layout arrays * TST: change *_like() shapes to prevent NPY_RELAXED_STRIDE_DEBUG=1 failure * Move empty_like() exception to C implementation * Update *_like() ValueError documentation * Rearrange stride computation for *_like() if new shape and order='K' * Change handling of order= for *_like() - If order='K' try to keep, otherwise, order='C' is implied - Do not raise ValueError anymore * Fix *_like() tests
* | | Merge pull request #13403 from mattip/typosRalf Gommers2019-04-251-5/+3
|\ \ \ | | | | | | | | DOC: fix typos in dev/index
| * | | DOC: fix typos in dev/indexmattip2019-04-251-5/+3
|/ / /
* | | Merge pull request #13367 from mattip/dev-guideRalf Gommers2019-04-238-65/+247
|\ \ \ | | | | | | | | DOC: reorganize developer docs, use scikit-image as a base for change
| * | | DOC: changes from reviewmattip2019-04-233-140/+33
| | | |
| * | | DOC: reorganize developer docs, use scikit-image as a base for changemattip2019-04-218-58/+347
| | | |
* | | | Merge pull request #13391 from nsoranzo/fix_assertEqualsCharles Harris2019-04-236-30/+30
|\ \ \ \ | |_|_|/ |/| | | MAINT, DEP: Fix deprecated ``assertEquals()``
| * | | Fix deprecated ``assertEquals()``Nicola Soranzo2019-04-236-30/+30
|/ / / | | | | | | | | | See https://docs.python.org/2/library/unittest.html#deprecated-aliases
* | | Merge pull request #13388 from charris/fix-for-broken-pypyMatti Picus2019-04-231-2/+4
|\ \ \ | | | | | | | | BUG: Some PyPy versions lack PyStructSequence_InitType2.
| * | | BUG: Some PyPy versions lack PyStructSequence_InitType2.Charles Harris2019-04-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Define `PyStructSequence_InitType2` for those PyPy versions that don't support it. Closes gh-13384.
* | | | Merge pull request #13371 from eric-wieser/__floor__-and-__ceil__Charles Harris2019-04-224-3/+79
|\ \ \ \ | |/ / / |/| | | BUG/ENH: Make floor, ceil, and trunc call the matching special methods
| * | | BUG/ENH: Make floor, ceil, and trunc call the matching special methodsEric Wieser2019-04-194-3/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously `np.ceil` would call `o.ceil()` on each element of an object array. This is inconsistent with the builtin python way of handling this, calling `o.__ceil__()`. This changes these three functions to use the corresponding functions in the `math` module, which do the special method lookup. As a result, they now work on arrays of `Fraction` and `Decimal` objects.
* | | | Merge pull request #12594 from mattip/pypy3-testingTyler Reddy2019-04-228-13/+116
|\ \ \ \ | | | | | | | | | | DEV, BUILD: add pypy3 to azure CI
| * | | | MAINT: use openblas, gfortran, tweak azure and comment mro (from review)mattip2019-04-214-6/+52
| | | | |
| * | | | MAINT: move gc.collect to function (from review)mattip2019-04-193-9/+31
| | | | |
| * | | | TEST: update for PyPymattip2019-04-179-26/+37
| | | | |
| * | | | DEV: add pypy3 to azure CImattip2019-04-164-0/+24
| | | | |
* | | | | Merge pull request #13383 from charris/post-1.16.3-updateCharles Harris2019-04-224-0/+103
|\ \ \ \ \ | | | | | | | | | | | | MAINT, DOC: Post 1.16.3 release updates
| * | | | | MAINT, DOC: Post 1.16.3 release updates.Charles Harris2019-04-214-0/+103
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | - Add 1.16.3 release notes - Add 1.16.3 changelog - Update mailmap
* | | | | Merge pull request #13379 from rgommers/mingw-fixCharles Harris2019-04-211-1/+3
|\ \ \ \ \ | | | | | | | | | | | | BLD: address mingw-w64 issue. Follow-up to gh-9977
| * | | | | BLD: address mingw-w64 issue. Follow-up to gh-9977Ralf Gommers2019-04-211-1/+3
|/ / / / /
* | | | | Merge pull request #13374 from kritisingh1/angleMatti Picus2019-04-201-2/+2
|\ \ \ \ \ | | | | | | | | | | | | DOC: Specify range for numpy.angle
| * | | | | DOC: Specify range for numpy.anglekritisingh12019-04-211-2/+2
| | | | | |
* | | | | | Merge pull request #13134 from r-devulap/logexp-simdMatti Picus2019-04-2012-1/+591
|\ \ \ \ \ \ | |/ / / / / |/| | | | | ENH: Use AVX for float32 implementation of np.exp & np.log
| * | | | | DOC: adding release notes for 1.17.0Raghuveer Devulapalli2019-04-191-0/+6
| | | | | |
| * | | | | BUG: Fixing incomplete guards for @ISA@_exp/log_FLOAT functionsRaghuveer Devulapalli2019-04-192-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Added a missing NPY_HAVE_SSE2_INTRINSICS guard
| * | | | | BUG: Adding macro HAVE_ATTRIBUTE_TARGET_@ISA@_WITH_INTRINSICSRaghuveer Devulapalli2019-04-198-8/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) use __builtin_cpu_supports("avx512f") only for gcc ver >= 5 2) Introduced two new macro's: HAVE_ATTRIBUTE_TARGET_@ISA@_WITH_INTRINSICS for ensuring compiler can compile functions that use intrinsics and are compiled with avx2/avx512f attributes
| * | | | | BUG: Fixing AVX512F build issues on clang6.0Raghuveer Devulapalli2019-04-192-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang6.0 fails to compile this code: __asm__ __volatile__ ( "vpaddd %zmm1, %zmm2, %zmm3\n\t" ); Note that this is a known issue in clang6.0. clang7.0 and gcc does not have this problem. This fails to set the flag HAVE_LINK_AVX512F. Hence, the AVX512F version of exp and log doesn't get built. If AVX512F is detected during runtime, instead of choosing to run the AVX2 version, it will end up running scalar version.
| * | | | | BUG: Fixing compile time error for clangRaghuveer Devulapalli2019-04-191-30/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Got rid of @isa@_cmp_mask helper function, since clang expects the compare operator in _mm@vsize@_cmp_ps to be a compile time constant 2) Converted all helper functions to static functions
| * | | | | ENH: vectorizing float32 implementation of np.exp & np.logRaghuveer Devulapalli2019-04-198-1/+524
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements vectorized single precision exponential and natural log using AVX2 and AVX512. Accuracy: | Function | Max ULP Error | Max Relative Error | |----------|---------------|--------------------| | np.exp | 2.52 | 2.1E-07 | | np.log | 3.83 | 2.4E-07 | Performance: (1) Micro-benchmarks: measured execution time of np.exp and np.log using timeit package in python. Each function is executed 1000 times and this is repeated 100 times. The standard deviation for all the runs was less than 2% of their mean value and hence not included in the data. The vectorized implementation was upto 7.6x faster than the scalar version. | Function | NumPy1.16 | AVX2 | AVX512 | AVX2 speedup | AVX512 speedup | | -------- | --------- | ------ | ------ | ------------ | -------------- | | np.exp | 0.395s | 0.112s | 0.055s | 3.56x | 7.25x | | np.log | 0.456s | 0.147s | 0.059s | 3.10x | 7.64x | (2) Logistic regression: exp and log are heavily used in training neural networks (as part of sigmoid activation function and loss function respectively). This patch significantly speeds up training a logistic regression model. As an example, we measured how much time it takes to train a model with 15 features using 1000 training data points. We observed a 2x speed up to train the model to achieve a loss function error < 10E-04. | Function | NumPy1.16 | AVX2 | AVX512 | AVX2 speedup | AVX512 speedup | | -------------- | ---------- | ------ | ------ | ------------ | -------------- | | logistic.train | 121.0s | 75.02s | 60.60s | 1.61x | 2.02x |
* | | | | Merge pull request #8662 from eric-wieser/ufunc-outer-subclassMatti Picus2019-04-192-2/+31
|\ \ \ \ \ | |_|_|/ / |/| | | | ENH: preserve subclasses in ufunc.outer
| * | | | MAINT: avoid np.matrix in PR 8662Tyler Reddy2019-04-172-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * use an instance check to avoid complications with the matrix subclass * add unit test for allowing subclass passthrough in ufunc.outer
| * | | | ENH: preserve subclasses in ufunc.outerEric Wieser2019-04-161-2/+2
| |/ / /
* | | | Merge pull request #10741 from eric-wieser/as_integer_ratioTyler Reddy2019-04-184-0/+239
|\ \ \ \ | | | | | | | | | | ENH: Implement `np.floating.as_integer_ratio`
| * | | | TST: use smaller tests for PR 10741.Tyler Reddy2019-04-181-46/+76
| | | | |
| * | | | ENH: Implement `np.floating.as_integer_ratio`Eric Wieser2019-04-104-0/+209
| | | | | | | | | | | | | | | | | | | | This matches the builtin `float.as_integer_ratio` and (in recent python versions) `int.as_integer_ratio`.
* | | | | Merge pull request #13218 from debsankha/isfinite-datetimeCharles Harris2019-04-187-2/+67
|\ \ \ \ \ | | | | | | | | | | | | ENH: `isfinite` support for `datetime64` and `timedelta64`
| * \ \ \ \ Merge branch 'master' into isfinite-datetimeMatti Picus2019-04-1032-187/+327
| |\ \ \ \ \
| * | | | | | DOC: added release note for `isfinite` support forDebsankha Manik2019-04-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | `datetime64` and `timedelta64`
| * | | | | | MAINT: Changed ufunc type description for `isfinite`Debsankha Manik2019-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | as per code review to `noobj`
| * | | | | | TST: testing isfinite on datetime and timedelta objects.Debsankha Manik2019-03-301-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added test: test_datetime.TestDateTime.test_isfinite. It just checks the reverse of test_isnat.
| * | | | | | MAINT: added missing return in PyUFunc_IsFiniteTypeResolverDebsankha Manik2019-03-301-1/+1
| | | | | | |
| * | | | | | ENH: allow datettimes in isfiniteSebastian Berg2019-03-305-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I am not quite sure whether this should be done somewhat more elegant especially with the typeresolver.
* | | | | | | Merge pull request #11684 from mattip/unravel_index-emptyMatti Picus2019-04-182-33/+88
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | BUG: Raise when unravel_index, ravel_multi_index are given empty input
| * | | | | | | BUG: fix from reviewmattip2019-03-301-1/+1
| | | | | | | |
| * | | | | | | BUG: fixes from reviewmattip2019-03-291-45/+40
| | | | | | | |