Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Milestone
Description
Bug summary
It seems to be thatgif
animations cannot be generated anymore because of empty list forax_fig.lines[0].get_xdata()
.
Currently, I got the following error in the CI run.
UNEXPECTED EXCEPTION: IndexError('list index out of range')Traceback (most recent call last): File "/home/runner/work/useful-math-functions/useful-math-functions/.venv/lib/python3.10/site-packages/matplotlib/animation.py", line 224, in saving yield self File "/home/runner/work/useful-math-functions/useful-math-functions/.venv/lib/python3.10/site-packages/matplotlib/animation.py", line 1126, in save writer.grab_frame(**savefig_kwargs) File "/home/runner/work/useful-math-functions/useful-math-functions/.venv/lib/python3.10/site-packages/matplotlib/animation.py", line 499, in grab_frame self._frame.append(im)AttributeError: 'PillowWriter' object has no attribute '_frame'. Did you mean: '_frames'?During handling of the above exception, another exception occurred:Traceback (most recent call last): File "/home/runner/.local/share/uv/python/cpython-3.10.16-linux-x86_64-gnu/lib/python3.10/doctest.py", line 1350, in __run exec(compile(example.source, filename, "single", File "<doctest umf.images.diagrams.ClassicPlot[30]>", line 1, in <module> File "/home/runner/work/useful-math-functions/useful-math-functions/umf/images/diagrams.py", line 335, in plot_save_gif anim.save(filename=fname, writer="imagemagick", dpi=settings.dpi, **kwargs) File "/home/runner/work/useful-math-functions/useful-math-functions/.venv/lib/python3.10/site-packages/matplotlib/animation.py", line 1098, in save with (writer.saving(self._fig, filename, dpi), File "/home/runner/.local/share/uv/python/cpython-3.10.16-linux-x86_64-gnu/lib/python3.10/contextlib.py", line 153, in __exit__ self.gen.throw(typ, value, traceback) File "/home/runner/work/useful-math-functions/useful-math-functions/.venv/lib/python3.10/site-packages/matplotlib/animation.py", line 226, in saving self.finish() File "/home/runner/work/useful-math-functions/useful-math-functions/.venv/lib/python3.10/site-packages/matplotlib/animation.py", line 506, in finish self._frames[0].save(IndexError: list index out of range/home/runner/work/useful-math-functions/useful-math-functions/umf/images/diagrams.py:73: UnexpectedException
See also:
Code for reproduction
https://github.com/Anselmoo/useful-math-functions/pull/84
Actual outcome
AttributeError:'PillowWriter' object has no attribute'_frame'. Did you mean:'_frames'?
Expected outcome
Working like previouslyAnselmoo/useful-math-functions#71
So, I have tested both backendpoetry
anduv
, but it seems both are not working.
Additional information
If_frame
is changed to_frames
in local.venv
, it is working fine.
dependencies = ["numpy>=2.0.0,<3","pydantic>=2.0.0,<3","scipy>=1.11.2,<2",][project.optional-dependencies]matplotlib = ["matplotlib (>=3.10.0,<4.0.0)","imagemagic (>=0.2.1,<0.3.0)",]
Operating system
No response
Matplotlib Version
3.10.0
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
pip