def __init__(self, M1, qmin=<NUM_LIT:0.1>, qmax=<NUM_LIT:1>, Pmin=<NUM_LIT:0.5>, Pmax=<NUM_LIT>, N=<NUM_LIT>, logP=True, eccfn=None):
M1s = np.ones(N)*M1<EOL>M2s = (rand.random(size=N)*(qmax-qmin) + qmin)*M1s<EOL>if logP:<EOL><INDENT>Ps = <NUM_LIT:10>**(rand.random(size=N)*((np.log10(Pmax) - np.log10(Pmin))) + np.log10(Pmin))<EOL><DEDENT>else:<EOL><INDENT>Ps = rand.random(size=N)*(Pmax - Pmin) + Pmin<EOL><DEDENT>if eccfn is None:<EOL><INDENT>eccs = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>eccs = eccfn(Ps)<EOL><DEDENT>self.eccfn = eccfn<EOL>OrbitPopulation.__init__(self,M1s,M2s,Ps,ecc=eccs)<EOL>
A grid of companions to primary, in mass ratio and period space.

        Parameters
        ----------
        M1 : float
            Primary mass (solar masses)

        qmin,qmax : float, optional
            Minimum and maximum mass ratios.

        Pmin,Pmax : float, optional
            Min/max periods in days.

        N : int, optional
            Total number of simulations.

        logP : bool, optional
            Whether to grid in log-period.  If ``False``, then linear.

        eccfn : callable, or ``None``, optional
            Function that returns eccentricity as a function of period.