docs: def generate_trunc_gr_magnitudes(bval, mmin, mmax, nsamples):
      '''
      Generate a random list of magnitudes distributed according to a
      truncated Gutenberg-Richter model
  
      :param float bval:
          b-value
      :param float mmin:
          Minimum Magnitude
      :param float mmax:
          Maximum Magnitude
      :param int nsamples:
          Number of samples
  
      :returns:
          Vector of generated magnitudes
      '''
      sampler = np.random.uniform(0., 1., nsamples)
      beta = bval * np.log(10.)
      return (-1. / beta) * (
          np.log(1. - sampler * (1 - np.exp(-beta * (mmax - mmin))))) + mmin