code: def equivalent_diameter(target, throat_area='throat.area',
                          throat_shape='circle'):
      r
      area = target[throat_area]
      if throat_shape.startswith('circ'):
          value = 2*_np.sqrt(area/_np.pi)
      elif throat_shape.startswith('square'):
          value = _np.sqrt(area)
      return value
docs: r"""
      Calculates the diameter of a cirlce or edge-length of a sqaure with same
      area as the throat.
  
      Parameters
      ----------
      target : OpenPNM Object
          The object which this model is associated with. This controls the
          length of the calculated array, and also provides access to other
          necessary properties.
  
      thorat_area : string
          The dictionary key to the throat area values
  
      throat_shape : string
          The shape cross-sectional shape of the throat to assume when
          back-calculating from the area.  Options are 'circle' (default) or
          'square'.