code: def _get_fault_rates(self, source, mmin, mmax=np.inf):
          
          for rupt in list(source.iter_ruptures()):
              valid_rupt = (rupt.mag >= mmin) and (rupt.mag < mmax)
              if not valid_rupt:
                  continue
              grd = np.column_stack([rupt.surface.mesh.lons.flatten(),
                                     rupt.surface.mesh.lats.flatten(),
                                     rupt.surface.mesh.depths.flatten()])
              npts = np.shape(grd)[0]
              counter = np.histogramdd(grd,
                                       bins=[self.xlim, self.ylim, self.zlim]
                                       )[0]
              point_rate = rupt.occurrence_rate / float(npts)
              self.rates += (point_rate * counter)
docs: Adds the rates for a simple or complex fault source
  
          :param source:
              Fault source as instance of :class:
              openquake.hazardlib.source.simple_fault.SimpleFaultSource or
              openquake.hazardlib.source.complex_fault.ComplexFaultSource