Пример #1
0
 def get_and_merge_dictionary(self, df):
     dic = dct.Dict(self.p[vmc.filenamedict])
     err = er.ErrorReport(df, dic, self.p[vmc.placement],
                          self.p[vmc.filenameerror])
     dic.auto_functions(err, self.p[vmc.autodicord],
                        self.p[vmc.autodicplace])
     df = dic.merge(df, dctc.FPN)
     return df
Пример #2
0
 def get_dict_order_df(self):
     self.df = self.get_raw_df()
     dic = dct.Dict()
     err = er.ErrorReport(self.df, dic, self.p[vmc.placement],
                          self.p[vmc.filenameerror])
     error = dic.split_error_df(err, self.p[vmc.autodicord],
                                self.p[vmc.autodicplace])
     return error
Пример #3
0
def import_plan_data(key, df, plan_omit_list, **kwargs):
    if df is None or df.empty:
        df = pd.DataFrame(columns=kwargs[vmc.fullplacename] + [vmc.vendorkey])
    df = df.loc[~df[vmc.vendorkey].isin(plan_omit_list)]
    df = df.loc[:, kwargs[vmc.fullplacename]]
    df = full_placement_creation(df, key, dctc.FPN, kwargs[vmc.fullplacename])
    df = df.drop_duplicates()
    dic = dct.Dict(kwargs[vmc.filenamedict])
    df_fpn = pd.DataFrame(df[dctc.FPN])
    er.ErrorReport(df_fpn, dic, None, kwargs[vmc.filenameerror])
    merge_col = list(set(dic.data_dict.columns).intersection(df.columns))
    dic.data_dict = utl.data_to_type(dic.data_dict, str_col=merge_col)
    dic.data_dict = dic.data_dict.merge(df, on=merge_col, how='left')
    dic.apply_functions()
    dic.data_dict = utl.data_to_type(dic.data_dict, date_col=vmc.datadatecol)
    return dic.data_dict