LCAV / pyroomacoustics

Pyroomacoustics is a package for audio signal processing for indoor applications. It was developed as a fast prototyping platform for beamforming algorithms in indoor scenarios.
https://pyroomacoustics.readthedocs.io
MIT License
1.35k stars 419 forks source link

Make matplotlib imports optional throughout the library #19

Closed fakufaku closed 5 years ago

fakufaku commented 6 years ago

When matplotlib is loaded on a system without a display (i.e. servers or computing nodes), calling matplotlib with a different backen than 'Agg' will cause a crash.

The solution is to limit matplotlib imports to calls that actually plot something.

boeddeker commented 6 years ago

In https://github.com/ipython/ipython/pull/10974 is a PR to fix that and a workaround to hide this bug.

fakufaku commented 6 years ago

@boeddeker Thanks for the pointer! I guess implementing the workaround would take the same effort as moving the imports into the dedicated functions...

boeddeker commented 6 years ago

You are right. I only wanted to give a pointer to those that also hit this bug. Your solution to move the plotting stuff imports in dedicated functions sounds good.

fakufaku commented 6 years ago

It is good to know that it is a known issue of ipython. I spent quite some frustrating time trying to debug that... Now I just need to sit down and do this ;)

boeddeker commented 6 years ago

I also invested some time to figure out where the cause of the bug is. Only ipython has this bug (Python works fine with matplotlib and Qt backend).

fakufaku commented 6 years ago

In my case, I use ipyparallel for parallel simulations and this was particularly frustrating to debug... :-/

fakufaku commented 5 years ago

Addressed by PR #55