[Numpy-discussion] mtrand normal sigma >= 0 too restrictive

Neal Becker ndbecker2 at gmail.com
Thu Apr 3 09:35:26 EDT 2014


Traceback (most recent call last):
  File "./test_inroute_frame.py", line 1694, in <module>
    run_line (sys.argv)
  File "./test_inroute_frame.py", line 1690, in run_line
    return run (opt, cmdline)
  File "./test_inroute_frame.py", line 1115, in run
    burst.tr (xbits, freq=freqs[i]+burst.freq_offset, tau=burst.time_offset, 
phase=burst.phase)
  File "/home/nbecker/hn-inroute-fixed/transmitter.py", line 191, in __call__
    self.channel_out, self.complex_channel_gain = self.channel (mix_out)
  File "./test_inroute_frame.py", line 105, in __call__
    ampl = 10**(0.05*self.pwr_gen())
  File "./test_inroute_frame.py", line 148, in __call__
    pwr = self.gen()
  File "./test_inroute_frame.py", line 124, in __call__
    x = self.gen()
  File "/home/nbecker/sigproc.ndarray/normal.py", line 11, in __call__
    return self.rs.normal (self.mean, self.std, size)
  File "mtrand.pyx", line 1479, in mtrand.RandomState.normal 
(numpy/random/mtrand/mtrand.c:9359)
ValueError: scale <= 0

I believe this restriction is too restrictive, and should be
scale < 0

There is nothing wrong with scale == 0 as far as I know.  It's a convenient way
to turn off the noise in my simulation.




More information about the NumPy-Discussion mailing list