def input_float(prompt, allow_empty=False):
    """
    Read a float from the console, showing the given prompt.

    prompt: The prompt message.
    allow_empty: When `True`, allows an empty input. The default is to repeat
      until a valid float is entered.
    """
    from plumbum.cli import terminal
    if allow_empty:
        return terminal.prompt(prompt, type=float, default=None)
    else:
        return terminal.prompt(prompt, type=float)
