| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
`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.
|
|
|
| |
More sys.version cleanup.
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
| |
|
|
|
|
| |
* Deprecate class SafeEval
|
| |
|
| |
|
| |
|
|
|
|
| |
Closes #8058.
|
| |
|
|
|
|
|
|
|
|
|
| |
* added lib.recfunctions to refguide
PUBLIC_SUBMODULES, as the doctests
were otherwise not getting executed
* fixed a failing doctest in
recfunctions after above activation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 :).
|
| |
|
| |
|
|
|
| |
Found via `codespell`
|
|
|
|
|
| |
Also add a hint to the documentation advising the use of moveaxis over rollaxis.
Tests for rollaxis are left alone.
|
|
|
|
| |
Bare except is very rarely the right thing
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This requires to base masked median on sort(endwith=False) as we need to
distinguish Inf and NaN.
Using Inf as filler element of the sort does not work as then the mask is not
guaranteed to be at the end.
Closes gh-8340
Also fixed 1d ma.median not handling np.inf correctly, the nd variant
was ok.
|
| |
|
|
|
|
| |
The strings in error messages were left untouched
|
| |
|
| |
|
|
|
|
|
| |
Both of these functions will be removed in Python 3.6 and were deprecated
in 3.5. The numpy versions are not full versions, but hopefully suffice.
|
|\
| |
| | |
BF: do not crash lookfor if inspection fails - catch any Exception
|
| | |
|
|/
|
|
|
|
| |
This is to make it easier to find and remove deprecated features.
It would be a good idea if all deprecations were made with similar
comments.
|
|
|
|
| |
The class is no longer used in numpy and was never exported.
|
|
|
|
|
| |
This does what is needed now that the compiler module is no longer
used.
|
|
|
|
|
|
| |
The ast module was added in Python 2.6 as a replacement for the compiler
module. As we no longer support Python versions < 2.6, all uses of the
compiler module can be removed.
|
|
|
|
| |
The rules enforced are the same as those used for scipy.
|
|
|
|
|
|
| |
Some of those problems look like potential coding errors. In those
cases a Fixme comment was made and the offending code, usually an
unused variable, was commented out.
|
| |
|
|
|
|
| |
close gh-4345
|
|
|
|
| |
Fixes gh-2561
|
|
|
|
|
|
| |
The numarray info function is called by lib.utils.info. Rename it
to _info and copy into lib/utils.py. Some modifications are made
as it only needs to support numpy.
|
| |
|
|
|
|
|
|
|
| |
Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long
and will need to be broken at some point. OTOH, some lines were already
too long and need to be broken at some point. Now seems as good a time
as any to do this with open PRs at a minimum.
|
|
|
|
|
|
|
|
|
|
|
|
| |
WarningManager was a workaround for the lack of the with statement
in Python versions < 2.6. As those versions are no longer supported
it can be removed.
Deprecation notes are added to WarningManager and WarningMessage, but
to avoid a cascade of messages in third party apps, no warnings are
raised at this time, that can be done later.
Closes #3519.
|
| |
|
|
|
|
|
|
|
|
|
| |
memmap needs to call it in __array_finalize__ to determine if it can
drop the references on copies.
The python version if may_share_memory caused significant slowdowns when
slicing these maps.
closes gh-3364
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The idioms fixer makes the following replacements.
1) int <- bool
2) comparison or identity of types <- isinstance
3) a.sort() <- sorted(a)
There were two problems that needed to be dealt with after the
application of the fixer. First, the replacement of comparison or
identity of types by isinstance was not always correct. The isinstance
function returns true for subtypes whereas many of the places where the
fixer made a substitution needed to check for exact type equality.
Second, the sorted function was applied to arrays, but because it treats
them as iterators and constructs a sorted list from the result, that is
the wrong thing to do.
Closes #3062.
|
|
|
|
|
|
| |
Now that only Python versions 2.6-2.7 and 3.2-3.3 are supported
some version checks are no longer needed. This patch removes them
so as to clean up the code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Python3 `dict.items()`, `dict.keys()`, and `dict.values()` are
iterators. This causes problems when a list is needed so the 2to3 fixer
explicitly constructs a list when is finds on of those functions.
However, that is usually not necessary, so a lot of the work here has
been cleaning up those places where the fix is not needed. The big
exception to that is the `numpy/f2py/crackfortran.py` file. The code
there makes extensive use of loops that modify the contents of the
dictionary being looped through, which raises an error. That together
with the obscurity of the code in that file made it safest to let the
`dict` fixer do its worst.
Closes #3050.
|