diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2022-11-15 13:31:47 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 13:31:47 -0600 |
commit | 3ca02ce5b1a4ec2412cad839d42452a4200a5270 (patch) | |
tree | f1777b8defeb5c33bafadf89da770ab14358c0b3 /numpy/random/mtrand.pyx | |
parent | 8cededdf4eeebd4f1985bd74c11fbf44f367937f (diff) | |
parent | e88592e94a0b7de726bc1e3dbf3abf637be47273 (diff) | |
download | numpy-3ca02ce5b1a4ec2412cad839d42452a4200a5270.tar.gz |
Merge pull request #22594 from charris/backport-22450
BUG: Fix boundschecking for `random.logseries`
Diffstat (limited to 'numpy/random/mtrand.pyx')
-rw-r--r-- | numpy/random/mtrand.pyx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/numpy/random/mtrand.pyx b/numpy/random/mtrand.pyx index fcc1f27d2..ae40931d0 100644 --- a/numpy/random/mtrand.pyx +++ b/numpy/random/mtrand.pyx @@ -19,8 +19,8 @@ from ._bounded_integers cimport (_rand_bool, _rand_int32, _rand_int64, from ._mt19937 import MT19937 as _MT19937 from numpy.random cimport bitgen_t from ._common cimport (POISSON_LAM_MAX, CONS_POSITIVE, CONS_NONE, - CONS_NON_NEGATIVE, CONS_BOUNDED_0_1, CONS_BOUNDED_GT_0_1, CONS_GTE_1, - CONS_GT_1, LEGACY_CONS_POISSON, + CONS_NON_NEGATIVE, CONS_BOUNDED_0_1, CONS_BOUNDED_GT_0_1, + CONS_BOUNDED_LT_0_1, CONS_GTE_1, CONS_GT_1, LEGACY_CONS_POISSON, double_fill, cont, kahan_sum, cont_broadcast_3, check_array_constraint, check_constraint, disc, discrete_broadcast_iii, validate_output_shape @@ -3895,7 +3895,7 @@ cdef class RandomState: Draw samples from a logarithmic series distribution. Samples are drawn from a log series distribution with specified - shape parameter, 0 < ``p`` < 1. + shape parameter, 0 <= ``p`` < 1. .. note:: New code should use the ``logseries`` method of a ``default_rng()`` @@ -3904,7 +3904,7 @@ cdef class RandomState: Parameters ---------- p : float or array_like of floats - Shape parameter for the distribution. Must be in the range (0, 1). + Shape parameter for the distribution. Must be in the range [0, 1). size : int or tuple of ints, optional Output shape. If the given shape is, e.g., ``(m, n, k)``, then ``m * n * k`` samples are drawn. If size is ``None`` (default), @@ -3969,7 +3969,7 @@ cdef class RandomState: """ out = disc(&legacy_logseries, &self._bitgen, size, self.lock, 1, 0, - p, 'p', CONS_BOUNDED_0_1, + p, 'p', CONS_BOUNDED_LT_0_1, 0.0, '', CONS_NONE, 0.0, '', CONS_NONE) # Match historical output type |