summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
* DOC: rm matrix from triu docstring.Ross Barnowski2020-06-251-1/+1
| | | | | Replace "matrix" with "array" to avoid confusion re: np.matrix. Consistent with other np.tri\* functions.
* Fix broken link in open_memmap See AlsoRoss Barnowski2020-06-241-1/+1
|
* MAINT: lib: A few PEP-8 fixes.Warren Weckesser2020-06-181-3/+6
|
* MAINT: lib: In loadtxt, move some code out of a try/finally block.Warren Weckesser2020-06-181-5/+8
| | | | | | In loadtxt, there is a try/finally block that ensures that the file is closed if it was opened in the function. Some code that did not need to be in that block was moved up, outside the try/finally block.
* MAINT: lib: In loadtxt, validate ndmin argument earlier.Warren Weckesser2020-06-181-3/+4
| | | | | | Validation of `ndmin` is moved to the beginning of the function, so we don't read the entire file only to raise an exception at the end because of a bad argument.
* MAINT: lib: Move some nested function definitions in loadtxt.Warren Weckesser2020-06-181-61/+70
| | | | | This change moves the nested function definitions in loadtxt to the top of the function body.
* MAINT: Remove uses of scalar aliasesEric Wieser2020-06-101-1/+1
| | | | This is a follow up to d1d9dd58e2de5f3b69c02b104e1daaeec1f38d9f, as more regressions in this style have been introduced since that commit.
* Merge pull request #16500 from bjnath/move_c_style_linkRalf Gommers2020-06-061-2/+2
|\ | | | | DOC: Point Contributing page to new NEP 45
| * DOC: Use intersphinx for NEP referencesBen Nathanson2020-06-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Per #16500 discussion, adds link updates to PR. Replaces NEP URLs with intersphinx links in these files: * doc/HOWTO_RELEASE.rst.txt * doc/source/dev/howto-docs.rst * numpy/doc/dispatch.py * numpy/lib/format.py and incorporates @rossbar's #16502 change of `config.py`.
* | DOC: Fixes for 18 broken links (#16472)bjnath2020-06-062-4/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * DOC: Fixes for 18 broken links This, with PR #16465, should fix nearly all the remaining broken links on the site. 4 or 5 others should be easy to fix and just need attention from someone more knowledgeable -- will open an issue. For release notes with dead links, I could usually find links on archive.org for roughly contemporary versions. * DOC: Update to "Fixes for 18 broken links #16472" * Obsolete links, previously commented out, now deleted: https://github.com/numpy/numpy/pull/16472#discussion_r433928958 * Semantic markup for reference to Python class: https://github.com/numpy/numpy/pull/16472#discussion_r433553928 * Missing :ref: in internal link: https://github.com/numpy/numpy/pull/16472#discussion_r433554484 Not included: Resolution on using external/internal doc link in .py: https://github.com/numpy/numpy/pull/16472#discussion_r433554824 * DOC: Add internal link for 'Fixes for 18 broken links' PR #16472 Making reference [1] an internal link in function_base.py => numpy.vectorize.html * DOC: Redirect 2 link fixes in PR #16472 * governance.rst link reverted * ununcs.rst `overridden` link goes where it was meant to per https://github.com/numpy/numpy/pull/16472#pullrequestreview-424666070
* MAINT: use zip instead of range in piecewiseEric Wieser2020-06-011-8/+6
| | | | Minor cleanup while looking at something else.
* DOC: make clearer that sinc is normalized by a factor piRalf Gommers2020-05-301-4/+11
| | | | Addresses gh-13457
* TST: Simplify assert_warns in test_io.pySeth Troisi2020-05-281-17/+8
|
* Merge pull request #16348 from seberg/fromany-leakCharles Harris2020-05-231-0/+9
|\ | | | | BUG: Fix dtype leak in `PyArray_FromAny` error path
| * BUG: Fix dtype leak in `PyArray_FromAny` error pathSebastian Berg2020-05-221-0/+9
| | | | | | | | | | | | | | | | Also adds a test to bincount which will run into this path. The leak can be triggered by using a reference count checker on the test suit (e.g. pytest-leaks). Closes gh-16339
* | Merge pull request #16349 from larsoner/depCharles Harris2020-05-232-5/+17
|\ \ | | | | | | BUG: Indentation for docstrings
| * | BUG: Indentation for docstringsEric Larson2020-05-222-5/+17
| |/
* | Merge pull request #16298 from eric-wieser/fix-np.infoSebastian Berg2020-05-221-35/+7
|\ \ | |/ |/| BUG: np.info does not show keyword-only arguments
| * BUG: np.info does not show keyword-only argumentsEric Wieser2020-05-191-35/+7
| | | | | | | | | | | | Using inspect.signature instead of `np.compat.getargspec` solves this problem. `inspect.signature` also handles stripping the `self` argument of methods for us.
* | Merge pull request #16332 from ↵Matti Picus2020-05-221-0/+4
|\ \ | | | | | | | | | | | | LSchroefl/link_SciPy_multidimensional_interpolation DOC: link np.interp to SciPy's interpolation functions (closes #14154)
| * | Update numpy/lib/function_base.pyLSchroefl2020-05-221-1/+1
| | | | | | | | | Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
| * | DOC: link np.interp to SciPy's multidimensional interpolation functions (#14154)skywalker2020-05-211-0/+4
| |/
* | Merge pull request #16239 from seberg/reimport-do-not-set-docsMatti Picus2020-05-201-1/+39
|\ \ | | | | | | BUG,DOC: Allow attach docs twice but error if wrong
| * | TST: Add a test for np.add_docstringSebastian Berg2020-05-201-1/+39
| | | | | | | | | | | | | | | Its not quite the right file, but close to newdoc seemed sensible and we do not have a "right" file right now...
* | | Merge pull request #16284 from eric-wieser/extract-lerpSebastian Berg2020-05-191-62/+58
|\ \ \ | |/ / |/| | MAINT: Clean up the implementation of quantile
| * | MAINT: remove workaround for fixed issue Eric Wieser2020-05-191-2/+0
| | | | | | | | | take now correctly returns `out`, even on 0d arrays
| * | MAINT: Remove special cases for 0d arrays in quantileEric Wieser2020-05-181-62/+55
| | | | | | | | | | | | This also simplifies the axis handling logic, taking advantage of the fact we know `axis` is 0 for the rest of the function body
| * | MAINT: Extract a lerp helper function to make the algorithm of quantile clearerEric Wieser2020-05-181-4/+9
| |/ | | | | | | This does not affect the behavior in any way
* | Merge pull request #16156 from WarrenWeckesser/deprecate-dualSebastian Berg2020-05-191-1/+0
|\ \ | | | | | | DEP: Deprecate `numpy.dual`.
| * | DEP: Deprecate `numpy.dual`.Warren Weckesser2020-05-041-1/+0
| | | | | | | | | | | | | | | | | | Add a deprecation warning in the `numpy.dual` module, and remove the use of `numpy.dual` from the few places where it is used in the numpy code.
* | | Merge pull request #16242 from seberg/genfromtxt-default-regressionMatti Picus2020-05-193-5/+15
|\ \ \ | |_|/ |/| | BUG: Fix default fallback in genfromtxt
| * | Update numpy/lib/_iotools.pySebastian Berg2020-05-181-1/+2
| | | | | | | | | Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
| * | BUG: Fix default fallback in genfromtxtSebastian Berg2020-05-183-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | This affected (for example?) if the `dtype=object` was used without a converter, meaning that the default one is used. And this is currently the last one, which is `string_` (and thus bytes). Closes gh-16189
* | | MAINT: Avoid moving axes around multiple timesEric Wieser2020-05-171-15/+5
| | | | | | | | | | | | It's easier to move the relevant axis to position 0 in `ap` first than it is to move it for every relevant object simultaneously.
* | | MAINT: Remove a pointless ifEric Wieser2020-05-171-4/+1
| | | | | | | | | | | | The `add` ufunc is happy to handle `out=None` by itself
* | | DOC: Fix typos and cosmetic issuesMartin Michlmayr2020-05-171-1/+1
| | |
* | | Merge pull request #16197 from timhoffm/doc-stackSebastian Berg2020-05-151-3/+5
|\ \ \ | |/ / |/| | DOC: Unify cross-references between array joining methods
| * | DOC: Unify cross-references between array joining methodsTim Hoffmann2020-05-101-3/+5
| | |
* | | Merge pull request #16188 from eric-wieser/cleanup-StringConverterSebastian Berg2020-05-111-71/+58
|\ \ \ | |/ / |/| | MAINT: cleanups to _iotools.StringConverter
| * | MAINT: Extract a helper function from StringConverterEric Wieser2020-05-081-26/+30
| | | | | | | | | | | | The previous logic here was very hard to follow, as loop variables were being used after the loop ended, and being conditionally overwritten.
| * | STY: remove some parens in iterationEric Wieser2020-05-081-3/+3
| | |
| * | MAINT: remove unused private membersEric Wieser2020-05-081-2/+0
| | |
| * | STY: Remove some weird comments from iotoolsEric Wieser2020-05-081-42/+27
| |/ | | | | | | Also fix the docstring indentation
* | ENH: Better error message when ``bins`` has float value in ``histogramdd``. ↵MatteoRaso2020-05-071-1/+9
| | | | | | | | | | | | | | | | (#16129) * Improved one of the error messages for histogramdd.py as outlined in issue #15984 Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* | Mark tests as a subpackage rather than data.Hameer Abbasi2020-05-061-1/+2
| |
* | Merge pull request #16125 from WarrenWeckesser/vectorize-bugMatti Picus2020-05-062-8/+83
|\ \ | | | | | | BUG: lib: Fix a problem with vectorize with default parameters.
| * | MAINT: lib: A few changes in some vectorize tests.Warren Weckesser2020-05-021-41/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | Added a note to some of the tests that the order of the calls is an important part of the test, because the code is testing the caching of the ufuncs. Also reuse a couple functions in the vectorize tests by defining them at the module level.
| * | BUG: lib: Fix a problem with vectorize with default parameters.Warren Weckesser2020-04-302-7/+92
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `otypes` is given to `vectorize` and then the instance is called, it creates a ufunc by calling numpy.core.umath.frompyfunc. The number of arguments given to this ufunc is set to the number of arguments in the call of the vectorize instance. This ufunc is cached, so frompyfunc does not have to be called on the next call. The problem is that, if the function being wrapped has parameters with default values, the number of arguments passed to the vectorize instance can change, and when that happens, a new ufunc must be created by calling frompyfunc with the correct number of arguments. This commit changes the cache of the ufunc from a simple attribute that holds the most recent ufunc to a dictionary whose keys are the number of arguments in the call. The cache is only used when the vectorized function is called with only positional arguments and there are no excluded arguments. If keywords are used, the number of arguments is no longer sufficient to uniquely identify a previously created ufunc. Closes gh-16120.
* | DOC: Update np.copy docstring to include ragged case (#15928)Guilherme Leobas2020-05-051-0/+24
|/ | | | | | | | | We only do a shallow copy of arrays (mainly important for object arrays), so mention that in the documentation. Fixes #15923 Co-Authored-By: Eric Wieser <wieser.eric@gmail.com> Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>
* Merge pull request #16064 from keremh/fix-exception-raiseCharles Harris2020-04-254-10/+14
|\ | | | | ENH: Fix exception causes in four .py files