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

The keyword fps is no longer supported. Use duration(in ms) instead #39

Closed
AlanRvk opened this issue May 3, 2023 · 1 comment · Fixed by #40
Closed

The keyword fps is no longer supported. Use duration(in ms) instead #39

AlanRvk opened this issue May 3, 2023 · 1 comment · Fixed by #40

Comments

@AlanRvk
Copy link

AlanRvk commented May 3, 2023

Output exceeds the size limit. Open the full output data in a text editor---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[40], line 2
1 # show results
----> 2 M.plot_movie(
3 config=["deformed"],
4 view="xz",
5 contour="force",
6 lim_scale=(-0.5, 3.5, -2, 2),
7 force_scale=1.0,
8 cbar_limits=[-1, 1],
9 )

File [~(removedforprivacy)....site-packages/trusspy/model.py:712), in Model.plot_movie(self, config, view, contour, lim_scale, force_scale, nodesize, cbar_limits, incs)
701 def plot_movie(
702 self,
703 config="both",
(...)
710 incs="all",
711 ):
--> 712 p_movie(
713 self,
714 config,
715 view,
716 contour,
...
326 save_args = {
327 "format": format or Image.registered_extensions()[extension],
328 }

TypeError: The keyword fps is no longer supported. Use duration(in ms) instead, e.g. fps=50 == duration=20 (1000 * 1/50).

@adtzlr
Copy link
Owner

adtzlr commented May 3, 2023

Hi @AlanRvk and thanks for reporting!

If I set the duration instead of fps, then I have to use seconds and not milliseconds. Did that change in newer versions of imageio? I have 2.22.1 installed.

Edit

Okay, in 2.28.1 one has to use milliseconds. I'll figure out in which version the change was made and set the duration either in s or ms. I'll remove the pre-defined fps and duration values completely as I don't want to maintain that mess. Instead, optional keyword arguments are passed to the underlying png_to_gif(**kwargs)-call in Model.plot_movie(**kwargs). Then, its up to the user to look into the docs of imageio and set the desired duration.

Model.plot_movie(duration=1000 * 1 / 5)

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 a pull request may close this issue.

2 participants