From 6d6c49c9a84ff1708560b732183119cdc90d9e7b Mon Sep 17 00:00:00 2001 From: govin08 Date: Thu, 11 Apr 2024 17:16:20 +0900 Subject: [PATCH] rename : directions -> dires, direction -> dire) --- Scripts/preprocess_daily.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Scripts/preprocess_daily.py b/Scripts/preprocess_daily.py index 11483914b..b8d820141 100644 --- a/Scripts/preprocess_daily.py +++ b/Scripts/preprocess_daily.py @@ -400,14 +400,14 @@ class DailyPreprocessor(): parent_no = self.inter_node[self.inter_node.node_id==child_id].inter_no.iloc[0] sub_inter_node = self.inter_node[self.inter_node.inter_no==parent_no] ch2pa[child_id] = sub_inter_node[sub_inter_node.inter_type=='parent'].iloc[0].node_id - self.directions = ['북', '북동', '동', '남동', '남', '남서', '서', '북서'] # 정북기준 시계방향으로 8방향 + self.dires = ['북', '북동', '동', '남동', '남', '남서', '서', '북서'] # 정북기준 시계방향으로 8방향 # 각 uturn node에 대하여 (inc_edge_id, out_edge_id) 부여 cmatches = [] for _, row in self.uturn.iterrows(): child_id = row.child_id parent_id = row.parent_id - direction = row.direction + dire = row.direction condition = row.condition inc_edge_id = row.inc_edge out_edge_id = row.out_edge @@ -419,18 +419,18 @@ class DailyPreprocessor(): cmatch[['inc_edge', 'out_edge']] = np.nan # 보행신호시/좌회전시 진입/진출방향 - ind = self.directions.index(direction) - inc_dire_pedes = self.directions[(ind + 2) % len(self.directions)] - out_dire_pedes = self.directions[(ind - 2) % len(self.directions)] - inc_dire_right = direction - out_dire_right = self.directions[(ind + 2) % len(self.directions)] + ind = self.dires.index(dire) + inc_dire_pedes = self.dires[(ind + 2) % len(self.dires)] + out_dire_pedes = self.dires[(ind - 2) % len(self.dires)] + inc_dire_right = dire + out_dire_right = self.dires[(ind + 2) % len(self.dires)] # 보행신호시/좌회전시 조건 pedes_exists = (cmatch.inc_dire==inc_dire_pedes) & (cmatch.out_dire==out_dire_pedes) right_exists = (cmatch.inc_dire==inc_dire_right) & (cmatch.out_dire==out_dire_right) # 보행신호시/좌회전시 진입/진출 엣지id 배정 - ind = self.directions.index(direction) + ind = self.dires.index(dire) if condition == "보행신호시": cmatch.loc[pedes_exists, ['inc_edge', 'out_edge']] = [inc_edge_id, out_edge_id] elif condition == "좌회전시": @@ -452,10 +452,10 @@ class DailyPreprocessor(): cmatch.loc[pedes_exists, ['inc_edge', 'out_edge']] = [inc_edge_id, out_edge_id] # 보행신호이동류(17) 발생시 elif crosswalk_on.any(): - cmatch.loc[crosswalk_on & (cmatch.out_dire!=direction), ['inc_edge', 'out_edge']] = [inc_edge_id, out_edge_id] + cmatch.loc[crosswalk_on & (cmatch.out_dire!=dire), ['inc_edge', 'out_edge']] = [inc_edge_id, out_edge_id] # 신호없음이동류(18) 발생시 elif all_redsigns.any(): - cmatch.loc[all_redsigns & (cmatch.out_dire!=direction), ['inc_edge', 'out_edge']] = [inc_edge_id, out_edge_id] + cmatch.loc[all_redsigns & (cmatch.out_dire!=dire), ['inc_edge', 'out_edge']] = [inc_edge_id, out_edge_id] cmatches.append(cmatch) # 각 연등교차로(coordination node)에 대하여 (inc_edge_id, out_edge_id) 부여