From d74738eaf21284b8026887a9789c703782f35788 Mon Sep 17 00:00:00 2001 From: govin08 Date: Thu, 11 Apr 2024 17:18:08 +0900 Subject: [PATCH] rename : vect -> vec --- Scripts/preprocess_daily.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Scripts/preprocess_daily.py b/Scripts/preprocess_daily.py index b8d820141..f5ca9d14e 100644 --- a/Scripts/preprocess_daily.py +++ b/Scripts/preprocess_daily.py @@ -335,20 +335,20 @@ class DailyPreprocessor(): inc_edges = [edge for edge in node.getIncoming() if edge.getFunction() == ''] # incoming edges out_edges = [edge for edge in node.getOutgoing() if edge.getFunction() == ''] # outgoing edges # 교차로의 모든 (from / to) directions (unit vector) - inc_vects = [] + inc_vecs = [] for inc_edge in inc_edges: start = inc_edge.getShape()[-2] end = inc_edge.getShape()[-1] - inc_vect = np.array(end) - np.array(start) - inc_vect = inc_vect / (inc_vect ** 2).sum() ** 0.5 - inc_vects.append(inc_vect) - out_vects = [] + inc_vec = np.array(end) - np.array(start) + inc_vec = inc_vec / (inc_vec ** 2).sum() ** 0.5 + inc_vecs.append(inc_vec) + out_vecs = [] for out_edge in out_edges: start = out_edge.getShape()[0] end = out_edge.getShape()[1] - out_vect = np.array(end) - np.array(start) - out_vect = out_vect / (out_vect ** 2).sum() ** 0.5 - out_vects.append(out_vect) + out_vec = np.array(end) - np.array(start) + out_vec = out_vec / (out_vec ** 2).sum() ** 0.5 + out_vecs.append(out_vec) # 진입각, 진출각 불러오기 if not pd.isna(row.inc_angle): inc_angle = int(row.inc_angle) @@ -356,13 +356,13 @@ class DailyPreprocessor(): # 방위각을 일반각으로 가공, 라디안 변환, 단위벡터로 변환 inc_angle = (-90 - inc_angle) % 360 inc_angle = inc_angle * np.pi / 180. - inc_vect_true = np.array([np.cos(inc_angle), np.sin(inc_angle)]) + inc_vec_true = np.array([np.cos(inc_angle), np.sin(inc_angle)]) out_angle = (90 - out_angle) % 360 out_angle = out_angle * np.pi / 180. - out_vect_true = np.array([np.cos(out_angle), np.sin(out_angle)]) + out_vec_true = np.array([np.cos(out_angle), np.sin(out_angle)]) # 매칭 엣지 반환 - inc_index = np.array([np.dot(inc_vect, inc_vect_true) for inc_vect in inc_vects]).argmax() - out_index = np.array([np.dot(out_vect, out_vect_true) for out_vect in out_vects]).argmax() + inc_index = np.array([np.dot(inc_vec, inc_vec_true) for inc_vec in inc_vecs]).argmax() + out_index = np.array([np.dot(out_vec, out_vec_true) for out_vec in out_vecs]).argmax() inc_edge_id = inc_edges[inc_index].getID() out_edge_id = out_edges[out_index].getID() self.match5.at[index, 'inc_edge'] = inc_edge_id