Skip to content

Commit

Permalink
added the selection for num
Browse files Browse the repository at this point in the history
  • Loading branch information
Joejoedesu committed Mar 21, 2024
1 parent d4a9853 commit b3b7015
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sam/onyx/generate_matrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,15 @@ def find_file_based_on_sub_string(files_dir, sub_string_list):
for sub_str in sub_string_list:
if sub_str not in file_name:
match = False
break
elif len(sub_str) > 0:
if sub_str[-1].isdigit():
idx = file_name.find(sub_str) # potential bug: might be more than 1 match
if idx + len(sub_str) < len(file_name):
if file_name[idx + len(sub_str)].isdigit():
match = False
break

if match:
matched_files.append(file_name)
assert len(matched_files) <= 1, f"[Error] More than 1 files are matched: {matched_files}"
Expand Down

0 comments on commit b3b7015

Please sign in to comment.