-
Notifications
You must be signed in to change notification settings - Fork 58
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
Massive cleanup, using modern python #5
base: main
Are you sure you want to change the base?
Conversation
context managers, tuple unpacking, enumerate all should be used.
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.
Looking good, maybe change f
to file
to be more pythonic though.
I've seen both f and file, with f obviously being short for file, but uhh, I think it's clear enough |
framestamp = timestepToFrames(timestamp) | ||
for elem in schedules[4]: | ||
timestamp, _, phoneme = elem.split(",") | ||
framestamp = timestepToFrames(float(timestamp)) | ||
if i >= 1 and framestamp <= phonemeTimeline[-1][1]: # we have a 0-frame phoneme! Try to fix it. |
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.
The index i
is used here but you removed it
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.
Oh dear, you're right
phoneme = parts[2] | ||
phonemeTimeline.append([phoneme,framestamp]) | ||
phonemeTimeline.append(["end",FRAME_COUNT]) | ||
phonemeTimeline.append([phoneme, framestamp]) |
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.
phoneme
is never set anymore
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.
Fix with phoneme = parts[2]
as original had it
context managers, tuple unpacking, enumerate all should be used.