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

clip.fl_time( ... ) docs error #1129

Closed
finnmerlett opened this issue Apr 3, 2020 · 2 comments · Fixed by #1076
Closed

clip.fl_time( ... ) docs error #1129

finnmerlett opened this issue Apr 3, 2020 · 2 comments · Fixed by #1076
Labels
documentation Related to documentation in official project docs or individual docstrings.

Comments

@finnmerlett
Copy link

The examples (in the function definition and in the docs) for the clip.fl_time( ... ) function aren't correct, and it led me to an error that I spent several hours on before I figured out what was wrong (I haven't used python in a while, so someone else would probably have fixed it sooner).

Current example code

>>> # plays the clip (and its mask and sound) twice faster
>>> newclip = clip.fl_time(lambda: 2*t, apply_to=['mask', 'audio'])
>>>
>>> # plays the clip starting at t=3, and backwards:
>>> newclip = clip.fl_time(lambda: 3-t)

Corrected example code

>>> # plays the clip (and its mask and sound) twice faster
>>> newclip = clip.fl_time(lambda t: 2*t, apply_to=['mask', 'audio'])
>>>
>>> # plays the clip starting at t=3, and backwards:
>>> newclip = clip.fl_time(lambda t: 3-t)

(the difference is the addition of t as the bound variable in the lambda functions)

@tburrows13 tburrows13 added the documentation Related to documentation in official project docs or individual docstrings. label Apr 3, 2020
@tburrows13
Copy link
Collaborator

Very sorry that you spent so much time tracking the bug down! Funnily enough I found this yesterday as well. It will definitely be corrected in the next release.

@tburrows13
Copy link
Collaborator

Fixed in #1425

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to documentation in official project docs or individual docstrings.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants