def valid_tabulated_shape(width, height):
    """Return if the tabulated shape is valid.

    Validating that the strings `width` and `height` contain positive floats
    was previously done using a regex. However, experiments showed that
    trying to split the string and reading in the floats is much faster.

    :param width: string of widths
    :param height: string of heights
    :return: True if the shape if valid
    """
    if width is None or height is None:
        return False
    height_string_list = height.split(' ')
    width_string_list = width.split(' ')
    if len(height_string_list) != len(width_string_list):
        return False
    try:
        first_height = float(height_string_list[0])
        if first_height != 0:
            return False
    except ValueError:
        return False
    previous_height = -1
    for h_string, w_string in zip(height_string_list, width_string_list):
        try:
            h = float(h_string)
            w = float(w_string)
        except ValueError:
            return False
        if h < 0:
            return False
        if w < 0:
            return False
        if h < previous_height:
            return False
        previous_height = h
    return True
