summaryrefslogtreecommitdiff
path: root/numpy/__init__.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'main' into never_copyRalf Gommers2021-11-121-0/+4
|\
| * BUG: Fix duplication of names in 'numpy.__all__'.warren2021-11-031-0/+4
| | | | | | | | Closes gh-10198.
* | resolved conflictsGagandeep Singh2021-11-021-10/+10
|\ \ | |/
| * DEP: Deprecate the `np.core.machar` moduleBas van Beek2021-10-261-1/+1
| |
| * DEP: Deprecate `np.MachAr`Bas van Beek2021-10-261-0/+7
| | | | | | | | f
| * BUG: Make sure __version__ is defined in setup modeAaron Meurer2021-09-231-3/+4
| | | | | | | | This fixes a regression introduced in #19927.
| * BUG: Only call the get_versions() function once on importAaron Meurer2021-09-221-9/+1
| | | | | | | | | | | | | | | | | | | | When using an in-place build, this function calls various git commands to get the version number. Previously it was called three times, making 'import numpy' take over 3 seconds on my machine (it could be even slower on a slow filesystem). The code has been refactored to only call this function once in versions.py. Now 'import numpy' on an in-place build only takes 500 ms, which is still slower than importing the installed version, but that is expected when using versioneer.
* | resolved conflictsczgdp18072021-09-031-55/+39
|\ \ | |/
| * MAINT: Cleanup code after dropping Python 3.7.Charles Harris2021-08-161-55/+39
| |
* | Made _CopyMode privateczgdp18072021-08-181-1/+1
| |
* | Shifted to CopyMode to np.array_apiczgdp18072021-08-071-3/+2
| |
* | resolved conflictsczgdp18072021-08-061-4/+4
|\ \ | |/
| * Update numpy/__init__.pyRoss Barnowski2021-06-141-3/+3
| | | | | | Co-authored-by: Matti Picus <matti.picus@gmail.com>
| * Update warning linebreaks per review.Ross Barnowski2021-06-071-4/+4
| |
* | Addressed reviews and PyArray_CopyConverter definedczgdp18072021-06-071-1/+2
| |
* | Added np.CopyModeczgdp18072021-06-051-1/+2
|/
* Merge pull request #17586 from BvB93/type_aliasesCharles Harris2021-03-301-0/+5
|\ | | | | DEP: Formally deprecate `np.typeDict`
| * Apply suggestions from code review Bas van Beek2021-01-161-1/+2
| | | | | | | | | | | | | | * Add a deprecation comment to `numpy/__init__.py` * Replace a `getattr()` operation with `core.numerictypes.typeDict` * Remove a redundant call to `np.sctypeDict` Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
| * DEP: Formally deprecate the use of `typeDict`Bas van Beek2021-01-161-0/+4
| | | | | | | | `typeDict` is a deprecated alias for `sctypeDict` and has been so for >= 14 years (https://github.com/numpy/numpy/commit/668950285c407593a368336ff2e737c5da84af7d)
* | BUG: Fix typo in ``numpy.__init__.py``Charles Harris2021-02-011-2/+2
| | | | | | | | | | | | | | Fix use of "long" when "unicode" was intended. Also fix spelling of "unicode". Closes #18287
* | Merge pull request #18230 from seberg/issue-17977Charles Harris2021-01-261-25/+49
|\ \ | | | | | | DOC: Clarify the type alias deprecation message
| * | Apply suggestions from code reviewSebastian Berg2021-01-261-1/+1
| | | | | | | | | Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
| * | Update numpy/__init__.pySebastian Berg2021-01-261-6/+4
| | | | | | | | | Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
| * | DOC: Clarify the type alias deprecation messageSebastian Berg2021-01-261-27/+52
| |/ | | | | | | | | This tries to clarify the type alias deprecation message slightly to give more guidance on how to review the replacement (if desired).
* | STY: unify imports in __init__.py (#18187)Amarnath19042021-01-241-3/+3
|/ | | minor style cleanup
* DOC: Warn when reloading numpy or using numpy in sub-interpreterSebastian Berg2020-12-151-0/+5
| | | | | | | | This adds a warning when the main NumPy module is reloaded with the assumption that in this case objects such as `np.matrix`, `np._NoValue` or exceptions may be cached internally. It also gives a warning when NumPy is imported in a sub-interpreter.
* ENH: Use versioneer to manage numpy versions.Charles Harris2020-12-081-3/+12
| | | | | | | | | | | | The new tags look like '1.21.0.dev0+98.gaa0453721f', where '98' is the number of commits since the 1.21.0 branch was started and 'aa0453721f'. The chosen form may be specified in the 'setup.cfg' file. This PR adds two new files 'numpy/_version.py' and 'numpy/version.py'. The latter is kept because it is part of the public API and is actually used by some downstream projects, but it is no longer dynamically created. See https://github.com/python-versioneer/python-versioneer/ for more information.
* 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.
* Use a better name for the collection of expired functions.Warren Weckesser2020-08-231-2/+2
|
* MAINT: lib: Change handling of the expired financial functions.Warren Weckesser2020-08-221-5/+10
| | | | | | | | | | | | | | | | | | In a previous commit, the expired financial functions were removed from NumPy, and code was added to __init__.py using the module __getattr__ to raise a customized AttributeError on any attempt to reference the expired names in the numpy namespace. That change broke released versions astropy, which has code that imports the financial functions. astropy never calls the functions, so they never saw the deprecation warnings that have been in place since numpy 1.18. This means that attempting to use a released version of astropy with numpy 1.20 will cause astropy to crash with the custom AttributeError. In this commit, instead of raising an exception when one of the expired names is referenced, a warning is generated. If the function is *called*, an exception is raised.
* DEP: lib: Remove the deprecated financial functions. (#17067)Warren Weckesser2020-08-121-0/+21
| | | | | | | | | As explained in NEP 32, the financial functions are to be removed from version 1.20. They are now replaced with module level `__getattr__` to give a useful error message for those surprised by the `AttributeError`. This only works for Python 3.7+, but it is expected that by the 1.20 release Python 3.6 will not be supported.
* Fix exception causes in __init__.pyashutosh619-sudo2020-07-191-1/+1
|
* Fix exception causes in __init__.pyashutosh619-sudo2020-07-191-2/+2
|
* MAINT: Disable use_hugepages in case of ValueErrorAnirudh Subramanian2020-06-301-5/+12
|
* Merge pull request #14882 from eric-wieser/6103-alias-__getattr__-deprecationSebastian Berg2020-06-161-17/+61
|\ | | | | DEP: Deprecate aliases of builtin types in python 3.7+
| * DEP: Deprecate aliases of builtin types in python 3.7+Eric Wieser2020-06-121-17/+61
| | | | | | | | | | | | | | | | This: * Makes accessing these attributes emit a deprecation warning * Removes them from `dir(numpy)`, so as not to emit warnings for user of `inspect.getmembers` These aliases are a continual source of confusion for beginners, and are still often used by accident by experts.
* | DOC,ENH: extend error message when Accelerate is detectedmattip2020-05-311-5/+4
|/
* DEP: Deprecate `numpy.dual`.Warren Weckesser2020-05-041-1/+3
| | | | | | 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 #15769 from seberg/hugepages-allow-togglingMatti Picus2020-05-031-0/+21
|\ | | | | ENH: Allow toggling madvise hugepage and fix default
| * Fixup: Implement suggestions by MattiSebastian Berg2020-04-281-1/+1
| |
| * ENH: Allow toggling madvise hugepage and fix defaultSebastian Berg2020-03-171-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | By default this disables madvise hugepage on kernels before 4.6, since we expect that these typically see large performance regressions when using hugepages due to slow defragementation code presumably fixed by: https://github.com/torvalds/linux/commit/7cf91a98e607c2f935dbcc177d70011e95b8faff This adds support to set the behaviour at startup time through the ``NUMPY_MADVISE_HUGEPAGE`` environment variable. Fixes gh-15545
* | MAINT: simplify code that assumes str/unicode and int/long are different ↵Eric Wieser2020-03-261-2/+1
|/ | | | | types (#15816) Cleanup from the dropping of python 2
* MAINT: Test during import to detect bugs with Accelerate(MacOS) LAPACK (#15695)Rakesh Vasudevan2020-03-151-0/+32
| | | | | | | * TST: Test during import to detect bugs with Accelerate(MacOS) LAPACK fixes #15647 * Pipeline update for Accelerate(MacOS) testing
* FIXME -> NOTE: more precise language in comment.Ross Barnowski2020-03-011-2/+2
| | | | Reference multiple relevant discussions on GH
* MAINT: Added comment pointing FIXME to relevant PR.Ross Barnowski2020-03-011-0/+1
| | | | | | | Clarifies a FIXME comment in numpy/__init__.py by referencing relevant discussion in issue tracker. Closes #15668.
* MAINT: dir(numpy) returned duplicate "testing" (gh-15425)SanthoshBala182020-01-271-1/+1
| | | | | Modified __dir__() to remove duplicate "Tester/Testing" attribute. Also added a test to verify this. Closes gh-15383
* MAINT/DOC: Remove use of old Python __builtin__, now known as builtinsMike Taves2020-01-241-5/+2
|
* 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.
* BUG: Remove builtins from __all__Eric Wieser2019-11-121-2/+6
| | | | | | | | This was introduced in 3ca0eb1136102ff01bcc171f53c106326fa4445b, due to an incorrect implementation of `__dir__` (fixed in the previous commit). It was never released, so this is not a breaking change. In that commit, `from numpy import *` would reset all the builtins to their defaults, and set `unicode = str`, `long = int`.
* BUG: Fix np.__dir__ to correctly handle new propertiesEric Wieser2019-11-111-1/+1
| | | | | | | | | | Previously this would fail, but only on python 3.7+ ``` np.new_member = 1 assert 'new_member' in dir(np) ``` While this isn't something we support anyway, it certainly wasn't intentional.