summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
...
| | | * | | | BUG: Fix errors in string formatting while producing an errorEric Wieser2019-03-021-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `"Invalid version %r" % (1, 2)` would fail with `TypeError: not all arguments converted during string formatting` The `Header is not a dictionary` error had a similar problem. Fixed by changing this entire function to use `.format` in place of `%`, which does not have this gotcha. Found using LGTM.com
| | | * | | | DOC: revert #13058 and fix Makefilemattip2019-03-011-3/+3
| | | | | | |
| | | * | | | DOC: Update interp docstringeuronion2019-02-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding 'strictly' to make the conditions to be met by the `xp` argument even more clear. Following the suggestion in https://github.com/numpy/numpy/issues/10448#issuecomment-468302058 .
| | | * | | | Merge pull request #10855 from madphysicist/unpack-countSebastian Berg2019-02-251-0/+63
| | | |\ \ \ \ | | | | | | | | | | | | | | | | ENH: Adding a count parameter to np.unpackbits
| | | | * | | | ENH: Added count parameter to unpackbitsJoseph Fox-Rabinovitz2019-02-251-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tests are included. Couple of minor fixes: - Fixed packbits/unpackbits docs to reflect proper keyword names - Added .pytest_cache to .gitignore
| | | * | | | | Merge pull request #12989 from eric-wieser/inter-inf-alternativeSebastian Berg2019-02-251-1/+70
| | | |\ \ \ \ \ | | | | |/ / / / | | | |/| | | | ENH: Correct handling of infinities in np.interp (option B)
| | | | * | | | ENH: Improve handling of infinities in np.interpEric Wieser2019-02-241-1/+70
| | | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alternative to gh-12978, using a method that does not need a lot of special cases. This is likely more robust in the face of overflow Fixes gh-12951.
| | | * | | | MAINT: Move pickle import to numpy.compatCharles Harris2019-02-212-4/+2
| | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pickle module was being imported from numpy.core.numeric. It was defined there in order to use pickle5 when available in Python3 and cpickle in Python2. The numpy.compat module seems a better place for that.
| | | * | | Merge pull request #12965 from Carreau/ogrid-docMatti Picus2019-02-171-2/+3
| | | |\ \ \ | | | | | | | | | | | | | | DOC: Properly format Return section of ogrid Docstring,
| | | | * | | avoid using math.Matthias Bussonnier2019-02-131-1/+1
| | | | | | |
| | | | * | | Properly format Return section of ogrid Docstring,Matthias Bussonnier2019-02-131-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without the newline and indent, the markup is not interpreted. Note that in the see-also `np.lib.index_tricks.nd_grid` is reference but not linked as it appear to not be autogenerated, but this is another issue.
| | | * | | | TST: Improve and refactor tests for numpy.padLars Grueter2019-02-141-223/+224
| | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * TST: Move test for negative stat_length and extend coverage to all modes and more variations of a negative stat_length. * TST: Merge tests for pad_width in single class * TST: Test behavior of pad's kwargs for all modes * TST: Move test to TestReflect Can be grouped with already existing test class checking the behavior for the reflect mode. * TST: Simplify regression test for object input * TST: Move testing pad_width as ndarray Can be grouped in class TestPadWidth as this test checks if an ndarray is accepted as the value to pad_width * TST: Remove faulty tests for pad_width's type These test were ineffective. The TypeError raised in these test was not actually due to pad_width receiving the wrong type but due to the missing parameter mode. Added missing type complex to the appropriate existing test checking for pad_widths type behavior. * TST: Move test for pad_width of zero * TST: Move test for simple stat_length * TST: Simplify classes with only one test * TST: Add naive test for non-contiguous arrays * MAINT: Don't import pad directly Using np.pad instead of directly importing the function seems to be more inline with other test modules. * STY: Make class layout consistent in module * TST: Fix match-string for missing pad mode error The CLI fails due to error message containing a reference to _pad_dispatcher() being returned instead of pad(). For some reason this test passes when run locally.
| | | * | | DOC: Add warning about arbitrary code execution to numpy.loadAndras Deak2019-02-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Load uses pickle under the hood for object arrays, this is made more visible in the documentation using a warning. See also gh-12759
| | | * | | Merge pull request #12818 from mattip/doc-warningsMatti Picus2019-01-231-1/+3
| | | |\ \ \ | | | | | | | | | | | | | | DOC: remove python2-only methods, small cleanups
| | | | * | | DOC: fixes from reviewmattip2019-01-221-0/+1
| | | | | | |
| | | | * | | DOC: remove python2-only methods, small cleanupsmattip2019-01-211-1/+2
| | | | | | |
| | | * | | | ENH: __array_function__ updates for NumPy 1.17.0Stephan Hoyer2019-01-222-9/+2
| | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Always enable __array_function__ overrides. - Remove special cases for Python 2 compatibility. - Document these changes in 1.17.0-notes.rst. It will be good to see ASV numbers to understand the performance implications of these changes. If need be, we can speed up NumPy functions internally by using non-dispatched functions (with ``.__wrapped__``).
| | | * | | ENH: add _nan_mask functionTyler Reddy2019-01-182-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add _nan_mask function and associated unit tests; this function is to be used to simplify reduction operations involving np.nan elements by using a mask with a ``where`` argument
| | | * | | Merge pull request #12762 from EelcoPeacs/local_datasource_firstCharles Harris2019-01-171-4/+5
| | | |\ \ \ | | | | | | | | | | | | | | MAINT: Change the order of checking for locale file and import urllib modules
| | | | * | | ENH: Changed the sequence of checking for locale existence of a file and ↵EelcoPeacs2019-01-161-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | importing urllib modules in numpy._datasource.py to prevent the import in case the local file was found See #12536
| | | * | | | DOC: Update docstring of diff() to use 'i' not 'n'Andy Scholand2019-01-151-1/+1
| | | |/ / / | | | | | | | | | | | | See issue https://github.com/numpy/numpy/issues/12742
| | | * | | BUG: loosen kwargs requirements in ediff1dmattip2019-01-102-18/+16
| | | | | |
| | | * | | BUG: reference cycle in np.vectorize (#11977)Matti Picus2019-01-091-2/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements cyclic support by adding `tp_traverse` to ufuns which may contain a user provided object function (`np.frompyfunc`). Ufuncs that do not add this are not added to the circular reference count tracking. The ufunc does not need to implement `tp_clear` because it is an immutable object.
| | | * | | ENH: remove "Invalid value" warnings from median, percentilemattip2019-01-063-76/+26
| | | | | |
| | | * | | TST: Fix endianness in unstuctured_to_structured testAllan Haldane2019-01-051-3/+3
| | | | | |
| | | * | | Merge pull request #12239 from daten-kieker/polyval_2477Marten van Kerkwijk2019-01-041-1/+3
| | | |\ \ \ | | | | | | | | | | | | | | BUG: polyval returned non-masked arrays for masked input.
| | | | * | | BUG: polyval returned Non-Masked Arrays for Masked Input.Joachim Hereth2018-10-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix will preserve subtypes of ndarray when given as input (x) to the polyval function. In particular, the results for masked values of a masked array will be masked. Fixes #2477.
| | | * | | | DOC, TST: clean up matplotlib importsTyler Reddy2019-01-022-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * as requested by review in gh-12634, the vast majority of docstring matplotlib imports can be simplified to a single line
| | | * | | | DOC, TST: remove agg setting from docsTyler Reddy2019-01-022-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * there is no longer any usage of "agg" backend switching in our docstrings because this backend is already activated in the refguide_check machinery
| | | * | | | Refactored numpy.delete function docsAbdur Rehman2018-12-211-1/+1
| | | | | | |
| | | * | | | Clarify skiprows in loadtxtIlja2018-12-181-1/+1
| | | | | | |
| | | * | | | MAINT: include recfunctions moduleTyler Reddy2018-12-142-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * added lib.recfunctions to refguide PUBLIC_SUBMODULES, as the doctests were otherwise not getting executed * fixed a failing doctest in recfunctions after above activation
| | | * | | | MAINT: addressing review commentsTyler Reddy2018-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * restored regression comment in numpy/core/defchararray.py * fixed the dimensionality of the z array in all() docstring in numpy/core/fromnumeric.py; this isn't detected because it is in-line with variable memory addresses which are tagged as variable for refguide * byte_bounds() docstring adjusted to reflect non-variable dtype after reviewer requested removal of complex dtype * restore an original comment in matmul docstring, as requested by reviewer
| | | * | | | MAINT: revert numpy/lib/mixins to master branch status -- refguide passes in ↵Tyler Reddy2018-12-141-49/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | any case now.
| | | * | | | MAINT: address several reviewer commentsTyler Reddy2018-12-147-14/+22
| | | | | | |
| | | * | | | TST, DOC: enable refguide_checkTyler Reddy2018-12-1421-572/+600
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ported the refguide_check module from SciPy for usage in NumPy docstring execution/ verification; added the refguide_check run to Azure Mac OS CI * adjusted NumPy docstrings such that refguide_check passes
| | * | | | | BUG: Return the coefficients array directlyEric Wieser2017-07-082-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out that this was relied upon downstream We also add a setter for coeffs, so that augmented assignment does not both change state and raise an exception suggesting state could not be changed.
| * | | | | | 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
* | | | | | | MAINT: Fix remaining misuses of bool(dt.names)Eric Wieser2019-08-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not clear that these have any visible effect, but we should be consistent with how we detect structured types.
* | | | | | | BUG: Don't construct masked arrays with the wrong mask type in genfromtxtEric Wieser2019-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This only affects arrays with `dtype([])`, but also follows the recommended way to check for structured arrays in our docs
* | | | | | | BUG: Don't allow extra fields to be added in genfromtxtEric Wieser2019-08-192-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously passing `dtype=[], names=['a']` would append an extra field, even though `dtype=['a'], names=['b', 'c']` does not.
* | | | | | | MAINT: Remove incorrect comment about flatteningEric Wieser2019-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also adjust the code to more clearly indicate what actually happens. The behavior is identical before and after this patch.
* | | | | | | BUG: recfunctions: Don't return None in place of empty sequencesEric Wieser2019-08-192-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replacing empty tuples with `None` is a bad idea, and just results in an API that is hard to consume - especially since the behavior was never documented. This affects `get_names`, `get_names_flat`, and `get_fieldstructure`.
* | | | | | | BUG: Fix crash on genfromtxt with nested empty structured arrayEric Wieser2019-08-192-1/+8
| |_|/ / / / |/| | | | | | | | | | | | | | | | | Previously this would fail with `ValueError: could not assign tuple of length 2 to structure with 3 fields.`, now it raises `NotImplementedError`.
* | | | | | Merge pull request #12388 from mhvk/linspace-allow-arrayCharles Harris2018-12-061-4/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | ENH: allow arrays for start and stop in {lin,log,geom}space
| * | | | | | TST,BUG: fix two tests that were setup incorrectly.Marten van Kerkwijk2018-12-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | And which failed with the change to linspace.
* | | | | | | MAINT: Review F401,F841,F842 flake8 errors (unused variables and imports) ↵Roman Yurchak2018-12-067-13/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#12448) * Review F401,F841,F842 flake8 errors (unused variables, imports) * Review comments * More tests in test_installed_npymath_ini * Review comments
* | | | | | | ENH: implement matmul on NDArrayOperatorsMixin (#12488)Stephan Hoyer2018-12-052-3/+13
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ENH: implement matmul on NDArrayOperatorsMixin * MAINT: remove unnecessary pytest import
* | | | | | Merge pull request #12447 from ahaldane/unrevert_multifield_viewCharles Harris2018-12-011-0/+10
|\ \ \ \ \ \ | | | | | | | | | | | | | | ENH: add back the multifield copy->view change
| * | | | | | ENH: add back the multifield copy->view changeAllan Haldane2018-11-261-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #10409 Closes #11530