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

Recurring matplotlib warning #23

Closed
gianmatharu opened this issue Feb 26, 2016 · 3 comments
Closed

Recurring matplotlib warning #23

gianmatharu opened this issue Feb 26, 2016 · 3 comments

Comments

@gianmatharu
Copy link
Collaborator

/usr/local/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

This warning occurs when using wrappers to spawn multiple processes pbsdsh/slurm (presumably). Reloading objects that import obspy causes this warning to trigger on each import. At the very least it creates spam in the output.log; it's unclear if there is additional overhead.

matplotlib/matplotlib#5836 - relevant matplotlib discussion.

Would be nice to suppress this or perhaps limit importing Obspy to where necessary.

@rmodrak
Copy link
Collaborator

rmodrak commented Feb 26, 2016

Currently, obspy is imported at module level only once, in seisflows.preprocess.base. A module level import seems appropriate in this case because the main work of the module (i/o and signal processing) rests entirely on obspy calls.

As a workaround, perhaps you could suppress warnings by adding some code at the end of seisflows.tools.config (but don't commit these changes to the master branch). This page I think provides a recipe:
http://stackoverflow.com/questions/14463277/how-to-disable-python-warnings

Since seisflows.tools.config is always imported prior to any other SeisFlows modules, adding code here should reliably suppress warnings.

If you decide to try this approach and it proves successful, could you post an update to this thread?

Thanks,
Ryan

@gianmatharu
Copy link
Collaborator Author

This warning seems to have disappeared without any effort on my part so I'll close this for now.

@mpbl mpbl changed the title Recurring matplotlib warning Recurring matplotlib warning Mar 6, 2016
@rmodrak
Copy link
Collaborator

rmodrak commented Mar 6, 2016

glad to hear

On Sat, Mar 5, 2016 at 9:03 PM, gianmatharu notifications@github.com
wrote:

This warning seems to have disappeared without any effort on my part so
I'll close this for now.


Reply to this email directly or view it on GitHub
#23 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants