#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Generate random names from the numpy RNG"""

import string
import numpy as np


def name(length=6):
    """Generate a random name of length

    We need our random names to be generated by numpy's RNG, or they will be
    different even when taking the same seed so we need to roll our own
    truncated UUID generator to keep track of our cells.

    Parameters
    ----------
    length: int
        number of hex chars in name

    Returns
    -------
    name: str
        random name
    """
    return "".join(np.random.choice([c for c in string.hexdigits], length))
