-
Notifications
You must be signed in to change notification settings - Fork 100
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
'period_length' not kept when only changing 'steps_per_period' in gif animation #11
Comments
Hey! Thank you very much for the feedback The current implementation is the period length defines how long to show each 'row' of data for, and the steps_per_period will essentially make that 'row' show for the number of times you specify, hence why it seems 'slower' at higher numbers because it'll show that 'row' for 4 times as long. This is done by interpolating the dataframe by the steps_per_period (https://github.com/JackMcKew/pandas_alive/blob/main/pandas_alive/_base_chart.py#L124) This functionality is intended, for 'faster' animations, I'd suggest leaving steps_per_period as 1 and using a smaller period_length For ease of reproducibility, here is a colab version of the notebook attached: https://colab.research.google.com/drive/1UnGPh4azfIz36IqwnEdHd3-jvNhy0-9u?usp=sharing |
Thanks for the quick reply. Conclusion: your code is tip-top on this, default .GIF output sucks at high FPS, and 'ffmpeg' with .MP4 wins hands down. |
Also, I've tested further your tool and uploaded to the colab area: pendulum_sample_2.ipynb. I've now generated a line and a bar race chart animations. Then I combined them using animate_multiple_plots, and it works! I have the following comments:
Thanks for your time on this. |
Thank you again for the kind words, it's very much appreciated! Regarding the first comment: In-memory writing to GIF wasn't supported at first, until I had a number of users complaining they needed to install an external dependency, thus it was never considered a first class method in my eyes. I remember looking into the fps problem in memory, and the current implementation makes use of Pillow for writing in memory, which from my understanding doesn't have an Regarding the second comment:
|
Thanks for the answers. When I get a min I may dive into your code a bit, and see if we resolve the mystery of the closed line plots! My problem is that I'm fairly new to Github, only use it for my small projects, and pages for web devs. I've never done a PR so I may dig in in the docs and learn how to do it, and give you a hand, if I can. I may fire some questions on the way if that's OK, before I screw anything up... Have a good day, I'll be in touch, I'm gonna test further your tool, I do think there are good applications for it, and I'm hoping to be able to add some (non-covid) examples. |
Here's a good introductory article for submitting PRs: https://opensource.com/article/19/7/create-pull-request-github. Feel free to reach out on any of my social medias linked on my profile for anything that I can help with. |
Thanks for the link, gonna give it a go this week, see what rabbit holes I find...
Thanks. |
Awesome! Regarding your questions above:
These are all great things that I will put on my to do list to add to the developer notes in the README |
Excellent! Will have a read and see where all that takes me. |
Create a branch off of Following all of that, then we go through the thorough testing and documentation updates, before merging into main and publishing a new release. |
Hi Jack. I've done quite a bit of reading/learning on setups, etc. Since I'm so new to all these setups and methods, I'm afraid I still have some questions:
As you mention in your blog somewhere, imagine you're talking to a 5-year old here... Thanks. |
Hey! Having questions is fantastic! In regard to 1, I stopped using anaconda as it seemed to bloat my hard drive like nothing else (eg, if you install pandas in anaconda, it comes with mkl which from memory is ~150MB). I've never tried packaging from within anaconda, and personally prefer using Poetry (https://jackmckew.dev/packaging-python-packages-with-poetry.html) Regarding number 2, I don't think this would be a problem at all, provided the package in the end is still done with Poetry, I'm not sure on the interaction between Poetry and Anaconda but Poetry only depends on the source code of the package In conclusion, however you're doing local development, whether it's with pip, anaconda, etc doesn't matter as it'll still only be a change to the source code for which we can use Poetry to package for PyPI Hope this makes sense, please feel free to ask any questions |
Makes a lot of sense, thanks again. |
Since I spent quite a bit of time getting my head around Python set-ups with Python set up with
|
My apologies for not replying to this sooner! 🙃 I've added this in 5cfa900 which will form part of the documentation. The |
Hi Jack,
Firstly, many things for sharing this great tool, it worked out of the box for me!
So, I played with a small python (see attached jupyter notebook) with a simple pendulum equation plotting angle, ang_velocity & ang_acceleration. Then I used your tool and got nice gif animations.
However, I noticed that for period_length of 50ms (see last cell in attached notebook), it works fine for 1 & 2 steps_per_period, but when I try 3 or 4 the period seems much longer than 50ms; i.e. slower animation. Would you know why, is it because the period needs to be an integer and something happens depending on number of frames?
Cheers,
Jesus
pendulum_sample.zip
The text was updated successfully, but these errors were encountered: