code: def get_percolation_threshold(self):
          r
          if np.sum(self['pore.inlets']) == 0:
              raise Exception('Inlet pores must be specified first')
          if np.sum(self['pore.outlets']) == 0:
              raise Exception('Outlet pores must be specified first')
          else:
              Pout = self['pore.outlets']
          # Do a simple check of pressures on the outlet pores first...
          if self.settings['access_limited']:
              thresh = np.amin(self['pore.invasion_pressure'][Pout])
          else:
              raise Exception('This is currently only implemented for access ' +
                              'limited simulations')
          return thresh
docs: r"""
          Find the invasion threshold at which a cluster spans from the inlet to
          the outlet sites