From f00a98ce770eedf99fa010bd518acbf114fade4e Mon Sep 17 00:00:00 2001 From: marques <20172333133@m.scnu.edu.cn> Date: Tue, 20 May 2025 15:44:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E8=BE=93=E5=85=A5=E8=B7=AF=E5=BE=84=E4=B8=BA=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- func/Module_approximately_align.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/func/Module_approximately_align.py b/func/Module_approximately_align.py index d161719..febfb0f 100644 --- a/func/Module_approximately_align.py +++ b/func/Module_approximately_align.py @@ -926,15 +926,18 @@ class Data: self.relate_point = None def open_file(self): + if Path(Config["Path"]["Input_orgBcg"]).is_file(): + Config["Path"]["Input_orgBcg"] = str(Path(Config["Path"]["Input_orgBcg"]).parent) + if not Path(Config["Path"]["Input_orgBcg"]).exists(): return Result().failure( - info=Constants.INPUT_FAILURE + "orgBcg: " + Constants.APPROXIMATELY_ALIGN_FAILURE_REASON[ + info=Constants.INPUT_FAILURE + "orgBcg: " + Config["Path"]["Input_orgBcg"] + Constants.APPROXIMATELY_ALIGN_FAILURE_REASON[ "Data_Path_Not_Exist"]) temp_orgBcg_path = list( Path(Config["Path"]["Input_orgBcg"]).glob(f"{ConfigParams.APPROXIMATELY_ALIGN_INPUT_ORGBCG_FILENAME}*")) if len(temp_orgBcg_path) == 0: return Result().failure( - info=Constants.INPUT_FAILURE + "orgBcg: " + Constants.APPROXIMATELY_ALIGN_FAILURE_REASON[ + info=Constants.INPUT_FAILURE + "orgBcg: " + Config["Path"]["Input_orgBcg"] + Constants.APPROXIMATELY_ALIGN_FAILURE_REASON[ "Data_File_Not_Exist"]) elif len(temp_orgBcg_path) > 1: return Result().failure( @@ -950,6 +953,8 @@ class Data: info=Constants.INPUT_FAILURE + "orgBcg: " + Constants.APPROXIMATELY_ALIGN_FAILURE_REASON[ "Data_Frequency_Not_In_Filename"]) Config["InputConfig"]["orgBcgFreq"] = int(orgBcg_freq) + if Path(Config["Path"]["Input_Tho"]).is_file(): + Config["Path"]["Input_Tho"] = str(Path(Config["Path"]["Input_Tho"]).parent) if not Path(Config["Path"]["Input_Tho"]).exists(): return Result().failure( @@ -976,6 +981,8 @@ class Data: "Data_Frequency_Not_In_Filename"]) Config["InputConfig"]["ThoFreq"] = int(tho_freq) + if Path(Config["Path"]["Input_Abd"]).is_file(): + Config["Path"]["Input_Abd"] = str(Path(Config["Path"]["Input_Abd"]).parent) if not Path(Config["Path"]["Input_Abd"]).exists(): return Result().failure(