| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Added a note to some of the tests that the order of the calls is an
important part of the test, because the code is testing the caching
of the ufuncs.
Also reuse a couple functions in the vectorize tests by defining them at
the module level.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When `otypes` is given to `vectorize` and then the instance is
called, it creates a ufunc by calling numpy.core.umath.frompyfunc.
The number of arguments given to this ufunc is set to the number
of arguments in the call of the vectorize instance. This ufunc
is cached, so frompyfunc does not have to be called on the next
call. The problem is that, if the function being wrapped has
parameters with default values, the number of arguments passed
to the vectorize instance can change, and when that happens, a
new ufunc must be created by calling frompyfunc with the correct
number of arguments.
This commit changes the cache of the ufunc from a simple attribute
that holds the most recent ufunc to a dictionary whose keys are
the number of arguments in the call. The cache is only used when
the vectorized function is called with only positional arguments
and there are no excluded arguments. If keywords are used, the
number of arguments is no longer sufficient to uniquely identify a
previously created ufunc.
Closes gh-16120.
|
|
|
|
|
| |
* DOC: add note on type casting to numpy.left_shift().
Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ENH: update numpy.linalg.multi_dot to accept an `out` argument
* TST ensure value returned by numpy.linalg.multi_dot matches out
* DOC add note about initial call to numpy.linalg.multi_dot
* DOC add release note for #15715
Co-authored-by: Matti Picus <matti.picus@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#14924)
* Add stick-breaking
* Add tests demonstrating slowness for beta and dirichlet generators for small alpha (and beta) values
* Remove the test for beta with small `a` and `b`
* Switch from standard to stick-breaking method whenever alpha.max() < 0.1
Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
|\
| |
| | |
BUG: random: Generator.integers(2**32) always returned 0.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Add repeatability tests for when the range of the integers is `2**32`
(and `2**32 +/- 1` for good measure) with broadcasting. The underlying
functions called by Generator.integers and random.randint when the
inputs are broadcast are different than when the inputs are scalars.
|
| |
| |
| |
| |
| | |
Assert that an invalid value (2**n-1 for n = 8, 16, 32, 64) has not
been passed to the Lemire function.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the input to Generator.integers was 2**32, the value 2**32-1
was being passed as the `rng` argument to the 32-bit Lemire method,
but that method requires `rng` be strictly less then 2**32-1.
The fix was to handle 2**32-1 by calling next_uint32 directly.
This also works for the legacy code without changing the stream
of random integers from `randint`.
Closes gh-16066.
|
|\ \
| | |
| | | |
MAINT: Replace npyiter_order_converter with PyArray_OrderConverter
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The TODO precondition now holds, so we no longer need this function.function_base.py
A consequence of this change is that:
* `None` is now accepted as an alias for `'K'`
* Lowercase letters are now accepted as a replacement for the corresponding uppercase letter
Neither of these are particularly desirable, but we could always deprecate them in PyArray_OrderConverter at a later date.
|
|\ \ \
| |/ /
| | /
| |/
|/| |
BUG: Unify handling of string enum converters
|
| |
| |
| |
| |
| |
| |
| |
| | |
This fixes a collection of bugs:
* Confusion between `TypeError` and `ValueError`
* Allowing invalid arguments if they are valid up to the first embedded null
* Producing better errors for non-ascii unicode strings
|
|\ \
| | |
| | | |
ENH: Fix exception causes in four .py files
|
| | |
| | |
| | | |
Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>
|
| | |
| | |
| | | |
Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
* BUG: fix AttributeError on accessing object in nested MaskedArray
Co-authored-by: Rena Xu <renaxu@Renas-MacBook-Pro.local>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: vagrant <vagrant@vagrant.vm>
|
|\ \ \
| | | |
| | | | |
DOC: add a note on sampling 2-D arrays to random.choice docstring
|
| |/ /
| | |
| | |
| | | |
Addresses a comment on gh-10835.
|
|/ /
| |
| | |
Add missing closing brackets, script to generate the list in the PR gh-16051.
|
| | |
|
| |
| |
| | |
Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>
|
|\ \
| | |
| | | |
MAINT: AVX512 implementation with intrinsic for float64 input np.exp()
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | | |
AIX needs to be told to use large file support at all times. Fixes parts of gh-15801.
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
ENH: Fix exception causes in build_clib.py
|
| | | | |
|
|\ \ \ \
| | |_|/
| |/| | |
TST: Add tests for the conversion utilities
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This way we can test them without having to try and guess their behavior from the functions that use them.
This also makes a bit more apparently the inconsistencies between them.
|
|\ \ \ \
| | | | |
| | | | | |
MAINT,TST: Move _repr_latex tests to test_printing.
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Organizational refactoring - the tests for the polynomial _repr_latex
method were originally defined in test_classes.py. Based on the
descriptions of the various test files, it is a better fit in
test_printing.py.
Updated docstring to reflect that _repr_latex is used in Jupyter
environments, not IPython terminals (by default).
|
|/ / / |
|
| | |
| | |
| | |
| | |
| | |
| | | |
It was not clear how to reproduce the slice example with multi dimensional array indexing. I hope the additional example clarifies the equivalence between slice and multi array for new users.
Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
Co-Authored-By: Anirudh Subramanian <anirudh2290@apache.org>
|
| | |
| | |
| | |
| | |
| | | |
Only one dimensional alpha paramter is currently supported, but higher dimensions were silently allowed and gave an incorrect results. This fixes the regression. In the future, the API could be extended to allow higher dimensional arrays for alpha.
Fixes gh-15915
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit fixes the at `nextafter(np.inf, ...)` should not return NaN unless the second value is NaN. Also `nextafter(NaN, ...)` and `nextafter(..., NaN) should not give the invalid value warning (no invalid value is created, the invalid value is propagated).
This aligns half-float `nextafter` with double/float `nextafter`.
Closes #15977
|
|\ \ \
| | | |
| | | | |
DOC: Fix method documentation of function sort in MaskedArray
|
| |/ / |
|