|
45 | 45 |
|
46 | 46 | __all__ = ["Random","seed","random","uniform","randint","choice","sample", |
47 | 47 | "randrange","shuffle","normalvariate","lognormvariate", |
48 | | - "cunifvariate","expovariate","vonmisesvariate","gammavariate", |
49 | | - "stdgamma","gauss","betavariate","paretovariate","weibullvariate", |
| 48 | + "expovariate","vonmisesvariate","gammavariate", |
| 49 | + "gauss","betavariate","paretovariate","weibullvariate", |
50 | 50 | "getstate","setstate","jumpahead"] |
51 | 51 |
|
52 | 52 | NV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0) |
@@ -308,29 +308,6 @@ def lognormvariate(self, mu, sigma): |
308 | 308 | """ |
309 | 309 | return _exp(self.normalvariate(mu, sigma)) |
310 | 310 |
|
311 | | -## -------------------- circular uniform -------------------- |
312 | | - |
313 | | - def cunifvariate(self, mean, arc): |
314 | | - """Circular uniform distribution. |
315 | | -
|
316 | | - mean is the mean angle, and arc is the range of the distribution, |
317 | | - centered around the mean angle. Both values must be expressed in |
318 | | - radians. Returned values range between mean - arc/2 and |
319 | | - mean + arc/2 and are normalized to between 0 and pi. |
320 | | -
|
321 | | - Deprecated in version 2.3. Use: |
322 | | - (mean + arc * (Random.random() - 0.5)) % Math.pi |
323 | | -
|
324 | | - """ |
325 | | - # mean: mean angle (in radians between 0 and pi) |
326 | | - # arc: range of distribution (in radians between 0 and pi) |
327 | | - import warnings |
328 | | - warnings.warn("The cunifvariate function is deprecated; Use (mean " |
329 | | - "+ arc * (Random.random() - 0.5)) % Math.pi instead", |
330 | | - DeprecationWarning) |
331 | | - |
332 | | - return (mean + arc * (self.random() - 0.5)) % _pi |
333 | | - |
334 | 311 | ## -------------------- exponential distribution -------------------- |
335 | 312 |
|
336 | 313 | def expovariate(self, lambd): |
@@ -465,27 +442,6 @@ def gammavariate(self, alpha, beta): |
465 | 442 | break |
466 | 443 | return x * beta |
467 | 444 |
|
468 | | - |
469 | | - def stdgamma(self, alpha, ainv, bbb, ccc): |
470 | | - # This method was (and shall remain) undocumented. |
471 | | - # This method is deprecated |
472 | | - # for the following reasons: |
473 | | - # 1. Returns same as .gammavariate(alpha, 1.0) |
474 | | - # 2. Requires caller to provide 3 extra arguments |
475 | | - # that are functions of alpha anyway |
476 | | - # 3. Can't be used for alpha < 0.5 |
477 | | - |
478 | | - # ainv = sqrt(2 * alpha - 1) |
479 | | - # bbb = alpha - log(4) |
480 | | - # ccc = alpha + ainv |
481 | | - import warnings |
482 | | - warnings.warn("The stdgamma function is deprecated; " |
483 | | - "use gammavariate() instead", |
484 | | - DeprecationWarning) |
485 | | - return self.gammavariate(alpha, 1.0) |
486 | | - |
487 | | - |
488 | | - |
489 | 445 | ## -------------------- Gauss (faster alternative) -------------------- |
490 | 446 |
|
491 | 447 | def gauss(self, mu, sigma): |
@@ -755,7 +711,6 @@ def _test(N=2000): |
755 | 711 | _test_generator(N, 'random()') |
756 | 712 | _test_generator(N, 'normalvariate(0.0, 1.0)') |
757 | 713 | _test_generator(N, 'lognormvariate(0.0, 1.0)') |
758 | | - _test_generator(N, 'cunifvariate(0.0, 1.0)') |
759 | 714 | _test_generator(N, 'vonmisesvariate(0.0, 1.0)') |
760 | 715 | _test_generator(N, 'gammavariate(0.01, 1.0)') |
761 | 716 | _test_generator(N, 'gammavariate(0.1, 1.0)') |
@@ -786,11 +741,9 @@ def _test(N=2000): |
786 | 741 | shuffle = _inst.shuffle |
787 | 742 | normalvariate = _inst.normalvariate |
788 | 743 | lognormvariate = _inst.lognormvariate |
789 | | -cunifvariate = _inst.cunifvariate |
790 | 744 | expovariate = _inst.expovariate |
791 | 745 | vonmisesvariate = _inst.vonmisesvariate |
792 | 746 | gammavariate = _inst.gammavariate |
793 | | -stdgamma = _inst.stdgamma |
794 | 747 | gauss = _inst.gauss |
795 | 748 | betavariate = _inst.betavariate |
796 | 749 | paretovariate = _inst.paretovariate |
|
0 commit comments