Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added the selection for num #125

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading