summaryrefslogtreecommitdiff
path: root/numpy/random
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #22779 from LeonaTaric/numpy_issue22745Charles Harris2023-01-091-0/+2
|\ | | | | DOC: All integer values must be non-negative
| * 去掉noteLeonaTaric2023-01-091-3/+2
| |
| * change note toLeonaTaric2022-12-161-2/+2
| | | | | | | | "All integer values must be non-negative"
| * All entropy/seed not None must be non-negativeLeonaTaric2022-12-131-0/+3
| |
* | DOC: Update docstring of `multivariate_normal` (#22938)Malte Londschien2023-01-071-2/+8
|/ | | | | Make a note on results depending on system due. Closes gh-22919
* DOC: Add random generator exponential example (#22284)lzha972022-12-102-0/+32
| | | | | | | | | | | * DOC: add examples for random generator exponential function (Issue #22270) * DOC: fix doc test for random exponential generator example (Issue #22270) * DOC: fix formatting on np.random.exponential example (Issue: #22270) * DOC: fix test and problem context on np.random.exponential example (Issue: #22270) * DOC: use may vary instead of will vary for exponential example (Issue: #22270)
* DOC: Fix doc `numpy.<exception>` to `numpy.exceptions.<exception>`Sebastian Berg2022-12-061-1/+1
|
* Merge pull request #22713 from seberg/numba-systemerrorCharles Harris2022-12-021-1/+2
|\ | | | | TST: Skip when numba/numpy compat issues cause SystemError
| * TST: Skip when numba/numpy compat issues cause SystemErrorSebastian Berg2022-12-021-1/+2
| | | | | | | | | | | | | | | | numba is a bit buggy when wrapping ufuncs, so what should be nothing is (on non dev versions) a SystemError and not even an ImportError. So simply catch those too, since it can be a confusing error during dev otherwise.
* | Merge pull request #22619 from seberg/move-set_moduleMatti Picus2022-11-291-1/+1
|\ \ | | | | | | MAINT: Move set_module from numpy.core to numpy._utils
| * | MAINT: Move _inspect and _pep440 from compat to _utilsSebastian Berg2022-11-251-1/+1
| |/ | | | | | | | | Note that unfortunately, compat does expose _inspect as well, so the import remains (just the definition place moves).
* | Merge pull request #22663 from rgommers/build-with-mesonRalf Gommers2022-11-271-0/+164
|\ \ | | | | | | | | | | | | BLD: enable building NumPy with Meson [ci skip]
| * | BLD: enable building NumPy with MesonRalf Gommers2022-11-251-0/+164
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables building with NumPy on Linux and macOS. Windows support should be complete to, but is untested as of now and may need a few tweaks. This contains: - A set of `meson.build` files and related code generation script tweaks, header templates, etc. - One CI job on Linux - Basic docs on using Meson to build NumPy (not yet integrated in the html docs, it's too early for that - this is for early adopters right now). The build should be complete, with the major exception of SIMD support. The full test suite passes. See gh-22546 for the tracking issue with detailed notes on the plan for switching NumPy to Meson as its build system. Co-authored-by: Stefan van der Walt <stefanv@berkeley.edu>
* | MAINT: replace `NPY_INLINE` with `inline`Ralf Gommers2022-11-258-59/+59
|/ | | | Closes gh-22100
* TST: Skip tests that are not currently supported in wasmHood Chatham2022-11-114-3/+10
|
* TST,MAINT: Replace most `setup` with `setup_method` (also teardown)Sebastian Berg2022-10-273-16/+16
| | | | | | | | In some cases, the replacement is clearly not what is intended, in those (where setup was called explicitly), I mostly renamed `setup` to `_setup`. The `test_ccompile_opt` is a bit confusing, so left it right now (this will probably fail)
* Merge pull request #22450 from seberg/logseries-boundsCharles Harris2022-10-246-19/+46
|\ | | | | BUG: Fix boundschecking for random.logseries
| * BUG: Fix boundschecking for `random.logseries`Sebastian Berg2022-10-186-19/+46
| | | | | | | | | | | | | | | | Logseries previously did not enforce bounds to be strictly exclusive for the upper bound, where it leads to incorrect behavior. The NOT_NAN check is removed, since it was never used: The current bounded version always excludes NaNs.
* | MAINT: Use Python integers for int to array of uint32 calculationSebastian Berg2022-10-121-4/+4
|/ | | | | | | | | | | The new weak promotion preserves the original type, this makes the `//= 2**32` fail for certain inputs. The alternative would be typing that as `np.int64(2**32)`, but using Python integers seems easier and cleaner. The code was effectively OK before, since the inputs were guaranteed signed (or Python integers) at that point and 2**32 would have been considered like a NumPy `int64`. (Which would be an alternative fix.)
* MAINT: Fix typos found by codespellDimitri Papadopoulos2022-10-071-2/+2
|
* DOC: Update notes with API linkBrigitta Sipőcz2022-09-161-84/+138
|
* DOC: clarify docs that inform that one should use a GeneratorMonika Kubek2022-09-161-42/+42
|
* MAINT: random: remove `get_info` from "extending with Cython" exampleRalf Gommers2022-09-111-6/+9
| | | | xref gh-21431
* BLD: add back stdlib.h include in pcg64.hChristoph Reiter2022-09-111-1/+4
| | | | | | | | | This seems to have been removed by accident in #21887 stdlib.h is required for _rotr64() further down. Fixes: error: call to undeclared function '_rotr64'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
* Merge pull request #22171 from MatteoRaso/bug_fixSebastian Berg2022-09-062-4/+4
|\ | | | | DOC: Note symmetry requirement in `multivariate_normal` error
| * BUG: Made the error and warning messages for ↵Matteo Raso2022-08-242-4/+4
| | | | | | | | | | | | | | | | | | | | numpy.random.multivariate_normal more descriptive (closes #22140) Issue #22140 says that numpy.random.multivariate_normal incorrectly warns that a non-symmetric positive-semidefinite matrix isn't positive-semidefinite. In the replies, there was some ambiguity over whether it was possible for a positive-semidefinite matrix to be non-symmetric, with reliable sources saying that symmetry is a common condition to add but not actually necessary. To solve this problem, two different members of the Numpy organization decided that the warning and error message "covariance is not positive-semidefinite" should be changed to "covariance is not symmetric positive-semidefinite". However, this change was never actually made yet. Since this change only required me to change a few strings instead of actually changing the code, I've decided to skip the CI jobs. [skip ci]
* | TST: Implemented an unused test for np.random.randintMatteo Raso2022-08-251-17/+16
|/ | | | In numpy/random/tests/test_random.py, a class called TestSingleEltArrayInput had a method called test_randint that was commented out, with the instructions to uncomment it once np.random.randint was able to broadcast arguments. Since np.random.randint has been able to broadcast arguments for a while now, I uncommented the test. The only modification I made to the code was fixing a small error, where the author incorrectly tried to call "assert_equal" as a method of the TestSingleEltArrayInput instead of a function that was imported from numpy.testing. I ran runtests.py, and the new test passed.
* DEP: drop support for msvc<=1900 and Interix (#22139)Matti Picus2022-08-191-4/+4
| | | | | [ci skip] Co-authored-by: h-vetinari <h.vetinari@gmx.com>
* DOC: Explain spawn_key a little more.Robert Kern2022-08-121-2/+4
|
* DOC: Correct doc errorsKevin Sheppard2022-08-111-2/+2
| | | | Fix typos and wrap length
* TYP: Import into random moduleKevin Sheppard2022-08-111-0/+2
|
* MAINT: Update typing informationKevin Sheppard2022-08-111-0/+6
|
* ENH: Add the capability to swap the singleton bit generatorKevin Sheppard2022-08-112-15/+171
| | | | | | | Add a new version or seed that supports seeding any bit gen Add set/get_bit_generator as explicity methodds to support swapping closes #21808
* TST: Fix spellingKevin Sheppard2022-07-192-2/+2
|
* BUG/ENH: ALlow bit generators to supply their own ctorKevin Sheppard2022-07-195-29/+61
| | | | | | | Allow bit generators to supply their own constructors to enable Generator objects using arbitrary bit generators to be supported closes #22012
* Merge pull request #21856 from bramton/mainCharles Harris2022-07-101-3/+7
|\ | | | | DOC: Mention uniform in the np.random.Generator.random function.
| * MAINT: Small fixupsCharles Harris2022-07-101-3/+3
| |
| * Links suddenly workingBram2022-07-081-2/+2
| |
| * Forgot backticksBram2022-06-291-1/+1
| |
| * Corrected reference to uniform()Bram2022-06-291-2/+2
| |
| * DOC: Mention uniform in the np.random.Generator.random function.Bram2022-06-271-1/+5
| | | | | | Added a See also section to mention np.random.Generator.uniform.
* | Merge pull request #21887 from matthew-brett/mingw-random-compileCharles Harris2022-07-103-3/+3
|\ \ | | | | | | BLD: Allow GCC compile on mingw-w64-based systems
| * | Allow GCC compile on mingw-w64-based systemsMatthew Brett2022-06-293-3/+3
| | | | | | | | | | | | | | | | | | | | | Macro `__MINGW32__` always defined for Mingw-w64 compilers (32- or 64-bit): https://sourceforge.net/p/predef/wiki/Compilers/
* | | MAINT: random: Annotate default_rng with cython.embedsignaturewarren2022-07-051-0/+1
| | | | | | | | | | | | Closes gh-21910
* | | Fix lib flags for librandomMatthew Brett2022-06-291-22/+12
|/ / | | | | | | | | Add the voltbl fix to librandom. Remove SSE flag for GCC on 32-bit Windows, it's the default.
* | DOC: Fixed minor typo in BitGenerator reference (#21876)Bram2022-06-291-1/+1
|/ | | Co-authored-by: Bram <b.t.ton@saxion.nl>
* DOC: Replace the mathematical notation N(...) with text.warren2022-06-262-9/+17
| | | | | | | | | The meaning of the second argument in the mathematical notation N(mu, b) for the normal distribution is not consistent. In some references it is the variance while in others it is the standard deviation. Let's avoid the ambiguity by not using the notation. Fixes #21296
* MAINT: random: Update to disallowing complex inputs to multivariate_normal.warren2022-06-162-3/+8
| | | | | | | * Disallow both mean and cov from being complex. * Raise a TypeError instead of a NotImplementedError if mean or cov is complex. * Expand and fix the unit test.
* MAINT: random: Disallow complex covariances in multivariate_normalHameer Abbasi2022-06-162-0/+6
| | | | | This commit disallows complex covariances in multivariate_normal as passing them can silently lead to incorrect results.
* DOC: Correct formattingjcusick132022-06-051-1/+1
|