| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
DOC: Update TESTS.rst.txt for pytest
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | | |
Fully closes #13751.
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
MAINT: Correct intrinsic use on Windows
|
|/ / / / /
| | | | |
| | | | |
| | | | | |
Add pragme and include for Windows PCG64
|
|\ \ \ \ \
| | | | | |
| | | | | | |
MAINT: remove dSFMT
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
DOC: Adds examples for dtype attributes
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
MAINT: random: Fix a few compiler warnings.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Fixes:
gcc: numpy/random/src/xoshiro256/xoshiro256.c
numpy/random/src/xoshiro256/xoshiro256.c:39:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
for (i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc: numpy/random/src/xoshiro512/xoshiro512.c
numpy/random/src/xoshiro512/xoshiro512.c:43:17: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
for (i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
numpy/random/src/xoshiro512/xoshiro512.c:46:23: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
for (w = 0; w < sizeof s_placeholder / sizeof *s_placeholder; w++)
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc: numpy/random/src/distributions/distributions.c
numpy/random/src/distributions/distributions.c:185:14: warning: comparison of integers of different signs: 'int64_t' (aka 'long long') and 'const uint64_t' (aka 'const unsigned long long') [-Wsign-compare]
if (rabs < ki_double[idx])
~~~~ ^ ~~~~~~~~~~~~~~
numpy/random/src/distributions/distributions.c:230:14: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'const uint32_t' (aka 'const unsigned int') [-Wsign-compare]
if (rabs < ki_float[idx])
~~~~ ^ ~~~~~~~~~~~~~
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
* [DOC] Refactor C-API: Python Types and C structures
|
|\ \ \ \ \ \ \ \
| |_|_|/ / / / /
|/| | | | | | | |
LICENSE: update dragon4 license to MIT
|
|/ / / / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Ralf Gommers obtained written permission from Ryan Juckett on
15 June 2019 to distribute the dragon4-derived code under the
MIT license.
Note that the "one of a kind" designation in LICENSES_bundled.txt
wasn't quite correct: this was the Zlib license (which is less
well known, but also compatible with NumPy's BSD 3-clause license).
Closes gh-13674
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
MAINT: Remove duplication of should_use_min_scalar_type function
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
The function was used within umath but since the modules are joined
now, there is no need for the duplication.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
MAINT: Fix warnings in radixsort.c.src: comparing integers of different signs
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Eliminate many compiler warnings of the form:
numpy/core/src/npysort/radixsort.c.src:61:23: warning: comparison of integers of different signs: 'npy_intp' (aka 'long') and 'unsigned long' [-Wsign-compare]
for (l = 0; l < sizeof(npy_ubyte); l++) {
~ ^ ~~~~~~~~~~~~~~~~~
numpy/core/src/npysort/radixsort.c.src:66:19: warning: comparison of integers of different signs: 'npy_intp' (aka 'long') and 'unsigned long' [-Wsign-compare]
for (l = 0; l < sizeof(npy_ubyte); l++) {
~ ^ ~~~~~~~~~~~~~~~~~
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
MAINT: random: Rewrite the hypergeometric distribution.
|
| | |_|/ / / / / /
| |/| | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Summary of the changes:
* Move the functions random_hypergeometric_hyp, random_hypergeometric_hrua
and random_hypergeometric from distributions.c to legacy-distributions.c.
These are now the legacy implementation of hypergeometric.
* Add the files logfactorial.c and logfactorial.h,
containing the function logfactorial(int64_t k).
* Add the files random_hypergeometric.c and random_hypergeometric.h,
containing the function random_hypergeometric (the new implementation
of the hypergeometric distribution). See more details below.
* Fix two tests in numpy/random/tests/test_generator_mt19937.py that
used values returned by the hypergeometric distribution. The
new implementation changes the stream, so those tests needed to
be updated.
* Remove another test obviated by an added constraint on the arguments
of hypergeometric.
Details of the rewrite:
If you carefully step through the old function rk_hypergeometric_hyp(),
you'll see that the end result is basically the same as the new function
hypergeometric_sample(), but the new function accomplishes the result with
just integers. The floating point calculations in the old code caused
problems when the arguments were extremely large (explained in more detail
in the unmerged pull request https://github.com/numpy/numpy/pull/9834).
The new version of hypergeometric_hrua() is a new translation of
Stadlober's ratio-of-uniforms algorithm for the hypergeometric
distribution. It fixes a mistake in the old implementation that made the
method less efficient than it could be (see the details in the unmerged
pull request https://github.com/numpy/numpy/pull/11138), and uses a faster
function for computing log(k!).
The HRUA algorithm suffers from loss of floating point precision when
the arguments are *extremely* large (see the comments in github issue
11443). To avoid these problems, the arguments `ngood` and `nbad` of
hypergeometric must be less than 10**9. This constraint obviates an
existing regression test that was run on systems with 64 bit long
integers, so that test was removed.
|
| |/ / / / / / /
|/| | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
empty_like (#13771)
* DOC: Change "random" to "uninitialized" in doctests
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
MAINT: fix 'in' -> 'is' typo
|
| | |_|_|/ / / /
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This is generating a SyntaxWarning.
It looks like it has been like this from
2006 (8869df5b1cba1ffeda6d772eee1a7507fe18bdef) when this first came
into the code base.
|
|\ \ \ \ \ \ \ \
| |_|/ / / / / /
|/| | | | | | | |
DOC: Fixed the problem of "versionadded"
|
| | | | | | | | |
|
| | | | | | | | |
|
| | | | | | | | |
|
| | | | | | | | |
|
|/ / / / / / / |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
BUG: test and fix np.dtype('i,L') #5645
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| |_|/ / / / / /
|/| | | | | | | |
MAINT: fix histogram*d dispatchers
|
| | | | | | | | |
|
| | | | | | | | |
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
fixes GH-13728
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
* Flipped the _masked flag to correctly use Lemire's method as suggested in the comment. See related issue https://github.com/numpy/numpy/issues/13769.
* Updated a selection of the unit tests for Lemire's method as opposed to masked rejection sampling.
* Removed comments and prints used during testing.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
bduvenhage/doc_update/reference_update_for_lemires_method
DOC: Update of reference to paper for Lemire's method
|
| | | | | | | | | |
|
| | |_|_|_|/ / /
| |/| | | | | |
| | | | | | | |
| | | | | | | | |
journal reference as per Lemire's website; same arxiv link.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
BUG: fix compilation of 3rdparty modules with Py_LIMITED_API enabled
|
| | |_|_|_|/ / /
| |/| | | | | |
| | | | | | | |
| | | | | | | | |
There are no macros PyTuple_GET_SIZE and PyTuple_GET_ITEM available when compiling with enabled Py_LIMITED_API.
|
|\ \ \ \ \ \ \ \
| |_|/ / / / / /
|/| | | | | | | |
DEP: Deprecate nonzero(0d) in favor of calling atleast_1d explicitly
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Also indicate that the current behavior in this case is deprecated.
This also removes the advice to use `a[nonzero(a)]` or `transpose(nonzero(a))`, for which there are better spellings.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This is a weird enough corner case that either:
* No one is running into it, and downstream code is broken on 0d arrays anyway
* People already have hacks in place to work around it:
* Calling `nonzero` but handling the result specially if the array was 0d. We want to dissuade this in case we change the result of nonzero to be better in future.
* Not calling `nonzero` at all if the array is zerod (such as by using `atleast1d`). These users are unaffected.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
MAINT: random: Combine ziggurat.h and ziggurat_constants.h
|
|/ / / / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | | |
... and remove the unused arrays that were in ziggurat.h.
|
|\ \ \ \ \ \ \ \
| |_|_|_|_|_|/ /
|/| | | | | | |
| | | | | | | |
| | | | | | | | |
mhvk/disallow-can-cast-of-everything-to-structured
BUG: ensure that casting to/from structured is properly checked.
|
|/ / / / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Allow unsafe casting from a simple data type to a structured one with
multiple fields, but only from structured data type with a single
field (checked recursively) to a simple data type.
For now, continue to allow any structured to structured with
casting="unsafe", as the current can_cast implementation does not
match that of "astype".
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
* update document to use pytest for skipif
* Fix skipif parameter reason
|