Exemplo n.º 1
0
 def load_times(self, file_dir):
     self.times_file = load_file(file_dir)
     col_idx = [
         list(self.times_file.columns).index(x) for x in self.cols["times"]
     ]
     self.times_file, self.assembly_df, self.cmy_df, self.temp = \
         arrange_df(self.times_file, "times", relevant_col_idx=col_idx)
Exemplo n.º 2
0
 def load_bom(self, file_dir):
     self.bom_file = load_file(file_dir)
     col_idx = [
         list(self.bom_file.columns).index(x) for x in self.cols["bom"]
     ]
     self.bom_file = arrange_df(self.bom_file, "bom", col_idx,
                                self.files_to_be_deleted)
Exemplo n.º 3
0
 def update_bom(self, file_path):
     new_bom = load_file(file_path)
     col_idx = [list(new_bom.columns).index(x) for x in self.cols["bom"]]
     new_bom = arrange_df(new_bom, "bom", col_idx, self.files_to_be_deleted)
     existing_bom_products = self.bom_file.product_no.unique().tolist()
     new_bom_products = new_bom.product_no.unique().tolist()
     self.bom_file.drop(self.bom_file[self.bom_file.product_no.isin([
         x for x in existing_bom_products if x in new_bom_products
     ])].index,
                        inplace=True)
     self.bom_file = pd.concat([self.bom_file, new_bom], ignore_index=True)
     self.reassign_time()
Exemplo n.º 4
0
    def update_times(self, file_path):
        new_times = load_file(file_path)
        col_idx = [
            list(new_times.columns).index(x) for x in self.cols["times"]
        ]
        new_times, new_assembly, new_cmy, new_temp = arrange_df(
            new_times, "times", relevant_col_idx=col_idx)
        existing_times_products = self.times_file.part_no.unique().tolist()
        new_times_products = new_times.part_no.unique().tolist()
        self.times_file.drop(self.times_file[self.times_file.part_no.isin([
            x for x in existing_times_products if x in new_times_products
        ])].index,
                             inplace=True)
        self.times_file = pd.concat([self.times_file, new_times],
                                    ignore_index=True)

        existing_assembly_products = self.assembly_df.part_no.unique().tolist()
        new_assembly_products = new_assembly.part_no.unique().tolist()
        self.assembly_df.drop(self.assembly_df[self.assembly_df.part_no.isin([
            x for x in existing_assembly_products if x in new_assembly_products
        ])].index,
                              inplace=True)
        self.assembly_df = pd.concat([self.assembly_df, new_assembly],
                                     ignore_index=True)

        existing_cmy_products = self.cmy_df.part_no.unique().tolist()
        new_cmy_products = new_cmy.part_no.unique().tolist()
        self.cmy_df.drop(self.cmy_df[self.cmy_df.part_no.isin([
            x for x in existing_cmy_products if x in new_cmy_products
        ])].index,
                         inplace=True)
        self.cmy_df = pd.concat([self.cmy_df, new_cmy], ignore_index=True)

        existing_temp_stations = self.temp.stations_list.unique().tolist()
        new_temp_stations = new_temp.stations_list.unique().tolist()
        self.temp.drop(self.temp[self.temp.stations_list.isin([
            x for x in existing_temp_stations if x in new_temp_stations
        ])].index,
                       inplace=True)
        self.temp = pd.concat([self.temp, new_temp], ignore_index=True)
        self.temp.sort_values(by="stations_list", ascending=True, inplace=True)
        self.reassign_time()
Exemplo n.º 5
0
 def merge_files(self):
     self.merged_file = merge_bom_and_times(self.bom_file, self.times_file)
     self.merged_file = arrange_df(self.merged_file,
                                   "merged",
                                   assembly_df=self.assembly_df)