summaryrefslogtreecommitdiff
path: root/numpy/lib/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* DOC: Add 'may vary' markup in info() docstring.warren2023-03-071-1/+1
| | | | [skip actions] [skip travis] [skip cirrus]
* DOC: Edit top line of info() docstring to mention array.warren2023-03-071-1/+1
| | | | [skip actions] [skip travis] [skip azp] [skip cirrus]
* DOC: Document that info() handles array instances.warren2023-03-071-4/+21
| | | | [skip actions] [skip travis] [skip azp] [skip cirrus]
* MAINT: expand show_rutime, add it to issue template [skip ci]mattip2022-12-211-31/+9
|
* MAINT: Move set_module to numpy.core to use without C importSebastian Berg2022-11-241-1/+1
|
* Merge pull request #22393 from seberg/npy_headerMatti Picus2022-10-071-0/+6
|\ | | | | MAINT: Ensure graceful handling of large header sizes
| * MAINT: Ensure graceful handling of large header sizesSebastian Berg2022-10-061-0/+6
| | | | | | | | | | | | | | | | | | This ensures graceful handling of large header files. Unfortunately, it may be a bit inconvenient for users, thus the new kwarg and the work-around of also accepting allow-pickle. See also the documation here: https://docs.python.org/3.10/library/ast.html#ast.literal_eval
* | REV: Losen `lookfor`'s import try/except again (#22356)Sebastian Berg2022-09-301-2/+6
|/ | | | | | | | | | | Some BaseExceptions (at least the Skipped that pytest uses) need to be caught as well. It seems easiest to be practical and keep ignoring almost all exception in this particular code path. Effectively reverts parts of gh-19393 Closes gh-22345 Co-authored-by: Sebastian Berg <sebastianb@nvidia.com>
* MAINT: use `functools.wraps` in `np.deprecate`Josh Wilson2022-09-211-16/+5
|
* MAINT: update function's `__module__` attribute in `deprecate`Josh Wilson2022-09-211-6/+5
| | | | | | Currently the location of the function definition is always reported to be `numpy.lib.utils`; this changes it to be the location of the actual definition when possible.
* DOC: Fixed links for np.show_runtime (#21468)Ganesh Kathiresan2022-08-211-3/+3
|
* ENH: Added `show_runtime`ganesh-k132022-08-191-1/+78
| | | | | | | | 1. Information is derived with the help of `threadpoolctl` library. 2. In case `threadpoolctl` is not installed, a message is displayed with help on how to install it. 3. SIMD related information is derived from `__cpu_features__`, `__cpu_baseline__` and `__cpu_dispatch__`
* DOC: disambiguate :: in rst. (#21037)Matthias Bussonnier2022-02-111-2/+1
| | | | | | | | | Having the `::` on new line can be ambiguous for RST parsers, as `:` is a valid character for header underlines. And as underlines do not have to be as long as the title for some rst parser this appears to be a title. Workaround is to have either a blank line, or put the `::` at the end of previous one.
* BUG: Fixed docstring of numpy.info()Andrei Batomunkuev2021-11-241-1/+2
|
* Fixed python docstring in info()Andrei Batomunkuev2021-11-241-1/+1
|
* BUG: Fixed output overriding in numpy.info(), so that it correctly displays ↵Andrei Batomunkuev2021-11-241-2/+8
| | | | in Google Colab. Closes#20423
* MAINT: Improve ``_median_nancheck`` docstring.Charles Harris2021-09-141-1/+1
|
* MAINT: remove unused argument in private functionMarten van Kerkwijk2021-09-141-6/+6
|
* BUG: ensure np.median does not drop subclass for NaN result.Marten van Kerkwijk2021-09-141-8/+6
| | | | | | | | Currently, np.median is almost completely safe for subclasses, except if the result is NaN. In that case, it assumes the result is a scalar and substitutes a NaN with the right dtype. This PR fixes that, since subclasses like astropy's Quantity generally use array scalars to preserve subclass information such as the unit.
* MAINT: refactor "for ... in range(len(" statementsMike Taves2021-09-011-4/+2
|
* Update numpy/lib/utils.pyAndrew Watson2021-07-031-1/+1
| | | Co-authored-by: Matti Picus <matti.picus@gmail.com>
* MAINT: fix overly broad exception handling listed in LGTMAndrew Watson2021-07-011-1/+1
| | | | Relates to ticket #19077
* ENH: add new function `_opt_info()` to utils provides the optimization info ↵Sayed Adel2021-04-221-9/+35
| | | | of NumPy build
* DOC: Add blank line before section.Matthias Bussonnier2021-04-161-0/+1
| | | | Otherwise Numpydoc does not see the section.
* Merge pull request #18379 from anntzer/mndSebastian Berg2021-02-091-2/+2
|\ | | | | DOC: Fix docstring of _median_nancheck.
| * DOC: Fix docstring of _median_nancheck.Antony Lee2021-02-091-2/+2
| | | | | | | | | | | | _median_nancheck doesn't support axis being anything other than an integer (otherwise the call to moveaxis would fail). This is fine, because median goes through _ureduce for multi-axis support.
* | MAINT: Avoid moveaxis overhead in median.Antony Lee2021-02-061-2/+1
|/ | | | | | This change speeds up taking the median of 1001 floats by ~20%, as measured by `python -mtimeit -s 'import numpy as np; x = np.random.randn(1001)' -- 'np.median(x)'`
* DOC: Doc for deprecate_with_doc (#17852)kumudlakara2020-12-171-1/+26
| | | | | | * 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>
* MAINT: Do not emit empty Methods heading in np.info (#17498)Steve Joachim2020-10-101-4/+4
| | | | | 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.
* Merge pull request #16349 from larsoner/depCharles Harris2020-05-231-0/+2
|\ | | | | BUG: Indentation for docstrings
| * BUG: Indentation for docstringsEric Larson2020-05-221-0/+2
| |
* | 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.
* MAINT: remove useless `global` statementsEric Wieser2020-03-181-1/+0
| | | | | | | `global` is only needed if a variable appears on the left of an assignment. These variables do not. Most suffer from the misconception that `var[x] = y` requires `var` to be global, but it does not.
* MAINT: Remove sys.version checks (gh-#15373)Seth Troisi2020-01-281-35/+0
| | | More sys.version cleanup.
* [MAINT] Cleanup python2 sys.version checksSeth Troisi2020-01-201-5/+1
|
* MAINT: Remove implicit inheritance from object class (#15236)Jon Dufresne2020-01-051-1/+1
| | | | | | | Inheriting from object was necessary for Python 2 compatibility to use new-style classes. In Python 3, this is unnecessary as there are no old-style classes. Dropping the object is more idiomatic Python.
* MAINT: Remove unnecessary 'from __future__ import ...' statementsJon Dufresne2020-01-031-2/+0
| | | | | As numpy is Python 3 only, these import statements are now unnecessary and don't alter runtime behavior.
* MAINT: Simplify lookfor functionAlex Henrie2019-09-151-6/+1
|
* DEP: Deprecate class `SafeEval` (#14335)Maxwell Aladago2019-08-241-87/+0
| | | | * Deprecate class SafeEval
* fix testskritisingh12019-06-071-3/+0
|
* Fix testskritisingh12019-04-101-4/+0
|
* Issue deprecation warningskritisingh12019-04-051-0/+6
|
* BUG: Fix help() formatting for deprecated functions.wrwrwr2019-02-171-0/+29
| | | | Closes #8058.
* ENH: remove "Invalid value" warnings from median, percentilemattip2019-01-061-5/+0
|
* MAINT: include recfunctions moduleTyler Reddy2018-12-141-0/+1
| | | | | | | | | * 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: address several reviewer commentsTyler Reddy2018-12-141-2/+2
|
* TST, DOC: enable refguide_checkTyler Reddy2018-12-141-9/+6
| | | | | | | | * 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
* DEV remove shim added in 1.4mattip2018-11-141-7/+0
|
* ENH: set correct __module__ for objects in numpy's public APIStephan Hoyer2018-11-131-0/+5
| | | | | | | | | | | | | Fixes GH-12271 Tests verify that everything in ``dir(numpy)`` either has ``__module__`` set to ``'numpy'``, or appears in an explicit whitelist of undocumented functions and exported bulitins. These should eventually be documented or removed. I also identified a handful of functions for which I had accidentally not setup dispatch for with ``__array_function__`` before, because they were listed under "ndarray methods" in ``_add_newdocs.py``. I guess that should be a lesson in trusting code comments :).