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

Refactor file name handling and sequence padding logic. #26

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

jakubjezek001
Copy link
Member

  • 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.

@jakubjezek001 jakubjezek001 added the type: bug Something isn't working label 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.
- 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:
Copy link
Contributor

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?

Copy link
Member

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?

Comment on lines +679 to +680
file for file in os.listdir(dirname)
if file_head in file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
file for file in os.listdir(dirname)
if file_head in file
filename
for filename in os.listdir(dirname)
if filename.startswith(file_head)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants