diff --git a/csst_common/data_manager.py b/csst_common/data_manager.py index a54004d78766bb34dbd6f5a88ab549219c38ff7b..127ae3009779526e51fc0d1d922ef21eafbab189 100644 --- a/csst_common/data_manager.py +++ b/csst_common/data_manager.py @@ -1017,7 +1017,6 @@ class CsstMsFile(dict): self.filename = os.path.basename(filepath) self.dir_l0 = os.path.dirname(filepath) - print("parsing", filepath) # parse filename pattern = re.compile( r"(?P[A-Z]+)_" @@ -1033,7 +1032,11 @@ class CsstMsFile(dict): r"(?P[a-zA-Z._]+)" ) mo = re.fullmatch(pattern, self.filename) - assert mo is not None + try: + assert mo is not None + except AssertionError as ae: + print(self.filename) + raise ae mogd = mo.groupdict() # mogd.pop("detector") @@ -1079,6 +1082,8 @@ class CsstMsFile(dict): return CsstMsFile( filepath=rec["data"].file_path, ver_sim=ver_sim, dir_l0=dir_l0, dir_l1=dir_l1, dfs_root=dfs_root, **header) + def __repr__(self): + return f"CsstMsFile({self.filename})" # file = CsstMsFile( # "L1/MSC/SCI/62173/10160000108/CSST_MSC_MS_SCI_20290206174352_20290206174622_10160000108_21_L1_V01.fits") #