| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Inheriting from object was necessary for Python 2 compatibility to use
new-style classes. In Python 3, this is unnecessary as there are no
old-style classes.
Dropping the object is more idiomatic Python.
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
|
|
|
| |
Relates to gh-6103
|
|\
| |
| |
| |
| | |
ENH: randomgen
This merges randomgen into numpy, which was originally developed at https://github.com/bashtage/randomgen and provides a new and improved API for random number generation with much new and improved functionality.
|
| |
| |
| |
| |
| |
| | |
Pep8 fixes
Remove unused imports
Fix name error
|
| |
| |
| |
| | |
Change renamed attribute
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
remove numpy.random.gen, BRNG.generator, pcg*, rand, randn
remove use_mask and Lemire's method, fix benchmarks for PCG removal
convert brng to bitgen (in C) and bit_generator (in python)
convert base R{NG,andom.*} to BitGenerator, fix last commit
randint -> integers, remove rand, randn, random_integers
RandomGenerator -> Generator, more "basic RNG" -> BitGenerator
random_sample -> random, jump -> jumped, resync with randomgen
Remove derived code from entropy
Port over changes accepted in upstream to protect log(0.0) where relevant
fix doctests for jumped, better document choice
Remove Python 2.7 shims
Use NPY_INLINE to simplify
Fix performance.py to work
Renam directory brng to bit_generators
Fix examples wiht new directory structure
Clarify relationship to historical RandomState
Remove references to .generator
Rename xoshiro256/512starstar
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, a field specified as `[(name, dtype, 1)]` is interpreted as
a scalar field (i.e., the same as `[(name, dtype)]` or `[(name, dtype,
()]`). This now raises a FutureWarning; in a future version, it will
be interpreted as a shape-(1,) field, i.e. the same as `[(name, dtype,
(1,))]` (consistently with `[(name, dtype, n)]` with `n>1`, which is
already equivalent to `[(name, dtype, (n,)]`).
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
One of this is a small issue exposed by new warnings, the others are
simply adapting our test suit to stricter integer coercion rules
(avoiding float -> int conversions).
The last one is that we assumed pickle protocol 5 would be in 3.8.
It is not yet included in the alpha releases at least.
It seems not necessary for the numpy test suit to check whether
it is available based on the python version so removing that test.
(Also testing if the pickle5 module works seems unnecessary.)
Closes gh-13412
|
|\
| |
| | |
ENH: Cast covariance to double in random mvnormal
|
| |
| |
| |
| |
| |
| |
| | |
Cast the covariance in the multivariate normal to double
so that the interpretation of tol is cleaner.
closes #10839
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Fix Wald Docstring to reflect actual restriction on parameters
Add a test to ensure these are enforced for scalar inputs
|
|/
|
|
|
|
| |
Add a check for NaN probabilities in random.choice
closes #11250
|
|
|
|
|
|
|
| |
Before this fix, np.random.weibull(a=0) often returned inf (and
in theory could have returned 1). It should only return 0.
Closes gh-12371.
|
|\
| |
| | |
BUG: Make `random.shuffle` work on 1-D instances of `ndarray` subclasses
|
| |
| |
| |
| | |
Closes #11442.
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
That function is nose specific and has not worked since `__init__` files
were added to the tests directories.
|
|
|
| |
Found via `codespell`
|
|
|
|
|
|
|
| |
Prevent empty arrays or arrays with more than 1 dimension from being
used to seed RandomState
closes #9832
|
|
|
|
| |
Avoids infinite loop.
|
|
|
|
|
|
| |
Set dfnum restriction to be > 0 as required by noncentral chisquare
closes #6638
|
|
|
|
|
|
|
|
| |
Dirichlet does not validate inputs and hangs when values are zero.
Adds check that values are strictly positive as required by the
distribution.
closes #2089
|
|
|
|
|
|
|
| |
This is the case for x in {int, bool, str, float, complex, object}.
Using the np.{x} version is deceptive as it suggests that there is a
difference. This change doesn't affect any external behaviour. The
`long` type is missing in python 3, so np.long is still useful
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
After #8883 was merged it was noticed that the same problem was
occuring with calls to PyInt_AsLong. Namely that PyErr_Occoured
wasn't being checked if it returned -1 indicating an exception
could have been thrown.
This PR adds those checks as well as a regression test.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was an error in np.random.uniform where if np.random.uniform
were called with a type that throwed exceptions when it was converted
to a float this exception wouldn't be raised.
This bug was due to an issue where PyFloat_AsDouble was called but
no check for PyErr_Occurred was performed after.
This PR fixes the issue by ensuring that Cython will always emit a
call to PyErr_Occurred if PyFloat_AsDouble returns -1.0
Fixes: #8865
|
| |
|
|
|
|
|
|
|
|
| |
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)
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|