Returns the packing fraction for a number of non-intersecting spheres.

    Parameters
    ----------
    L: float array, shape (d,)
        System lengths.
    n: integer
        Number of spheres.
    R: float
        Sphere radius.

    Returns
    -------
    pf: float
        Fraction of space occupied by the spheres.

def n_to_pf(L, n, R):
    """Returns the packing fraction for a number of non-intersecting spheres.

    Parameters
    ----------
    L: float array, shape (d,)
        System lengths.
    n: integer
        Number of spheres.
    R: float
        Sphere radius.

    Returns
    -------
    pf: float
        Fraction of space occupied by the spheres.
    """
    dim = L.shape[0]
    return (n * sphere_volume(R=R, n=dim)) / np.product(L)