def getData_oeko():
    """retrieve data from MySQL database."""

    ObjData = MSdb("materials")
    oekobau = ObjData.getDataFrame("oeko", Col=",".join(OEKOBAU_COLS))
    ObjData.close()

    oekobau["name"] = oekobau["name"].apply(change_str)

    return(oekobau)
def getData_masea():
    """retrieve data from MySQL database."""

    ObjData = MSdb("materials")
    masea = ObjData.getDataFrame("masea", Col=",".join(MASEA_COLS))
    ObjData.close()

    extra_col = ['n.a', 'n.a', 'n.a', np.nan, np.nan, np.nan, np.nan]
    a = pd.DataFrame({"L": extra_col}).T
    a.columns = masea.columns

    masea = masea.append(a)

    return(masea)
def main():
    from root.MySQL.dbData import MSdb

    ObjData = MSdb("materials")
    masea_cols = ["name", "family", "subfamily",
                  "DenV", "ConducV", "HeatV", "DiffV"]
    masea = ObjData.getDataFrame("masea", Col=",".join(masea_cols))
    ObjData.close()

    masea_single = [("Conductivity", "ConducV")]
    masea_multiple = {"Material": masea_cols[0:3]}

    found_data = masea.loc[getMaterialIndex(
        217, masea, w=10, single=masea_single, multiple=masea_multiple)]
    # masea.ix[getMaterialIndex(
    #     1, masea, single=masea_single, multiple=masea_multiple)]
    print(found_data)