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)
 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)
 def update_machine_info(self, file_dir):
     df = load_file(file_dir)
     df[df.columns[0]] = format_machine_names(df, df.columns[0])
     df = concat([
         self.machine_info[~self.machine_info["machine"].
                           isin(df[df.columns[0]].to_list())], df
     ])
     df.reset_index(inplace=True, drop=True)
     self.machine_info = df.copy()
 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()
 def update_machine_info(self, file_path):
     new_machine_df = load_file(file_path)
     existing_machines = self.machine_info.machine.unique().tolist()
     new_machines = new_machine_df.machine.unique().tolist()
     self.machine_info.drop(
         self.machine_info[self.machine_info.machine.isin(
             [x for x in existing_machines if x in new_machines])].index,
         inplace=True)
     self.machine_info = pd.concat([self.machine_info, new_machine_df],
                                   ignore_index=True)
     self.machine_info.sort_values(by="machine",
                                   ascending=True,
                                   inplace=True)
     self.reassign_time()
    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()
 def load_machine_info(self, file_dir):
     self.machine_info = load_file(file_dir)
 def load_files_to_be_deleted(self, file_dir):
     self.files_to_be_deleted = load_file(file_dir)
     self.files_to_be_deleted.Silinecekler = self.files_to_be_deleted.Silinecekler.astype(
         str)
 def update_tbd(self, file_path):
     self.files_to_be_deleted = load_file(file_path)
     self.files_to_be_deleted.Silinecekler = self.files_to_be_deleted.Silinecekler.astype(
         str)
     self.reassign_time()