-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refactor file name handling and sequence padding logic. #26
base: develop
Are you sure you want to change the base?
Refactor file name handling and sequence padding logic. #26
Conversation
jakubjezek001
commented
Sep 26, 2024
- Extracted file name from basename for processing.
- Improved handling of sequence padding using regex pattern matching.
- Enhanced file filtering based on the extracted file name.
- Extracted file name from basename for processing. - Improved handling of sequence padding using regex pattern matching. - Enhanced file filtering based on the extracted file name.
- Refactored variable names for improved readability - Updated logic to handle file name patterns consistently
basename = basename.replace("#" * padding, seq_padding) | ||
file_head = basename.split(seq_padding)[0] | ||
is_sequence = True | ||
if "%" in basename: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be elif
? Because after the first if the %
will be in the basename and will then ALSO trigger that logic. Not sure if intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree this will run if the filename had #
in filename, which is not needed, or?
file for file in os.listdir(dirname) | ||
if file_head in file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file for file in os.listdir(dirname) | |
if file_head in file | |
filename | |
for filename in os.listdir(dirname) | |
if filename.startswith(file_head) |