from typing import OrderedDict


def get_des_vars_and_qois(discipline):
    """Method to get the relevant design variables and quantities of interest for a specific subsystem.

    :param discipline: name of the discipline (structures, aerodynamics, propulsion)
    :type discipline: basestring
    :return: ordered dictionary with relevant design variables and list of QOIs
    :rtype: tuple
    """
    if discipline == "structures":
        relevant_des_vars = OrderedDict()
        relevant_des_vars["z_sh"] = [0, 3, 4, 5]  # t/c, AR, Lambda, Sref
        relevant_des_vars["z_c"] = [1, 5]  # WE, L
        relevant_des_vars["z_w"] = [2, 3]  # w_WT, w_Theta
        relevant_qois = ["WT", "WF", "Theta"]
    elif discipline == "aerodynamics":
        relevant_des_vars = OrderedDict()
        relevant_des_vars["z_sh"] = [0, 1, 2, 3, 4, 5]  # t/c, h, M, AR, Lambda, Sref
        relevant_des_vars["z_c"] = [2, 3, 4]  # WT, Theta, ESF
        relevant_des_vars["z_w"] = [0, 5]  # w_D, w_L
        relevant_qois = ["L", "D", "fin"]
    elif discipline == "propulsion":
        relevant_des_vars = OrderedDict()
        relevant_des_vars["z_sh"] = [1, 2]  # h, M
        relevant_des_vars["z_c"] = [0]  # D
        relevant_des_vars["z_w"] = [1, 4]  # w_WE, w_ESF
        relevant_qois = ["WE", "ESF", "SFC"]
    else:
        raise IOError("Invalid discipline {} specified.".format(discipline))
    return relevant_des_vars, relevant_qois