class_docstr: Stats for Y = q * round(X / q) where X ~ U(low, high).
  
      
class_docstr_tok: ["Stats","for","Y","=","q","*","round","(","X","\/","q",")","where","X","~","U","(","low",",","high",")","."]
code: def __init__(self, low, high, q):
      low, high, q = list(map(float, (low, high, q)))
      qlow = np.round(old_div(low, q)) * q
      qhigh = np.round(old_div(high, q)) * q
      if qlow == qhigh:
          xs = [qlow]
          ps = [1.0]
      else:
          lowmass = 1 - (old_div((low - qlow + 0.5 * q), q))
          assert 0 <= lowmass <= 1.0, (lowmass, low, qlow, q)
          highmass = old_div((high - qhigh + 0.5 * q), q)
          assert 0 <= highmass <= 1.0, (highmass, high, qhigh, q)
          # -- xs: qlow to qhigh inclusive
          xs = np.arange(qlow, qhigh + 0.5 * q, q)
          ps = np.ones(len(xs))
          ps[0] = lowmass
          ps[-1] = highmass
          ps /= ps.sum()
  
      self.low = low
      self.high = high
      self.q = q
      self.qlow = qlow
      self.qhigh = qhigh
      self.xs = np.asarray(xs)
      self.ps = np.asarray(ps)
  
imports: from __future__ import division
  from builtins import map
  from builtins import object
  from past.utils import old_div
  import numpy
  import numpy.random
  import scipy.stats
  from scipy.stats import rv_continuous
  from scipy.stats._continuous_distns import lognorm_gen
label_desc: Use image node_id 1 to create a new quniform_gen object from inherited base classes: object with example: obj = quniform_gen(low, high, q)