| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
|
| |
Since we only need to support python 2, we can remove any case where we just
pass a single string literal and use the b prefix instead.
What we can't do is transform asbytes("tests %d" % num), because %-formatting
fails on bytes in python 3.x < 3.5.
|
|
|
|
|
|
|
|
| |
BUG: fix issue #8250 where np.random.permutation fail.
This reverts commit 7a73bad2d9c04e4f16e87dbed9d7b627327fe814.
Closes #8776.
|
|\
| |
| | |
BUG: fix issue #8250 when np.array gets called on an invalid sequence
|
| |
| |
| |
| | |
called on an invalid sequence.
|
|/
|
|
| |
Unless I am very much mistaken these 'assert_(x,y)' calls should really be 'assert_equal(x,y)'.
|
|
|
|
|
| |
inlined isfinite on i386 does not work for DBL_MAX / 1e17 + DBL_MAX as
with extended precision this is not smaller equal than DBL_MAX.
|
| |
|
| |
|
| |
|
| |
|
|\ |
|
| | |
|
| |
| |
| |
| | |
Also check for invalid bounds when low= and high= are arraylike rather than scalar (closes #8226)
|
| | |
|
| |
| |
| |
| | |
Closes #5813.
|
| |\
| | |
| | | |
BLD: Enable build on AIX
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
declarations
The problem this fix resolves is to ensure that 32-bit and 64-bit functions
(e.g., fclear() and fclear64()) to access/manipulate "large files" are
defined properly - much as GNU and other platforms use one or more of
the defines _FILE_OFFSET_BITS, _LARGEFILE_SOURCE, and _LARGEFILE64_SOURCE.
Without this fix the numpy code only defines flags that are not recognized
in the AIX environment and have no effect in anyway.
The fix applies the AIX convention and does not "export" any of the flags
currently exported. For all other platforms the current flags:
_FILE_OFFSET_BITS, _LARGEFILE_SOURCE, and _LARGEFILE64_SOURCE are "exported".
This fix should not have any impact or side-effect based on the version
of python used.
History:
Starting around 1997 AIX started supporting so-called "large files",
i.e., length > signed 32-bit. In the period 1997-1998 the flag _LARGE_FILES
was established to simplify porting 32-bit applications to 64-bit.
The convention is to define _LARGE_FILES before including any
"system include files" either as an argument to ${CC} (e.g., in ${CFLAGS}
or as the first #define in every source file. This is to ensure that
that no relevant function calls would be redefined later in the build process.
|
| |/ |
|
| |
| |
| |
| |
| | |
Continuation of gh-8071 by removing the duplicate
randint Cython code that is not generated via Tempita.
|
| |
| |
| |
| |
| |
| | |
Refactors the randint helpers to use a Tempita
template. This will reduce technical debt in the
long run.
|
| | |
|
| |
| |
| |
| | |
The strings in error messages were left untouched
|
| |
| |
| |
| |
| |
| |
| |
| | |
In some places, just remove aparently unnecessary filters.
After this, all cases of ignore filters should be removed from
the tests, making testing (even multiple runs) normally fully
predictable.
|
| |\
| | |
| | | |
Allow many distributions to have a scale of 0.
|
| | |
| | |
| | |
| | | |
At least the gamma generator doesn't support it.
|
| | |
| | |
| | |
| | |
| | |
| | | |
(in which case a stream of 0's is usually returned (or 1's)).
See #5818.
|
| | |
| | |
| | |
| | | |
[ci skip]
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
np.random.shuffle will allocate a buffer based on the size of the first
element of an array of strings. If the first element is smaller than
another in the array this buffer will overflow, causing a segfault
when garbage is collected.
Additionally if the array contains objects then one would be left
in the buffer and have it's refcount erroniously decrimented on
function exit, causing that object to be deallocated too early.
To fix this we change the buffer to be an array of int8 of the
the size of the array's dtype, which sidesteps both issues.
Fixes #7710
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The warning turned up when the numpy/randome/tests were run using
$ python runtests.py -t numpy/random/tests/
It doesn't show when all the tests are run.
|
| |/
| |
| |
| |
| |
| | |
Python 2.7 has a backport of PyCapsule so we no longer need to support
PyCObject. This PR makes that change and removes the no longer needed
mt_compat.h file.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
I know int is between 0 and 4294967295, but I think many people that do
not know that will benefit from this comment.
[ci skip]
|
| |\
| | |
| | | |
TST: Fixed elements being shuffled
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since shuffle only works along the first dimension, it must be done before
reshape to get reasonable looking data. Did not affect the current tests. I
noticed while working on some scipy code.
Also, made a couple of doc changes to np.random.shuffle.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
E.g.:
np.random.random_sample() uses the GIL for synchronization
np.random.random_sample(1) releases the GIL and uses a separate lock.
This means that both can run simultaneously, causing a data race when mutating
the random number generator's state, which could lead to buffer overflow (from
incrementing state->pos).
The fix here is to always use the separate lock, so that exactly one thread at
a time is mutating the random number generator's state.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The 'pandas' library expects Python integers to be
returned, so this commit changes the API so that
the default is 'np.int' which converts to native
Python integer types when a singleton is being
generated with this function.
Closes gh-7284.
|
| |
| |
| |
| | |
Closes gh-7203.
|
| | |
|
| |
| |
| |
| | |
Specifically the 'Logarithmic distribution' link is fixed.
For others the links or article names are updated.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Although the arguments are specified as 'high'
and 'low', it is possible to pass in values for
'low' and 'high' where 'low' >= 'high' and still
obtain well-defined behavior. The documentation
has been expanded to reflect this fact, with a
note to discourage passing in arguments satisfying
'low' > 'high'.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes bug in np.random methods that would return scalars
when passed one-element array inputs. This is because
one-element ndarrays can be cast to integers / floats, which
is what functions like PyFloat_AsDouble do before converting
to the intended data type.
This commit changes the check used to determine whether the
inputs are purely scalar by converting all inputs to arrays
and checking if the resulting shape is an empty tuple (scalar)
or not (array).
Closes gh-4263.
|
| |
| |
| |
| |
| |
| |
| | |
Clarified the output size depending on whether
scalar or non-scalar inputs are passed to
functions in mtrand.pyx that can broadcast
their arguments.
|
| |
| |
| |
| |
| |
| | |
Added a whole new suite of tests to ensure that
functions in mtrand.pyx which are broadcastable
actually broadcast their arguments properly.
|
| |
| |
| |
| |
| |
| |
| | |
Refactored methods that broadcast arguments
together by finding additional common ground
between code in the if...else branches that
involved a size parameter being passed in.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Apparently gcc only specializes one branch (the last one) so I went for
another 33% performance increase (matching #6776) in what's likely the
most common use case.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Only for 1d-ndarrays exactly, as subtypes (e.g. masked arrays) may not
allow direct shuffle of the underlying buffer (in fact, the old
implementation destroyed the underlying values of masked arrays while
shuffling).
Also handles struct-containing-object 1d ndarrays properly.
See #6776 for an earlier, less general (but even faster: ~6x)
improvement attempt, #5514 for the original issue.
|