docs: def collapse_branches(self, mmin, bin_width, mmax):
          '''
          Collapse the logic tree branches into a single IncrementalMFD
  
          :param float mmin:
              Minimum magnitude of reference mfd
          :param float bin_width:
              Bin width of reference mfd
          :param float mmax:
              Maximum magnitude of reference mfd
  
          :returns:
              :class: openquake.hmtk.models.IncrementalMFD
          '''
          master_mags = np.arange(mmin, mmax + (bin_width / 2.), bin_width)
          master_rates = np.zeros(len(master_mags), dtype=float)
          for model in self.mfd_models:
              id0 = np.logical_and(
                  master_mags >= np.min(model.magnitudes) - 1E-9,
                  master_mags <= np.max(model.magnitudes) + 1E-9)
              # Use interpolation in log10-y values
  
              yvals = np.log10(model.recurrence.occur_rates)
              interp_y = np.interp(master_mags[id0],
                                   model.magnitudes,
                                   yvals)
              master_rates[id0] = master_rates[id0] + (model.weight *
                                                       10. ** interp_y)
          return IncrementalMFD(mmin, bin_width, master_rates)