| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
ENH: Add namedtuple return types to linalg functions that return tuples
|
| | |
|
| |
| |
| | |
Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
That is, eig(), eigh(), qr(), slogdet(), and svd(). For those functions that
return non-tuples with certain keyword arguments, the return type is
unchanged. This change should be completely backwards compatible.
The namedtuple attribute names come from the array API specification (see,
e.g.,
https://data-apis.org/array-api/latest/extensions/generated/signatures.linalg.eigh.html),
with the exception of eig() which is just the same as eigh(). The name of the
namedtuple object itself is not part of the specification or the public API.
I have not used a namedtuple for the tuple output for qr(mode='raw'), which
returns (h, tau).
This updates the docstrings to use the updated namedtuple return names, and
also the examples to use those names more consistently. This also updates the
tests to check each function for the namedtuple attributes at least once.
|
|\ \
| | |
| | | |
MAINT: remove redundant open() modes and io.open() alias
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
[skip cirrus]
|
| | |
| | |
| | |
| | |
| | | |
This assumes lapack errors already report something reasonable, that
may not be true, but is a different issue probably.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The finfo contains a cache for dtypes, but the np.complex128 dtype does not end up in the cache. The reason is that the np.complex128 is converted to np.float64 which is in the cache.
Performance improvement for finfo(np.complex128):
Main: 2.07 µs ± 75 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
Pr: 324 ns ± 28.9 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
Improve performance of finfo by making the cache check the first action in the __new__
Improve performance of _commonType by re-using the expression for a.dtype.type and eliminating variables
The finfo and _commonType was part of the computatation time in lstsq when using scikit-rf. Since these methods are used in various other methods performance can improve there slightly as well.
|
| | |
| | |
| | |
| | |
| | | |
`std::is_scalar` is defined in `type_traits`, which is missing from the
includes.
|
|\ \ \
| | | |
| | | | |
MAINT: changing the method of checking for nan / inf values linalg.eig
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
Changing numpy to use the same function from numpy.lib.function_base as scipy. Tests pass.
|
| |_|/
|/| | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
MAINT: Move set_module from numpy.core to numpy._utils
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This enables building with NumPy on Linux and macOS. Windows support
should be complete to, but is untested as of now and may need a few
tweaks. This contains:
- A set of `meson.build` files and related code generation script
tweaks, header templates, etc.
- One CI job on Linux
- Basic docs on using Meson to build NumPy (not yet integrated in the
html docs, it's too early for that - this is for early adopters right
now).
The build should be complete, with the major exception of SIMD support.
The full test suite passes. See gh-22546 for the tracking issue with
detailed notes on the plan for switching NumPy to Meson as its build
system.
Co-authored-by: Stefan van der Walt <stefanv@berkeley.edu>
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`Python.h` must be included before including and standard library
headers, if it's pulled in (which happens when you include numpy
headers). Otherwise we see build warnings like:
```
142/244] Compiling C object numpy/core/_multiarray_umath.cpython-311-x86_64-linux-gnu.so.p/src_multiarray_textreading_field_types.c.o
In file included from /opt/hostedtoolcache/Python/3.11.0/x64/include/python3.11/Python.h:86,
from ../numpy/core/include/numpy/npy_common.h:5,
from ../numpy/core/include/numpy/ndarraytypes.h:4,
from ../numpy/core/src/multiarray/textreading/field_types.h:9,
from ../numpy/core/src/multiarray/textreading/field_types.c:1:
/opt/hostedtoolcache/Python/3.11.0/x64/include/python3.11/cpython/pytime.h:208:60: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
208 | PyAPI_FUNC(int) _PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts);
| ^~~~~~~~
/opt/hostedtoolcache/Python/3.11.0/x64/include/python3.11/cpython/pytime.h:213:56: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
213 | PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts);
| ^~~~~~~~
/opt/hostedtoolcache/Python/3.11.0/x64/include/python3.11/cpython/pytime.h:217:63: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
217 | PyAPI_FUNC(void) _PyTime_AsTimespec_clamp(_PyTime_t t, struct timespec *ts);
| ^~~~~~~~
```
|
|\ \ \
| | | |
| | | | |
ENH, CI: Add Emscripten to CI
|
| | |/
| |/| |
|
| | |
| | |
| | |
| | | |
[skip ci]
|
|/ /
| |
| |
| | |
This fixes some annoying build warnings.
|
| |
| |
| |
| | |
This reverts commit 5d6b8b0d5658418919fbaef0e843655262291dbc.
|
| |
| |
| | |
inifinity -> infinity
|
|\ \
| | |
| | | |
DEP: Deprecate fastCopyAndTranspose
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Deprecate the fastCopyAndTranspose function from the Python API, and the
underlying PyArray_CopyAndTranspose function from the C-API.
Also removes an internal, private function _fastCopyAndTranspose which
was the original Python wrapper around the C-function.
|
|\ \ \
| |/ /
|/| | |
DOC: fix linalg.tensorsolve docstring
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| | |
Some system (e.g. musl) do not have "execinfo.h", and the backtracking
is provided by libunwind.
Fix: #22084
|
|/ |
|
| |
|
|\
| |
| | |
API: Introduce optional (and partial) NEP 50 weak scalar logic
|
| | |
|
| | |
|
|\ \
| |/
|/| |
ENH: Change f2c declarations with void return type to int
|
| |
| |
| |
| |
| |
| | |
When using f2c, the generated C functions for all of these actually
return int. WebAssembly is strict on return types and will crash due
to the discrepancy.
|
| | |
|
| | |
|
| | |
|
| |
| |
| | |
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
|/
|
|
|
|
|
|
|
| |
Using `sys` to ask about the build Python is hostile to cross
building because it is very hard to replace the sys module with one
that gives info about the target system. On the other hand, the
sysconfig data can be replaced by setting _PYTHON_SYSCONFIGDATA_NAME.
So instead of using `sys.maxsize` to determine pointer size, use
`sysconfig.get_config_var("SIZEOF_VOID_P")`
|
|\
| |
| | |
MAINT: Fix some typos.
|
| | |
|
|/ |
|
|
|
|
| |
Reduce the overhead of np.linalg.norm by replacing dot(x,x) with x.dot(x).
This is OK, since `x` is converted to a base-class array here.
|