code: def minimum_inclination(P,M1,M2,R1,R2):
      
      P,M1,M2,R1,R2 = (np.atleast_1d(P),
                       np.atleast_1d(M1),
                       np.atleast_1d(M2),
                       np.atleast_1d(R1),
                       np.atleast_1d(R2))
      semimajors = semimajor(P,M1+M2)
      rads = ((R1+R2)*RSUN/(semimajors*AU))
      ok = (~np.isnan(rads) & ~withinroche(semimajors,M1,R1,M2,R2))
      if ok.sum() == 0:
          logging.error('P: {}'.format(P))
          logging.error('M1: {}'.format(M1))
          logging.error('M2: {}'.format(M2))
          logging.error('R1: {}'.format(R1))
          logging.error('R2: {}'.format(R2))
          if np.all(withinroche(semimajors,M1,R1,M2,R2)):
              raise AllWithinRocheError('All simulated systems within Roche lobe')
          else:
              raise EmptyPopulationError('no valid systems! (see above)')
      mininc = np.arccos(rads[ok].max())*180/np.pi
      return mininc
docs: Returns the minimum inclination at which two bodies from two given sets eclipse
  
      Only counts systems not within each other's Roche radius
      
      :param P:
          Orbital periods.
  
      :param M1,M2,R1,R2:
          Masses and radii of primary and secondary stars.