| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* BUG: use explicit einsum_path whenever it is given
For example, allow user to specify unary contractions in binary einsum
as described in #20962.
The commit also adds a sanity check on user-specified einsum_path.
* fix lint
* MAINT: refactor logic with explicit_einsum_path
|
| |
|
|
|
|
|
|
|
|
|
| |
Via prototype docstring autoreformatter; and cherry-picked to mostly
include spacing issues around colons in parameters and see also.
When no space is present numpydoc tend to miss-parse those sections
A couple of typos are fixed as well.
|
|
|
|
|
|
| |
Following discussion in mailing list, this PR
adds mentions to third-party libs einops and opt_einsum
to einsum documentation
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Using PyArray_PyIntAsIntp helper function instead
* TST: add tests for einsum numpy int and bool list subscripts
Added tests to check that einsum accepts numpy int64 types and
rejects bool. Rejecting bools is new behaviour in subscript lists.
I changed ValueError to TypeError on line 2496 in multiarraymodule.c
as it is more appropriate. I also modified einsumfunc.py to have the
same behaviour as in the C file when checking subscript list.
(Reject bools but accept anything else from operator.index())
Closes gh-15961
|
|
|
|
|
|
|
|
|
| |
This PR uses simple cases of PEP 380 to rewrite:
for v in g:
yield v
into:
yield from <expr>
|
|
|
|
|
|
|
| |
This replaces basestring with str except in
- tools/npy_tempita/
- numpy/compat/py3k.py
|
|
|
|
| |
Now that 2.7 is gone, there is no need to pop manually from kwarg dictionaries.
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
|
|
|
|
|
| |
* DOC, MAINT: Misc. typo fixes
Found via `codespell`
|
|
|
|
|
|
|
| |
* reviewer requested that the cases where
I switched from free-floating comments to
`>>> # comments` be reverted to free-floating
in docstrings
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#12448)
* Review F401,F841,F842 flake8 errors (unused variables, imports)
* Review comments
* More tests in test_installed_npymath_ini
* Review comments
|
|\
| |
| | |
MAINT Use set litterals
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Use list comprehension
* More list comprehension migration
* Revert key copying in dict
* A few more fixes
* More reverts
* Use dict comprehension
* Fix dict comprehension
* Address review comments
* More review comments
* Fix for empty unpacking of zip(*
* Revert zip(* unpacking altogether
* Fix dict copying
* More simplifications
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I noticed a few more functions using ``array_function_dispatch`` where I had
not set the module, using this script::
import types
def check_module(module):
for name in dir(module):
item = getattr(module, name)
if isinstance(item, types.FunctionType):
print(f'{item.__module__}.{item.__name__}')
>>> import numpy
>>> check_module(numpy)
...
Note that functions without overrides like ``numpy.ones`` still display the
module in which they are defined, e.g., ``numpy.core.numeric.ones``. We should
probably fix that, too, probably most cleanly adding a decorator that sets
``__module__``, e.g.,
def set_module(module):
def decorator(func):
func.__module__ = module
return func
return decorator
...
@set_module('numpy')
def ones(shape, dtype=None, order='C'):
...
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
False is the documented value and the value used in 1.14, but 1.15.0 was
turning optimization on when there were more than two arguments,
resulting in slowdowns for small matrices. This choice can be revisited
as the einsum optimization code matures.
Closes #11714.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Minor tweaks to the optimal path based on opt_einsum
* Updates greedy path to current opt_einsum tech
* Reworks einsum broadcasting vs dot tech and can_dot logic
* MAINT: Fix typo in comment.
* BUG: Fix bad merge fixup.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Einsum docs improvements.
* DOC: add information to numpy.core.einsumfunc
* DOC: add information to numpy.core.einsumfunc
* DOC: add information to numpy.core.einsumfunc
* DOC: add information to numpy.core.einsumfunc
* DOC: remove 'numpy.core','c_einsum' section from 'add_newdocs.py'
* DOC: make :py:func links to all internal functions.
* DOC: make :py:func links to all internal functions (minor corrections)
* DOC: place `add_newdoc('numpy.core.multiarray','c_einsum'`,...) in file.
* DOC: minor requested corrections
* DOC: suggested optimize argument Example cases
* DOC: copy amendments to second docstring location in add_newdocs.py
* DOC: more descriptive text
* DOC: required correction to specify a default argument.
* DOC: minor presentation fix for example display in einsumfunc.py
* DOC: amend c_einsum documentation version, add note about dual documentation
|
| |
|
|
|
|
|
|
|
|
|
| |
User- and non-user-facing typos.
Some source typos fixes as well.
Found via `codespell`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Found via `codespell -q 3 -I ../numpy-whitelist.txt`
Whitelist consists of:
```
amin
ans
behaviour
cancellation
dum
initialise
ith
nd
ot
splitted
writeable
```
.
|
|\
| |
| | |
BUG: do not optimize einsum with only 2 arguments.
|
| |
| |
| |
| |
| |
| |
| | |
fixes gh-10357.
Avoid slow execution of 2-argument einsum calls, by ensuring
we use the c code directly.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Fix #10369
|
|/ |
|
|
|
| |
As per issue #10258, the default value of the `optimize` arg is made consistent with the documentation, making it `True` by default
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Einsum now optionally uses BLAS
* The einsum call is now optimized by default
* cleans up the dot logic
* MAINT: Correct spelling, tranpose <- transpose.
|
| |
|
| |
|
| |
|
|
|