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

change fps to duration to account for changes to imageio #182

Merged
merged 3 commits into from
Nov 28, 2023

Conversation

aelefebv
Copy link
Contributor

@aelefebv aelefebv commented Aug 17, 2023

Closes: #174

@aelefebv
Copy link
Contributor Author

Alternatively, we could keep fps as a parameter and translate it to duration before passing it to imageio via duration=1000/fps

@jni
Copy link
Member

jni commented Aug 17, 2023

Alternatively, we could keep fps as a parameter and translate it to duration before passing it to imageio via duration=1000/fps

Personally this would be my preference, especially because you could gate that on the imageio version, so there would be no disruption at all to any users (even those with older imageio).

@jni
Copy link
Member

jni commented Aug 17, 2023

I also think it's easier to think about fps

@alisterburt
Copy link
Collaborator

Thanks for the PR @aelefebv ! Much appreciated :-)

I agree with Juan here, we should not mirror the imageio API and should instead keep ours consistent with FPS

@aelefebv
Copy link
Contributor Author

Makes sense to me! Just changed it back to fps and now passing in duration to get_writer.

And thanks again for the great plugin :)

@jni
Copy link
Member

jni commented Sep 1, 2023

Hmmm, perhaps we need a try/except or if/else somewhere to account for multiple imageio versions? The tests are failing with the current changes:

   E       TypeError: FfmpegFormat.Writer._open() got an unexpected keyword argument 'duration'

Copy link

codecov bot commented Nov 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a9ca7a7) 86.25% compared to head (922e8f2) 86.26%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #182      +/-   ##
==========================================
+ Coverage   86.25%   86.26%   +0.01%     
==========================================
  Files          26       26              
  Lines        1011     1012       +1     
==========================================
+ Hits          872      873       +1     
  Misses        139      139              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@psobolewskiPhD
Copy link
Member

@jni The duration kwarg is for pillow plugin only (see imageio/imageio#992 (comment) ) so I just reverted the change for ffmpeg. I think this is good to go, unless you prefer to not have the duration setting in the try: -- could just do it in the imageio call.

@jni jni merged commit 6987699 into napari:main Nov 28, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saving gif animations broken. TypeError: The keyword fps is no longer supported
4 participants