| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| |
| | |
TST: accept small error in threaded random test
|
| | |
| |
| |
| |
| |
| |
| | |
freebsd and windows change x87 precision mode (fctrl bit 8 and 9) from
extended to double in child threads so the random numbers cannot be
exactly the same from master and child threads.
see gh-4909
|
| |\ \
| | |
| | |
| | | |
Pep8 numpy random
|
| | | |
| | |
| | |
| | |
| | | |
This is in numpy/random/mtrand/mtrand.pyx where the choice function
was using comparisons of the form `None != p`.
|
| | |/ |
|
| |/
|
|
| |
closes gh-4526
|
| |
|
|
| |
-- Addresses https://github.com/numpy/numpy/issues/4763
|
| |
|
|
|
|
|
| |
rho results in 0. for kappa < 1.4e-8 whch leads to nans appearing and an
infinite loop.
the second order taylor expansion is more precise up to at least 1e-5.
Closes gh-4720
|
| |
|
|
|
|
| |
mtrand accepts seeds larger than 32 bit but silently truncates them back
to 32 bit. This can lead to accidentally getting the same random stream
for two different seeds, e.g. 1 and 1 + 2**40.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The random module currently relies on the GIL for the state
synchronization which hampers threading performance.
Instead add a lock to the RandomState object and take it for all
operations calling into randomkit while releasing the GIL.
This allows parallizing random number generation using multiple states
or asynchronous generation in a worker thread.
Note that with a large number of threads the standard mersenne twister
used may exhibit overlap if the number of parallel streams is large
compared to the size of the state space, though due to the limited
scalability of Python in regards to threads this is likely not a big
issue.
|
| |\
| |
| | |
DOC: standardize "size" arg description in random module docstrings
|
| | |
| |
| |
| |
| |
| | |
random module
there were many different versions for no good reason
|
| |/ |
|
| | |
|
| |
|
|
|
|
|
| |
Instead generate at build time. The generated sources are still part of
the sdist.
tools/cythonize.py is copied from SciPy with small changes to the
configuration.
|
| |
|
|
| |
Adds check with np.isnan(p) and raises ValueError if check is positive.
|
| |
|
|
|
|
|
|
| |
Explicitly Test that the default shape does not raise a
DeprecationWarning.
Check that a covariance matrix that is not positive-semidefinite
raises a RuntimeWarning.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
numpy.random.multivariate_normal uses SVD to obtain the covariance
square root, but the result will be incorrect if the covariance is not
positive-semidefinite and no warning will be given. However, a check can
be made even while using the SVD by checking if the rows of u.T and v
have the same sign, where u and v are given by u, d, v = svd(a).
A deprecation warning is also fixed. When the default size was used an
empty list was passed to multiply.reduce, which resulted in a default
float 1. for a shape index. That is no longer legal. The problem is
fixed by using an array reshape, which also avoids potential overflow in
the original computation.
Closes #4489.
|
| |
|
| |
np.random.permutation returns an array, which can be sliced.
|
| |
|
|
| |
Closes gh-3173
|
| |
|
|
|
| |
closes gh-4270 and gh-3263
also regenerate with cython 0.20.1
|
| |\
| |
| | |
improve random.choice performance and regen with cython 0.20
|
| | |
| |
| |
| | |
Fixed warning is "Non-trivial type declarators in shared declaration".
|
| | |
| |
| |
| |
| | |
Use kahan_sum as multinomial does.
Closes gh-4188
|
| |/ |
|
| |
|
|
|
| |
randomkit.c uses fopen which requires LFS mode to support larger than 64
bit files on 32 bit systems.
|
| |
|
|
|
|
|
| |
This caused slowness and wrong/potentially wrong results
when the binomial result is larger then a native C int.
Closes gh-3352
|
| | |
|
| |
|
| |
In the PDF used for the example plot of the Laplace distribution only the location parameter loc instead of the absolute difference between random variable and loc was divided by the scale parameter. For the example at hand this makes no difference as loc is 0 and lambda is 1. For different values, however, the plot makes no sense.
|
| | |
|
| |
|
|
|
|
|
| |
Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long
and will need to be broken at some point. OTOH, some lines were already
too long and need to be broken at some point. Now seems as good a time
as any to do this with open PRs at a minimum.
|
| |
|
|
| |
Now is as good a time as any with open PR's at a low.
|
| |
|
|
| |
Preparatory to 1.8.0 branch.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
WarningManager was a workaround for the lack of the with statement
in Python versions < 2.6. As those versions are no longer supported
it can be removed.
Deprecation notes are added to WarningManager and WarningMessage, but
to avoid a cascade of messages in third party apps, no warnings are
raised at this time, that can be done later.
Closes #3519.
|
| |
|
|
|
|
| |
Range test for n was incorrect.
Closes #3480
|
| |
|
|
|
| |
Also edited the 'Parameters' section of the docstring to comply
with the numpy docstring standard.
|
| |\
| |
| | |
Deprecate non integer arguments
|
| | |
| |
| |
| | |
Also minor changes in the documentation.
|
| | |
| |
| |
| | |
Following deprecations would cause problems otherwise.
|
| | |
| |
| |
| | |
See doc/TESTS.rst.txt for the reason.
|
| | |
| |
| |
| | |
Ensure that the multivariate_normal size argument can be a numpy integer. Add regression test. Apply PEP8 to test_regression.py. Regenerate mtrand.c.
|
| | |
| |
| | |
See doc/TESTS.rst.txt for the reason.
|
| |/
|
| |
There are two test functions named `test_hypergeometric_range`
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The numliterals fixer replaces the old style octal number like '01' by
'0o1' removes the 'L' suffix.
Octal values were previously mistakenly specified in some dates, those
uses have been corrected by removing the leading zeros.
Simply Removing the 'L' suffix should not be a problem, but in some
testing code it looks neccesary, so in those places the Python long
constructor is used instead.
The 'long' type is no longer defined in Python 3. Because we need to
have it defined for Python 2 it is added to numpy/compat/np3k.py where
it is defined as 'int' for Python 3 and 'long' for Python 2. The `long`
fixer then needs to be skipped so that it doesn't undo the good work.
Closes #3074, #3067.
|
| |
|
|
|
|
|
| |
Add `print_function` to all `from __future__ import ...` statements
and use the python3 print function syntax everywhere.
Closes #3078.
|
| |\
| |
| | |
DOC: Formatting fixes using regex
|
| | |
| |
| |
| | |
also other spacing or formatting mistakes
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new import `absolute_import` is added the `from __future__ import`
statement and The 2to3 `import` fixer is run to make the imports
compatible. There are several things that need to be dealt with to make
this work.
1) Files meant to be run as scripts run in a different environment than
files imported as part of a package, and so changes to those files need
to be skipped. The affected script files are:
* all setup.py files
* numpy/core/code_generators/generate_umath.py
* numpy/core/code_generators/generate_numpy_api.py
* numpy/core/code_generators/generate_ufunc_api.py
2) Some imported modules are not available as they are created during
the build process and consequently 2to3 is unable to handle them
correctly. Files that import those modules need a bit of extra work.
The affected files are:
* core/__init__.py,
* core/numeric.py,
* core/_internal.py,
* core/arrayprint.py,
* core/fromnumeric.py,
* numpy/__init__.py,
* lib/npyio.py,
* lib/function_base.py,
* fft/fftpack.py,
* random/__init__.py
Closes #3172
|
| |\
| |
| | |
BUG: fix random.choice scalar object result and disallow 0-d arrays
|