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

qt3scope - unbound cache error matplotlib.animation #93

Open
gadamc opened this issue Mar 13, 2023 · 2 comments
Open

qt3scope - unbound cache error matplotlib.animation #93

gadamc opened this issue Mar 13, 2023 · 2 comments
Labels
code improvement good first issue Good for newcomers help wanted Extra attention is needed

Comments

@gadamc
Copy link
Collaborator

gadamc commented Mar 13, 2023

When installing and running qt3scope on the QDL in B069, a warning was reported to the console at startup. The warning was issued for line 161 of oscilloscope.py and mentioned "did not pass explicit save_count"

However, qt3scope seemed to work as expected.

@gadamc gadamc added help wanted Extra attention is needed good first issue Good for newcomers code improvement labels Jun 21, 2023
@NnguyenHTommy
Copy link
Contributor

Similarly, when installing and running qt3scope on the SiV microscope in B065, a warning was reported:
C:\Users\SiV Microscope\anaconda3\envs\qt3-producers\lib\site-packages\applications\oscilloscope.py:161: UserWarning: frames=<bound method RateCounterBase.yield_count_rate of <qt3utils.datagenerators.daqsamplers.NiDaqDigitalInputRateCounter object at 0x000001C4EC494190>> which we can infer the length of, did not pass an explicit save_count and passed cache_frame_data=True. To avoid a possibly unbounded cache, frame data caching has been disabled. To suppress this warning either pass cache_frame_data=False or save_count=MAX_FRAMES.
self.animation = animation.FuncAnimation(self.view.scope_view.fig,

@vasilisniaouris
Copy link
Collaborator

I have observed the same error on our big-magnet set-up in B069. For clarification, the only time it is used internally in matplotlib/lib/matplotlib/animation.FuncAnimation is around line 1760, where each generated frame data sequence (generated via the yield count rate method in our case) is stored internally in FuncAnimation._save_seq.

The warning is removed by passing a cache_frame_data=False to the animation.FrameAnimation function call. I believe that disabling the caching functionality is beneficial to animation speed, since we do not require to store any of the data as of now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code improvement good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants