Compare commits
6 Commits
new_sanwei
...
main
| Author | SHA1 | Date |
|---|---|---|
|
|
bba0aec2f4 | |
|
|
86cfb0e582 | |
|
|
b7c62dcf7f | |
|
|
72acc6898a | |
|
|
62a2093a8d | |
|
|
c2d5fc7030 |
Binary file not shown.
Binary file not shown.
66
tools/t7.py
66
tools/t7.py
|
|
@ -186,6 +186,12 @@ class AutoLayout:
|
||||||
self.return_log.append(f'芯片{chipname}有碱基不平衡:\n{desc}')
|
self.return_log.append(f'芯片{chipname}有碱基不平衡:\n{desc}')
|
||||||
print(f'芯片{chipname}有碱基不平衡:\n{desc}')
|
print(f'芯片{chipname}有碱基不平衡:\n{desc}')
|
||||||
|
|
||||||
|
def dec_lib_data_scatter(self, data):
|
||||||
|
"""
|
||||||
|
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def level(row):
|
def level(row):
|
||||||
|
|
||||||
|
|
@ -194,19 +200,19 @@ class AutoLayout:
|
||||||
if 'nextera' in row['classification'].lower():
|
if 'nextera' in row['classification'].lower():
|
||||||
return 1000
|
return 1000
|
||||||
|
|
||||||
if '华大' in row['classification']:
|
if '华大' in row['classification'] and 'NN' in row['i5']:
|
||||||
return 1100
|
return 1100
|
||||||
|
|
||||||
if '超加急' in row['priority']:
|
if '超加急' in str(row['priority']):
|
||||||
return 1500
|
return 1500
|
||||||
|
|
||||||
if row['拆分方式'] == '极致周期' or '极致' in row['拆分方式']:
|
if row['拆分方式'] == '极致周期' or '极致' in row['拆分方式']:
|
||||||
return 2000
|
return 2000
|
||||||
|
|
||||||
if '加急' in row['priority']:
|
if '加急' in str(row['priority']):
|
||||||
return 3000
|
return 3000
|
||||||
|
|
||||||
if '补测' in row['priority']:
|
if '补测' in str(row['priority']):
|
||||||
return 4000
|
return 4000
|
||||||
|
|
||||||
mytime = row['time']
|
mytime = row['time']
|
||||||
|
|
@ -221,21 +227,6 @@ class AutoLayout:
|
||||||
"""
|
"""
|
||||||
barcode 有重复的极致样本 进行排列组合,汇集成新的可能性
|
barcode 有重复的极致样本 进行排列组合,汇集成新的可能性
|
||||||
"""
|
"""
|
||||||
# 筛选有重复的行
|
|
||||||
|
|
||||||
# same_barcode_data = [data for data in self.ori_lib_data if data['level'] == 1900]
|
|
||||||
# same_barcode_sorted = sorted(same_barcode_data, key=lambda x: (-x['size']))
|
|
||||||
#
|
|
||||||
# same_barcode_dict = dict()
|
|
||||||
# for index, data in enumerate(same_barcode_sorted):
|
|
||||||
# same_barcode_dict[data['library']] = data['level'] + index + 1
|
|
||||||
# correct_data = list()
|
|
||||||
# for data in self.ori_lib_data:
|
|
||||||
# if data in same_barcode_sorted:
|
|
||||||
# data['level'] = same_barcode_dict[data['library']]
|
|
||||||
# correct_data.append(data)
|
|
||||||
# self.ori_lib_data = correct_data
|
|
||||||
|
|
||||||
same_barcode_df = pd.DataFrame(
|
same_barcode_df = pd.DataFrame(
|
||||||
[spdata for data in self.ori_lib_data if data['level'] == 1900 for spdata in data['data']])
|
[spdata for data in self.ori_lib_data if data['level'] == 1900 for spdata in data['data']])
|
||||||
|
|
||||||
|
|
@ -323,13 +314,17 @@ class AutoLayout:
|
||||||
# print(library_data['data'][0]['barcode'])
|
# print(library_data['data'][0]['barcode'])
|
||||||
self.chip_size_N[chipname] += library_data['size']
|
self.chip_size_N[chipname] += library_data['size']
|
||||||
|
|
||||||
def use_rule(self, chipname, classfication):
|
def use_rule_exclusive_classfication(self, chipname, classfication):
|
||||||
|
"""
|
||||||
|
文库不能排在一起
|
||||||
|
"""
|
||||||
may_classfic = set(self.rule[self.rule['c1'] == classfication]['c2'])
|
may_classfic = set(self.rule[self.rule['c1'] == classfication]['c2'])
|
||||||
if self.chip_customer[chipname].intersection(may_classfic):
|
if self.chip_customer[chipname].intersection(may_classfic):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def use_rule_exclusive_customer(self, chipname, customer):
|
def use_rule_exclusive_customer(self, chipname, customer):
|
||||||
|
"""文库不能排在一起"""
|
||||||
may_classfic = set(
|
may_classfic = set(
|
||||||
self.rule_exclusive_customer[self.rule_exclusive_customer['customer1'] == customer]['customer2'])
|
self.rule_exclusive_customer[self.rule_exclusive_customer['customer1'] == customer]['customer2'])
|
||||||
if self.chip_customer[chipname].intersection(may_classfic):
|
if self.chip_customer[chipname].intersection(may_classfic):
|
||||||
|
|
@ -347,7 +342,7 @@ class AutoLayout:
|
||||||
classification = library_data['classification']
|
classification = library_data['classification']
|
||||||
customer = library_data['customer']
|
customer = library_data['customer']
|
||||||
is_balance_lib = library_data['is_balance_lib']
|
is_balance_lib = library_data['is_balance_lib']
|
||||||
library = library_data['library']
|
# library = library_data['library']
|
||||||
|
|
||||||
# 芯片大小不能超过设定限制
|
# 芯片大小不能超过设定限制
|
||||||
sizelimit = True
|
sizelimit = True
|
||||||
|
|
@ -367,7 +362,7 @@ class AutoLayout:
|
||||||
|
|
||||||
# 互斥的文库
|
# 互斥的文库
|
||||||
exclusive_classific = True
|
exclusive_classific = True
|
||||||
if self.use_rule(chipname, classification):
|
if self.use_rule_exclusive_classfication(chipname, classification):
|
||||||
exclusive_classific = False
|
exclusive_classific = False
|
||||||
# print(chipname, library, '互斥的文库')
|
# print(chipname, library, '互斥的文库')
|
||||||
|
|
||||||
|
|
@ -500,7 +495,6 @@ class AutoLayout:
|
||||||
self.loc_chip_num += 1
|
self.loc_chip_num += 1
|
||||||
|
|
||||||
def assign_samples(self):
|
def assign_samples(self):
|
||||||
# ori_library_data = list()
|
|
||||||
|
|
||||||
if '未测' not in self.ori_data.keys():
|
if '未测' not in self.ori_data.keys():
|
||||||
raise UserWarning('提供excel没有 未测 sheet ,请核查!')
|
raise UserWarning('提供excel没有 未测 sheet ,请核查!')
|
||||||
|
|
@ -532,20 +526,25 @@ class AutoLayout:
|
||||||
|
|
||||||
no_ori_data = ori_library_df[~(numeric_mask & time_mask) | status_mask | barcode_mask]
|
no_ori_data = ori_library_df[~(numeric_mask & time_mask) | status_mask | barcode_mask]
|
||||||
|
|
||||||
|
# 某个客户的检测的数据超过1个T就单独处理
|
||||||
|
summary = ori_library_df.groupby('customer').agg({'data_needed': 'sum'})
|
||||||
|
summary_dict = summary['data_needed'].to_dict()
|
||||||
|
for customer_sum, data_needed_sum in summary_dict.items():
|
||||||
|
if not data_needed_sum:
|
||||||
|
continue
|
||||||
|
if float(data_needed_sum) > 2000 :
|
||||||
|
self.return_log.append(f'客户 {customer_sum} 本次排样超过 2000G 建议包lane 处理')
|
||||||
|
|
||||||
self.no_assign_data.extend(no_ori_data.to_dict('records'))
|
self.no_assign_data.extend(no_ori_data.to_dict('records'))
|
||||||
|
|
||||||
# 使用布尔索引筛选出不是数字和非日期的行,并且不是暂不排样的行
|
# 使用布尔索引筛选出不是数字和非日期的行,并且不是暂不排样的行, 以及非16位置barcode
|
||||||
ori_library_df = ori_library_df[(numeric_mask & time_mask) & ~status_mask & ~barcode_mask]
|
ori_library_df = ori_library_df[(numeric_mask & time_mask) & ~status_mask & ~barcode_mask]
|
||||||
|
|
||||||
# 某个客户的检测的数据超过1个T就单独处理
|
|
||||||
# summary = ori_library_df.groupby('customer').agg({'data_needed': 'sum'})
|
|
||||||
# print(summary)
|
|
||||||
|
|
||||||
# 时间格式化
|
# 时间格式化
|
||||||
ori_library_df['time'] = pd.to_datetime(ori_library_df['time'], errors='coerce')
|
ori_library_df['time'] = pd.to_datetime(ori_library_df['time'], errors='coerce')
|
||||||
ori_library_df['level'] = ori_library_df.apply(self.level, axis=1)
|
ori_library_df['level'] = ori_library_df.apply(self.level, axis=1)
|
||||||
|
|
||||||
# 极致客户有重复的,把等级调到19,防止放到了最后,到了未测里
|
# 极致客户有重复的,把等级调到1900,防止放到了最后,到了未测里
|
||||||
must_lib_df = ori_library_df[ori_library_df['level'] == 2000]
|
must_lib_df = ori_library_df[ori_library_df['level'] == 2000]
|
||||||
must_lib = set(must_lib_df[must_lib_df.duplicated(subset='barcode', keep=False)]['#library'].to_list())
|
must_lib = set(must_lib_df[must_lib_df.duplicated(subset='barcode', keep=False)]['#library'].to_list())
|
||||||
ori_library_df.loc[ori_library_df['#library'].isin(must_lib), 'level'] = 1900
|
ori_library_df.loc[ori_library_df['#library'].isin(must_lib), 'level'] = 1900
|
||||||
|
|
@ -586,7 +585,7 @@ class AutoLayout:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# 拆分处理 分为了2个大文库
|
# 拆分处理 分为了2个大文库
|
||||||
if size > (self.data_limit) / 2:
|
if size > self.data_limit / 2:
|
||||||
library_df['data_needed'] = library_df['data_needed'] / 2
|
library_df['data_needed'] = library_df['data_needed'] / 2
|
||||||
self.return_log.append(f'文库{library} 已做拆分处理, 请注意!!! ')
|
self.return_log.append(f'文库{library} 已做拆分处理, 请注意!!! ')
|
||||||
self.ori_lib_data.append(dict(
|
self.ori_lib_data.append(dict(
|
||||||
|
|
@ -685,7 +684,7 @@ class AutoLayout:
|
||||||
self.loc_chip_num = 100
|
self.loc_chip_num = 100
|
||||||
while ori_lib_data:
|
while ori_lib_data:
|
||||||
library_data = ori_lib_data[0]
|
library_data = ori_lib_data[0]
|
||||||
chipname = f'chipB{self.loc_chip_num}_{max_barcode}' if max_barcode != 'all' else f'chipB{self.loc_chip_num}'
|
chipname = f'chip{self.loc_chip_num}_{max_barcode}' if max_barcode != 'all' else f'chip{self.loc_chip_num}'
|
||||||
|
|
||||||
# 空白芯片直接添加
|
# 空白芯片直接添加
|
||||||
if chipname not in self.index_assignments:
|
if chipname not in self.index_assignments:
|
||||||
|
|
@ -720,7 +719,6 @@ class AutoLayout:
|
||||||
self.assign_again_size()
|
self.assign_again_size()
|
||||||
# self.assign_again_size(max_barcode='i7')
|
# self.assign_again_size(max_barcode='i7')
|
||||||
# self.assign_again_size(max_barcode='i5')
|
# self.assign_again_size(max_barcode='i5')
|
||||||
# self.assign_again_size()
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.return_log.append(f'T7排样出错, 请联系!{e}')
|
self.return_log.append(f'T7排样出错, 请联系!{e}')
|
||||||
self.index_assignments = {}
|
self.index_assignments = {}
|
||||||
|
|
@ -740,6 +738,7 @@ class AutoLayout:
|
||||||
addname = 'X'
|
addname = 'X'
|
||||||
else:
|
else:
|
||||||
addname = ''
|
addname = ''
|
||||||
|
|
||||||
other_name = ''
|
other_name = ''
|
||||||
# if 'chipB' in chip_idx and df['barcode'].duplicated().any():
|
# if 'chipB' in chip_idx and df['barcode'].duplicated().any():
|
||||||
# other_name = '_i7'
|
# other_name = '_i7'
|
||||||
|
|
@ -772,7 +771,10 @@ class AutoLayout:
|
||||||
|
|
||||||
no_assign_df = pd.DataFrame(self.no_assign_data)
|
no_assign_df = pd.DataFrame(self.no_assign_data)
|
||||||
no_assign_df = no_assign_df.applymap(lambda x: format_date(x) if isinstance(x, pd.Timestamp) else x)
|
no_assign_df = no_assign_df.applymap(lambda x: format_date(x) if isinstance(x, pd.Timestamp) else x)
|
||||||
|
if not no_assign_df.empty:
|
||||||
no_assign_df_not_balance = ','.join(set([lib for lib in no_assign_df['#library'] if lib in self.split_lib]))
|
no_assign_df_not_balance = ','.join(set([lib for lib in no_assign_df['#library'] if lib in self.split_lib]))
|
||||||
|
else:
|
||||||
|
no_assign_df_not_balance = ''
|
||||||
if no_assign_df_not_balance:
|
if no_assign_df_not_balance:
|
||||||
self.return_log.append(f'文库{no_assign_df_not_balance}有做不平衡文库拆分处理,并且没有排完,请核查!')
|
self.return_log.append(f'文库{no_assign_df_not_balance}有做不平衡文库拆分处理,并且没有排完,请核查!')
|
||||||
if not no_assign_df.empty:
|
if not no_assign_df.empty:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue