summaryrefslogtreecommitdiff
path: root/numpy/lib
Commit message (Collapse)AuthorAgeFilesLines
...
| * | use same tri formatIllviljan2021-01-151-1/+1
| | |
| * | faster tril_indicesIllviljan2021-01-111-2/+8
| |/ | | | | nonzero is slow. Use np.indices and np.broadcast_to to speed it up.
* | fix from reviewmattip2021-01-241-2/+5
| |
* | TST: raise memory limit for testmattip2021-01-221-1/+1
|/
* Merge pull request #18091 from anntzer/docsetCharles Harris2020-12-292-2/+2
|\ | | | | DOC: Avoid using "set of" when talking about an ordered list.
| * DOC: Avoid using "set of" when talking about an ordered list.Antony Lee2020-12-292-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | ... or when the input isn't/cannot be a set. I left a few usages, e.g. in random sampling, where "set" is reasonable as informal description of an array as the order doesn't matter; however, for e.g. np.gradient the order of the returned list is clearly important, so "set" is wrong. Also some other minor doc edits noticed during the grepping: using `shape` instead of `form` in `cov` is consistent with most other places; the wording in `Polynomial.trim` now matches other methods on the same class.
* | MAINT: multiline regex class simplifyTyler Reddy2020-12-291-1/+1
|/ | | | | | * follow up to gh-18083 covering multi-line uses of `re.compile(..` and some cases for `re.match(..` with single (meta)character classes
* MAINT: regex char class improveTyler Reddy2020-12-281-1/+1
| | | | | | | | | | | | | * replace superfluous single-character regex character classes with their literal string equivalents; this avoids the overhead associated with a character class when there's only a single character enclosed (so there's no benefit to the class overhead) * for more information see: Chapter 6 of: Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O’Reilly Media, 2009.
* DOC: Fix a couple of reference to verbatim and vice versaMatthias Bussonnier2020-12-182-6/+6
| | | | | | | | | | | | | | | | This update a coupe of references (single backticks) that actually are not to verbatim/code (double backticks); and a couple of verbatim to reference when they do actually exists and can be resolved in context. I probably missed other; and stayed simple but spoted a few other inconsistencies that I did not fix: - some ``...`` could actually be :math:`...` but not always clear if it would be better. - some intervals are [``...``], other are ``[...]`` I guess they could be discussed individually; it was mostly the failing references that bothered me.
* DOC: Doc for deprecate_with_doc (#17852)kumudlakara2020-12-172-2/+36
| | | | | | * Add doc for deprecate_with_doc Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com> Co-authored-by: Matti Picus <matti.picus@gmail.com>
* Merge pull request #17942 from stefanv/npyio-docMatti Picus2020-12-141-19/+21
|\ | | | | DOC: Clarify savez documentation of naming arrays in output file
| * Clarify savez documentation around naming of arrays in output fileStefan van der Walt2020-12-061-19/+21
| |
* | [DOC] np.kron use double backticks for non-refsMatthias Bussonnier2020-12-131-2/+2
|/ | | | | | Some part of the docstring were between simple backticks which are therefore marked as cross-reference, while I belive the intended role is likely verbatim.
* MAINT: Replace `contextlib_nullcontext` with `contextlib.nullcontext`Bas van Beek2020-12-051-3/+3
|
* DEP: Finalize unravel_index `dims` alias for `shape` keywordSebastian Berg2020-12-021-11/+4
| | | | | The argument was renamed to `shape` and deprecated since NumPy 1.16, so the deprecation can now be finalized.
* Make it clearer that np.interp input must be monotonically increasingDavid Stansby2020-11-271-3/+3
|
* MAINT: Minor touchups in npyio (#17796)Ross Barnowski2020-11-192-9/+6
| | | | | | | | | | | | | | | * Simplify logic for encoding kwarg in _decode_line. * Remove unnecessary else branch from split_line. * MAINT: rm else branch from loadtxt. * MAINT: re-nest encoding parsing. Co-Authored-By: mattip <matti.picus@gmail.com> * condense return statement. Co-authored-by: mattip <matti.picus@gmail.com>
* TST: avoid refcount semantics, speed up testsMatti Picus2020-11-111-85/+56
|
* MAINT: Do not override `sliding_window_view` module to `numpy`Sebastian Berg2020-11-061-1/+1
|
* API: Do not import sliding_window_view to main namespaceSebastian Berg2020-11-051-12/+11
| | | | | At least for now, lets not import it to the main namespace, since there is no agreement that this is a good idea.
* ENH: Implement sliding window (gh-17394)Klaus Zimmermann2020-11-052-3/+334
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implement sliding_window_view #7753 Test cases are shown in the issue page. * Add Example Cases * Add step_size and N-dim support * Add shape and step_size check. Remove warning. * Remove shape default Add step_size default's description. * Give proper parameter name 'step' * fix a parameter description mistake * implement test function for sliding_window_view() * implement test function for sliding_window_view() * Fix according to @eric-wieser comments * Change arange to ogrid in Examples * remove np.squeeze on return line * Clarify document to avoid parameter confusion. * add `writable` and more explanation in docs * resolve a write conflit * fixes according to @seberg review * resolve write hazard * remove outdated docs. * change referring according to @mattip. change 'writeable' to 'readonly' as @seberg suggest. remove 'step' as @eric-wieser request * fix test minor error * DOC: Grammar fixes * STY: Add missing line break required by PEP8 * + Change readonly parameter to writeable. + Update writeable description. + Fix a few parameter checks. + Other minor improvements. * Move to new api as proposed by @eric-wieser - Change api to follow suggestion by Eric Wieser in https://github.com/numpy/numpy/pull/10771#issuecomment-524715356 - Update docstring - Add more tests * Improve documentation * Add sliding_window_view to documentation index * Apply suggestions from code review Co-authored-by: Eric Wieser <wieser.eric@gmail.com> * Fix window shape check * Add `sliding_window_view` to __all__ * Add tests for error cases * Add array_function dispatching * Change dispatcher argument defaults to None * Simplify array function dispatching * Added "np." prefix to doctests * Split tests * Improved docstring * Add release note * Fix docstring formatting * Fix doctest * Remove namespacing in documentation indexing * Improve docstring * Improved docstring * Simplified docstring * Improve docstring to make pseudo code stand out * Improve docstring * Add simple application example * Correct release note * Improve link with as_strides * Add note about performance * Tidy up main doc string * Make language on performance warning stronger * Bugfix: pass subok and writeable to as_strided * Add writeable test * Add subok test * Change subok test to use custom array subclass instead of unsupported MaskedArray * Add version added information Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Fanjin <fjzeng@ucsd.edu> Co-authored-by: Fanjin Zeng <Fnjn@users.noreply.github.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: fanjin <fjzeng@outlook.com> Closes gh-7753
* BUG: Fixed an issue where `.pyi` weren't picked up by numpy sub-packagesBas van Beek2020-11-031-0/+1
|
* DOC: Fix doctestsEric Wieser2020-10-241-3/+3
|
* use integer literal instead of floatCameron Blocker2020-10-181-1/+1
| | | Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
* BUG: Respect dtype of all-zero argument to poly1dCameron Blocker2020-10-172-1/+15
| | | | | Fixes gh-16354. Previously np.poly1d(z).coeffs.dtype would always be np.float64 for zero array z, regardless of z's dtype.
* ENH: add function to get broadcast shape from a given set of shapes. (#17535)madhulikajc2020-10-172-4/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ENH: add function to get broadcast shape from a given set of shapes. Add new function numpy.broadcast_shape which takes tuples for the shapes to be broadcast against each other. Return the broadcasted shape as a tuple. See #17217 * Perform array allocations of size 0 for provided shape tuples Co-authored-by: Eric Wieser <wieser.eric@gmail.com> * Test for int as input shape Also update docstring to include both ints and tuples of ints as input * Remove unnecessary array_function_dispatch * Add missing set_module * Add release notes. Add versionadded to docstring. Also fix up docstring details. * follow convention for trailing comma Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net> * Change name to broadcast_shapes. Also add test case, and type hint. * follow convention Co-authored-by: Eric Wieser <wieser.eric@gmail.com> * Update docstring Co-authored-by: Eric Wieser <wieser.eric@gmail.com> * Add reference to numpy docs on broadcasting to docstring Also move versionadded * Fix spelling Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com> * Add broadcast_shapes to reference docs and add See Also sections Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net> Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com>
* MAINT: Do not emit empty Methods heading in np.info (#17498)Steve Joachim2020-10-102-4/+23
| | | | | Fixes the incompatible type comparison found in #17490. This also corrects the logic to not print the heading when only private/magic methods are present.
* ENH: add dtype option to cov and corrcoef (#17456)Lisa Schwetlick2020-10-092-9/+36
| | | | | | | Adds a keyword-only dtype parameter to correlate and coerrcoef to allow user to specify the dtype of the output. Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Merge pull request #17442 from devhpes/devhpesMatti Picus2020-10-071-1/+1
|\ | | | | MAINT: fix exception chaining in format.py
| * fix exception chaining in format.pyAbhishek Singh2020-10-041-1/+1
| |
* | BUG: Fixes incorrect error message in numpy.ediff1d (#17457)stuartarchibald2020-10-052-8/+12
|/ | | | | | Fixes the error message reported by ediff1d in the case of an invalid to_begin and updates tests to assert validity. Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* DOC: Add arraysetops to autosummary.Ross Barnowski2020-09-291-16/+5
| | | | | | * Generate stub for module, fixes 7 broken links * Modify arraysetops module docstring w/ rst formatting * Remove listing of functions from module docstring.
* DOC: Fix syntax errors in docstrings for versionchanged, versionadded (#17338)Bradley Dice2020-09-172-2/+2
| | | * DOC: Fix typos in versionchanged.
* MAINT: Chaining exceptions in npyio.pyBijesh Mohan2020-09-161-5/+5
|
* Merge pull request #17285 from seberg/tune-down-financial-warningCharles Harris2020-09-121-1/+1
|\ | | | | DEP: Change the financial name access warning to DeprecationWarning
| * DEP: Change the financial name access warning to DeprecationWarningSebastian Berg2020-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Most end-users will probably not care about the warning in any case, since they will not just import the function but also use it. We can't just remove it, due to gh-17143: Astropy currently pulls in these functions (but doesn't use them), so that plain removal would lead to an unusable astropy if a new NumPy is installed. Even more annoying, due to a (faulty?) astropy pytest plugin, this affects all pytest runs (which do not use `PYTEST_DISABLE_PLUGIN_AUTOLOAD`). Changing it to a DeprecationWarning seems to remove the issue from pytest runs, this may make the warning less visible in rare cases where it should be seen, but hopefully it will still be visible enough.
* | ENH: Allow genfromtxt to unpack structured arrays (#16650)Andrew Eckart2020-09-112-6/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | * ENH: Allow genfromtxt to unpack structured arrays genfromtxt failed to transpose output when unpack=True and `dtype` was structured (or None). This patch resolves the issue by returning a list of arrays, as in `loadtxt`. Co-authored-by: Matti Picus <matti.picus@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net> Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* | Merge pull request #17250 from albertvillanova/fix-docstringCharles Harris2020-09-103-13/+28
|\ \ | |/ |/| DOC: Fix docstring cross-referencing
| * DOC: add autosummary of emath functionsRoss Barnowski2020-09-091-0/+16
| |
| * DOC: reformat meshgrid see also linksRoss Barnowski2020-09-091-4/+3
| |
| * Fix docstring cross-referencingAlbert Villanova del Moral2020-09-042-11/+11
| |
* | Merge pull request #17104 from BvB93/sub-modulesCharles Harris2020-09-071-0/+177
|\ \ | | | | | | ENH: Add placeholder stubs for all sub-modules
| * | ENH: Replace module-level `__getattr__` with explicitly defined objectsBas van Beek2020-08-191-2/+175
| | |
| * | ENH: Add placeholder stubs for all sub-modulesBas van Beek2020-08-191-0/+4
| | |
* | | Merge pull request #17235 from hugovk/rm-old-codeCharles Harris2020-09-071-38/+8
|\ \ \ | | | | | | | | MAINT: Remove old PY_VERSION_HEX and sys.version_info code
| * | | MAINT: Remove old sys.version_info codeHugo2020-09-031-38/+8
| | | |
* | | | Merge pull request #17193 from eric-wieser/clean-compatSebastian Berg2020-09-033-3/+3
|\ \ \ \ | | | | | | | | | | MAINT: Remove some callers of functions in numpy.compat
| * | | | MAINT: Remove users of `numpy.compat.bytes`Eric Wieser2020-08-313-3/+3
| | | | | | | | | | | | | | | | | | | | Some more Python 2 cleanup.
* | | | | MAINT: added exception chaining in shape_base.py (gh-17240)EthanCJ-git2020-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | This edit is relation to issue gh-15986. Chained exception in shape_base.py
* | | | | Merge pull request #17233 from eric-wieser/deprecate-ndincrSebastian Berg2020-09-031-0/+9
|\ \ \ \ \ | |_|_|_|/ |/| | | | DEP: Deprecated ndindex.ndincr