def __init__(self, job_number): L, FOC, TE = cip.main() self.total = L + FOC + TE self.job_number = job_number self.job_dict = { 100: '207TH STREET STATION', 200: '34TH HERALD SQUARE STATION 6TH AVE (IND)', 300: '34TH HERALD SQUARE STATION BROADWAY (BMT)', 400: 'FLATBUSH AVE STATION', 500: 'CHURCH AVE STATION', 600: 'JAMAICA CENTER PARSONS/ ARCHER STATION', 700: 'SUTPHIN BOULEVARD/ ARCHER AVE STATION' } self.drawings = self.collect_drawings() self.classes = self.collect_classes() ### read job_name from the job_dict dictionary ### self.job_name = self.job_dict[self.job_number] self.conduit_dict = self.generate_conduit_dict() self.cable_types_dict = self.generate_cable_types_dict() self.conduit_df = self.generate_conduit_df() self.cable_types_df = self.generate_cable_types_df()
def troubleshooter1(job_number, conduit_size): output = [] job_name_dict = cip.job_name_dict L, FOC, TE = cip.main() total = L + FOC + TE total_accubid = acc.main() print('\n') print('FOR DATASET OF REAZ BELOW:') for i in range(len(total)): if (total[i].job_name == job_name_dict[job_number]) and (conduit_size in total[i].conduit_dict): reaz = total[i].drawing.strip(' ') print(reaz) output.append(reaz) print('\n') print('FOR DATASET OF ACCUBID BELOW:') for i in range(len(total_accubid)): if (total_accubid[i].job_name == job_name_dict[job_number]) and ( conduit_size in total_accubid[i].conduit_dict): accubid = total_accubid[i].drawing.strip(' ') print(accubid) if accubid not in output: output.append(accubid) print(output) return output
def find_class_from_drawing(drawing_no): L, FOC, TE = cable_inspection.main() total = L + FOC + TE target = 0 for i in range(len(total)): if total[i].drawing.strip(' ') == drawing_no.strip(' '): target = total[i] if target != 0: return target if target == 0: print("This drawing number doesnt exist in REAZ's dataset")
def find_class_from_drawing(drawing_no): L,FOC,TE=cable_inspection.main() total=L+FOC+TE target=0 for i in range (len(total)): if total[i].drawing.strip(' ')==drawing_no.strip(' '): target=total[i] if target!=0: return target if target==0: print('INVALID DRAWING NUMBER, TRY AGAIN') sys.exit()
def main(): L, FOC, TE = cable_inspection.main() # t1 = threading.Thread(target=electrical, args=(L,)) # t2 = threading.Thread(target=communication, args=(TE,)) # t3 = threading.Thread(target=foc, args=(FOC,)) # # t1.start() # t2.start() # t3.start() # # t1.join() # t2.join() # t3.join() electrical(L) communication(TE) foc(FOC) print('all thread completed') print('Three docx created')
def assign_drawing_number(df): drawings_database=[] L,FOC,TE=cip.main() total=L+FOC+TE for i in range (len(total)): if total[i].drawing not in drawings_database: drawings_database.append(total[i].drawing.strip(' ')) accubid_drawings=[None]*len(df) for i in range (len(drawings_database)): for j in range (len(df)): if drawings_database[i] in str(df['Drawing'][j]): accubid_drawings[j]=drawings_database[i] df['Drawing_No']=accubid_drawings columns=df.columns rdf=pd.DataFrame(data=None,columns=['Drawing','Description','Length']) rdf_drawing=[] rdf_conduit=[] rdf_length=[] for i in range (len(df)): if df['Drawing_No'][i]!=None: rdf_drawing.append(df['Drawing_No'][i]) rdf_conduit.append(df['Description'][i]) rdf_length.append(df['Quantity'][i]) rdf['Drawing']=rdf_drawing rdf['Description']=rdf_conduit rdf['Length']=rdf_length return rdf
@author: Reaz """ import cable_inspection as cip job_name_dict = { 100: '207TH STREET STATION', 200: '34TH HERALD SQUARE STATION 6TH AVE (IND)', 300: '34TH HERALD SQUARE STATION BROADWAY (BMT)', 400: 'FLATBUSH AVE STATION', 500: 'CHURCH AVE STATION', 600: 'JAMAICA CENTER PARSONS/ ARCHER STATION', 700: 'SUTPHIN BOULEVARD/ ARCHER AVE STATION' } L, FOC, TE = cip.main() total = L + TE + FOC job_sites = list(job_name_dict.values()) job_classifier = {} for sites in job_sites: job_classifier[sites] = [] for i in range(len(total)): for j in range(len(job_sites)): if total[i].job_name == job_sites[j]: job_classifier[job_sites[j]].append(total[i].drawing) #print (job_classifier) a = job_classifier[job_name_dict[100]]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 19 13:22:12 2020 @author: Reaz """ import pandas as pd import os, re, sys import cable_inspection os.chdir(r'/Users/Reaz/Desktop/TC ELECTRIC LLC/CABLE INSPECTION PROJECT') L, TE, FOC = cable_inspection.main() #df=pd.read_excel('test_data.xlsx') #conduit=list(df['Conduit'] )